00001 /* 00002 00003 Copyright (c) 2010, Embedded Adventures, www.embeddedadventures.com 00004 All rights reserved. 00005 00006 Redistribution and use in source and binary forms, with or without 00007 modification, are permitted provided that the following conditions are met: 00008 00009 - Redistributions of source code must retain the above copyright notice, 00010 this list of conditions and the following disclaimer. 00011 00012 - Redistributions in binary form must reproduce the above copyright 00013 notice, this list of conditions and the following disclaimer in the 00014 documentation and/or other materials provided with the distribution. 00015 00016 - Neither the name of Embedded Adventures nor the names of its contributors 00017 may be used to endorse or promote products derived from this software 00018 without specific prior written permission. 00019 00020 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00021 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00022 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00023 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 00024 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 00025 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 00026 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 00027 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 00028 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 00029 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 00030 THE POSSIBILITY OF SUCH DAMAGE. 00031 00032 Contact us at admin@embeddedadventures.com 00033 00034 */ 00035 00045 #ifndef __pic_usb_buffer_mgt_h 00046 #define __pic_ubs_buffer_mgt_h 00047 00048 #include "pic_usb.h" 00049 #include "config.h" 00050 00051 extern buffer_descriptor bd0out_e; 00052 extern buffer_descriptor bd0out_o; 00053 extern buffer_descriptor bd0in; 00054 extern buffer_descriptor bd1out; 00055 extern buffer_descriptor bd1in; 00056 extern buffer_descriptor bd2out; 00057 extern buffer_descriptor bd2in; 00058 extern buffer_descriptor bd3out; 00059 extern buffer_descriptor bd3in; 00060 extern buffer_descriptor bd4out; 00061 extern buffer_descriptor bd4in; 00062 extern buffer_descriptor bd5out; 00063 extern buffer_descriptor bd5in; 00064 extern buffer_descriptor bd6out; 00065 extern buffer_descriptor bd6in; 00066 extern buffer_descriptor bd7out; 00067 extern buffer_descriptor bd7in; 00068 00069 extern uns8 buffer_0_out_e[USB_EP0_OUT_E_SIZE]; 00070 extern uns8 buffer_0_out_o[USB_EP0_OUT_O_SIZE]; 00071 00072 extern uns8 buffer_0_in [USB_EP0_IN_SIZE]; 00073 00074 #ifdef USB_EP1_IN_SIZE 00075 extern uns8 buffer_1_in [USB_EP1_IN_SIZE]; 00076 #endif 00077 #ifdef USB_EP1_OUT_SIZE 00078 extern uns8 buffer_1_out [USB_EP1_OUT_SIZE]; 00079 #endif 00080 #ifdef USB_EP2_IN_SIZE 00081 extern uns8 buffer_2_in [USB_EP2_IN_SIZE]; 00082 #endif 00083 #ifdef USB_EP2_OUT_SIZE 00084 extern uns8 buffer_2_out [USB_EP2_OUT_SIZE]; 00085 #endif 00086 #ifdef USB_EP3_IN_SIZE 00087 extern uns8 buffer_3_in [USB_EP3_IN_SIZE]; 00088 #endif 00089 #ifdef USB_EP3_OUT_SIZE 00090 extern uns8 buffer_3_out [USB_EP3_OUT_SIZE]; 00091 #endif 00092 00093 extern buffer_descriptor * ep_in_bd_location[USB_HIGHEST_EP + 1]; 00094 extern buffer_descriptor * ep_out_bd_location[USB_HIGHEST_EP + 1]; 00095 00096 extern uns8 * ep_in_buffer_location[USB_HIGHEST_EP + 1]; 00097 extern uns8 * ep_out_buffer_location[USB_HIGHEST_EP + 1]; 00098 extern uns16 ep_in_buffer_size[USB_HIGHEST_EP + 1]; 00099 extern uns16 ep_out_buffer_size[USB_HIGHEST_EP + 1]; 00100 00101 #endif 00102