00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038 #include "pic_usb_buffer_mgt.h"
00039 #ifndef _PIC18F14K50
00040 buffer_descriptor bd0out_e@0x400;
00041 buffer_descriptor bd0out_o@0x404;
00042 buffer_descriptor bd0in @0x408;
00043 buffer_descriptor bd1out@0x40C;
00044 buffer_descriptor bd1in @0x410;
00045 buffer_descriptor bd2out@0x414;
00046 buffer_descriptor bd2in @0x418;
00047 buffer_descriptor bd3out@0x41c;
00048 buffer_descriptor bd3in @0x420;
00049 buffer_descriptor bd4out@0x424;
00050 buffer_descriptor bd4in @0x428;
00051 buffer_descriptor bd5out@0x42c;
00052 buffer_descriptor bd5in @0x430;
00053 buffer_descriptor bd6out@0x434;
00054 buffer_descriptor bd6in @0x438;
00055 buffer_descriptor bd7out@0x43c;
00056 buffer_descriptor bd7in @0x440;
00057 #else
00058 buffer_descriptor bd0out_e@0x200;
00059 buffer_descriptor bd0out_o@0x204;
00060 buffer_descriptor bd0in @0x208;
00061 buffer_descriptor bd1out@0x20c;
00062 buffer_descriptor bd1in @0x210;
00063 buffer_descriptor bd2out@0x214;
00064 buffer_descriptor bd2in @0x218;
00065 buffer_descriptor bd3out@0x21c;
00066 buffer_descriptor bd3in @0x220;
00067
00068
00069
00070
00071
00072
00073
00074
00075 #endif
00076
00077 uns8 buffer_0_out_e[USB_EP0_OUT_E_SIZE]@ USB_EP0_OUT_E_ADDR;
00078 uns8 buffer_0_out_o[USB_EP0_OUT_O_SIZE]@ USB_EP0_OUT_O_ADDR;
00079
00080 uns8 buffer_0_in [USB_EP0_IN_SIZE] @ USB_EP0_IN_ADDR;
00081
00082 #ifdef USB_EP1_IN_SIZE
00083 uns8 buffer_1_in [USB_EP1_IN_SIZE] @USB_EP1_IN_ADDR;
00084 #endif
00085 #ifdef USB_EP1_OUT_SIZE
00086 uns8 buffer_1_out [USB_EP1_OUT_SIZE] @ USB_EP1_OUT_ADDR;
00087 #endif
00088 #ifdef USB_EP2_IN_SIZE
00089 uns8 buffer_2_in [USB_EP2_IN_SIZE] @ USB_EP2_IN_ADDR;
00090 #endif
00091 #ifdef USB_EP2_OUT_SIZE
00092 uns8 buffer_2_out [USB_EP2_OUT_SIZE] @ USB_EP2_OUT_ADDR;
00093 #endif
00094 #ifdef USB_EP3_IN_SIZE
00095 uns8 buffer_3_in [USB_EP3_IN_SIZE] @ USB_EP3_IN_ADDR;
00096 #endif
00097 #ifdef USB_EP3_OUT_SIZE
00098 uns8 buffer_3_out [USB_EP3_OUT_SIZE] @ USB_EP3_OUT_ADDR;
00099 #endif
00100
00101 buffer_descriptor * ep_in_bd_location[USB_HIGHEST_EP + 1];
00102 buffer_descriptor * ep_out_bd_location[USB_HIGHEST_EP + 1];
00103
00104 uns8 * ep_in_buffer_location[USB_HIGHEST_EP + 1] = {
00105
00106
00107 &buffer_0_in,
00108
00109 #if USB_HIGHEST_EP >= 1
00110 #ifdef USB_EP1_IN_SIZE
00111 &buffer_1_in,
00112 #else
00113 0,
00114 #endif
00115 #endif
00116
00117 #if USB_HIGHEST_EP >= 2
00118 #ifdef USB_EP2_IN_SIZE
00119 &buffer_2_in,
00120 #else
00121 0,
00122 #endif
00123 #endif
00124
00125 #if USB_HIGHEST_EP >= 3
00126 #ifdef USB_EP3_IN_SIZE
00127 &buffer_3_in,
00128 #else
00129 0,
00130 #endif
00131 #endif
00132
00133 #if USB_HIGHEST_EP >= 4
00134 #ifdef USB_EP4_IN_SIZE
00135 &buffer_4_in,
00136 #else
00137 0,
00138 #endif
00139 #endif
00140 };
00141
00142 uns8 * ep_out_buffer_location[USB_HIGHEST_EP + 1] = {
00143
00144
00145 &buffer_0_out_e,
00146
00147 #if USB_HIGHEST_EP >= 1
00148 #ifdef USB_EP1_OUT_SIZE
00149 &buffer_1_out,
00150 #else
00151 0,
00152 #endif
00153 #endif
00154
00155 #if USB_HIGHEST_EP >= 2
00156 #ifdef USB_EP2_OUT_SIZE
00157 &buffer_2_out,
00158 #else
00159 0,
00160 #endif
00161 #endif
00162
00163 #if USB_HIGHEST_EP >= 3
00164 #ifdef USB_EP3_OUT_SIZE
00165 &buffer_3_out,
00166 #else
00167 0,
00168 #endif
00169 #endif
00170
00171 #if USB_HIGHEST_EP >= 4
00172 #ifdef USB_EP4_OUT_SIZE
00173 &buffer_4_out,
00174 #else
00175 0,
00176 #endif
00177 #endif
00178 };
00179
00180
00181 uns16 ep_in_buffer_size[USB_HIGHEST_EP + 1] = {
00182 USB_EP0_IN_SIZE,
00183
00184 #if USB_HIGHEST_EP >= 1
00185 #ifdef USB_EP1_IN_SIZE
00186 USB_EP1_IN_SIZE,
00187 #else
00188 0,
00189 #endif
00190 #endif
00191
00192 #if USB_HIGHEST_EP >= 2
00193 #ifdef USB_EP2_IN_SIZE
00194 USB_EP2_IN_SIZE,
00195 #else
00196 0,
00197 #endif
00198 #endif
00199
00200 #if USB_HIGHEST_EP >= 3
00201 #ifdef USB_EP3_IN_SIZE
00202 USB_EP3_IN_SIZE,
00203 #else
00204 0,
00205 #endif
00206 #endif
00207
00208 #if USB_HIGHEST_EP >= 4
00209 #ifdef USB_EP4_IN_SIZE
00210 USB_EP4_IN_SIZE,
00211 #else
00212 0,
00213 #endif
00214 #endif
00215 };
00216
00217
00218
00219 uns16 ep_out_buffer_size[USB_HIGHEST_EP + 1] = {
00220 USB_EP0_OUT_E_SIZE,
00221
00222 #if USB_HIGHEST_EP >= 1
00223 #ifdef USB_EP1_OUT_SIZE
00224 USB_EP1_OUT_SIZE,
00225 #else
00226 0,
00227 #endif
00228 #endif
00229
00230 #if USB_HIGHEST_EP >= 2
00231 #ifdef USB_EP2_OUT_SIZE
00232 USB_EP2_OUT_SIZE,
00233 #else
00234 0,
00235 #endif
00236 #endif
00237
00238 #if USB_HIGHEST_EP >= 3
00239 #ifdef USB_EP3_OUT_SIZE
00240 USB_EP3_OUT_SIZE,
00241 #else
00242 0,
00243 #endif
00244 #endif
00245
00246 #if USB_HIGHEST_EP >= 4
00247 #ifdef USB_EP4_OUT_SIZE
00248 USB_EP4_OUT_SIZE,
00249 #else
00250 0,
00251 #endif
00252 #endif
00253 };