00001
00015 #include "pic_usb_buffer_mgt.h"
00016
00017 buffer_descriptor bd0out@0x400;
00018 buffer_descriptor bd0in @0x404;
00019 buffer_descriptor bd1out@0x408;
00020 buffer_descriptor bd1in @0x40C;
00021 buffer_descriptor bd2out@0x410;
00022 buffer_descriptor bd2in @0x414;
00023 buffer_descriptor bd3out@0x418;
00024 buffer_descriptor bd3in @0x41c;
00025 buffer_descriptor bd4out@0x420;
00026 buffer_descriptor bd4in @0x424;
00027 buffer_descriptor bd5out@0x428;
00028 buffer_descriptor bd5in @0x42C;
00029 buffer_descriptor bd6out@0x430;
00030 buffer_descriptor bd6in @0x434;
00031 buffer_descriptor bd7out@0x438;
00032 buffer_descriptor bd7in @0x43C;
00033
00034 uns8 buffer_0_out[USB_EP0_OUT_SIZE]@ USB_EP0_OUT_ADDR;
00035 uns8 buffer_0_in [USB_EP0_IN_SIZE] @ USB_EP0_IN_ADDR;
00036
00037 #ifdef USB_EP1_IN_SIZE
00038 uns8 buffer_1_in [USB_EP1_IN_SIZE] @USB_EP1_IN_ADDR;
00039 #endif
00040 #ifdef USB_EP1_OUT_SIZE
00041 uns8 buffer_1_out [USB_EP1_OUT_SIZE] @ USB_EP1_OUT_ADDR;
00042 #endif
00043 #ifdef USB_EP2_IN_SIZE
00044 uns8 buffer_2_in [USB_EP2_IN_SIZE] @ USB_EP2_IN_ADDR;
00045 #endif
00046 #ifdef USB_EP2_OUT_SIZE
00047 uns8 buffer_2_out [USB_EP2_OUT_SIZE] @ USB_EP2_OUT_ADDR;
00048 #endif
00049 #ifdef USB_EP3_IN_SIZE
00050 uns8 buffer_3_in [USB_EP3_IN_SIZE] @ USB_EP3_IN_ADDR;
00051 #endif
00052 #ifdef USB_EP3_OUT_SIZE
00053 uns8 buffer_3_out [USB_EP3_OUT_SIZE] @ USB_EP3_OUT_ADDR;
00054 #endif
00055
00056 buffer_descriptor * ep_in_bd_location[USB_HIGHEST_EP + 1];
00057 buffer_descriptor * ep_out_bd_location[USB_HIGHEST_EP + 1];
00058
00059 uns8 * ep_in_buffer_location[USB_HIGHEST_EP + 1] = {
00060
00061
00062 &buffer_0_in,
00063
00064 #if USB_HIGHEST_EP >= 1
00065 #ifdef USB_EP1_IN_SIZE
00066 &buffer_1_in,
00067 #else
00068 0,
00069 #endif
00070 #endif
00071
00072 #if USB_HIGHEST_EP >= 2
00073 #ifdef USB_EP2_IN_SIZE
00074 &buffer_2_in,
00075 #else
00076 0,
00077 #endif
00078 #endif
00079
00080 #if USB_HIGHEST_EP >= 3
00081 #ifdef USB_EP3_IN_SIZE
00082 &buffer_3_in,
00083 #else
00084 0,
00085 #endif
00086 #endif
00087
00088 #if USB_HIGHEST_EP >= 4
00089 #ifdef USB_EP4_IN_SIZE
00090 &buffer_4_in,
00091 #else
00092 0,
00093 #endif
00094 #endif
00095 };
00096
00097 uns8 * ep_out_buffer_location[USB_HIGHEST_EP + 1] = {
00098
00099
00100 &buffer_0_out,
00101
00102 #if USB_HIGHEST_EP >= 1
00103 #ifdef USB_EP1_OUT_SIZE
00104 &buffer_1_out,
00105 #else
00106 0,
00107 #endif
00108 #endif
00109
00110 #if USB_HIGHEST_EP >= 2
00111 #ifdef USB_EP2_OUT_SIZE
00112 &buffer_2_out,
00113 #else
00114 0,
00115 #endif
00116 #endif
00117
00118 #if USB_HIGHEST_EP >= 3
00119 #ifdef USB_EP3_OUT_SIZE
00120 &buffer_3_out,
00121 #else
00122 0,
00123 #endif
00124 #endif
00125
00126 #if USB_HIGHEST_EP >= 4
00127 #ifdef USB_EP4_OUT_SIZE
00128 &buffer_4_out,
00129 #else
00130 0,
00131 #endif
00132 #endif
00133 };
00134
00135
00136 uns16 ep_in_buffer_size[USB_HIGHEST_EP + 1] = {
00137 USB_EP0_IN_SIZE,
00138
00139 #if USB_HIGHEST_EP >= 1
00140 #ifdef USB_EP1_IN_SIZE
00141 USB_EP1_IN_SIZE,
00142 #else
00143 0,
00144 #endif
00145 #endif
00146
00147 #if USB_HIGHEST_EP >= 2
00148 #ifdef USB_EP2_IN_SIZE
00149 USB_EP2_IN_SIZE,
00150 #else
00151 0,
00152 #endif
00153 #endif
00154
00155 #if USB_HIGHEST_EP >= 3
00156 #ifdef USB_EP3_IN_SIZE
00157 USB_EP3_IN_SIZE,
00158 #else
00159 0,
00160 #endif
00161 #endif
00162
00163 #if USB_HIGHEST_EP >= 4
00164 #ifdef USB_EP4_IN_SIZE
00165 USB_EP4_IN_SIZE,
00166 #else
00167 0,
00168 #endif
00169 #endif
00170 };
00171
00172
00173
00174 uns16 ep_out_buffer_size[USB_HIGHEST_EP + 1] = {
00175 USB_EP0_OUT_SIZE,
00176
00177 #if USB_HIGHEST_EP >= 1
00178 #ifdef USB_EP1_OUT_SIZE
00179 USB_EP1_OUT_SIZE,
00180 #else
00181 0,
00182 #endif
00183 #endif
00184
00185 #if USB_HIGHEST_EP >= 2
00186 #ifdef USB_EP2_OUT_SIZE
00187 USB_EP2_OUT_SIZE,
00188 #else
00189 0,
00190 #endif
00191 #endif
00192
00193 #if USB_HIGHEST_EP >= 3
00194 #ifdef USB_EP3_OUT_SIZE
00195 USB_EP3_OUT_SIZE,
00196 #else
00197 0,
00198 #endif
00199 #endif
00200
00201 #if USB_HIGHEST_EP >= 4
00202 #ifdef USB_EP4_OUT_SIZE
00203 USB_EP4_OUT_SIZE,
00204 #else
00205 0,
00206 #endif
00207 #endif
00208 };