📄 main.lst
字号:
\ 4D0049004300
\ 52
\ 00000013 004F000000 DC8 0, 79, 0, 0, 0
180
181 USBStringDescriptor_LENGTH(10),
182 USBGenericDescriptor_STRING,
183 USBStringDescriptor_UNICODE('T'),
184 USBStringDescriptor_UNICODE('A'),
185 USBStringDescriptor_UNICODE('I'),
186 USBStringDescriptor_UNICODE('H'),
187 USBStringDescriptor_UNICODE('U'),
188 USBStringDescriptor_UNICODE('M'),
189 USBStringDescriptor_UNICODE('I'),
190 USBStringDescriptor_UNICODE('C'),
191 USBStringDescriptor_UNICODE('R'),
192 USBStringDescriptor_UNICODE('O')
193 };
194
195 /// Product string descriptor.
\ In section .rodata, align 4
196 static const unsigned char productDescriptor[] = {
\ productDescriptor:
\ 00000000 2C0354004100 DC8 44, 3, 84, 0, 65, 0, 73, 0, 72, 0, 85, 0, 77, 0, 73, 0, 67, 0, 82
\ 490048005500
\ 4D0049004300
\ 52
\ 00000013 004F00200055 DC8 0, 79, 0, 32, 0, 85, 0, 83, 0, 66, 0, 32, 0, 68, 0, 69, 0, 86, 0
\ 005300420020
\ 004400450056
\ 00
\ 00000026 490043004500 DC8 73, 0, 67, 0, 69, 0
197
198 USBStringDescriptor_LENGTH(21),
199 USBGenericDescriptor_STRING,
200 USBStringDescriptor_UNICODE('T'),
201 USBStringDescriptor_UNICODE('A'),
202 USBStringDescriptor_UNICODE('I'),
203 USBStringDescriptor_UNICODE('H'),
204 USBStringDescriptor_UNICODE('U'),
205 USBStringDescriptor_UNICODE('M'),
206 USBStringDescriptor_UNICODE('I'),
207 USBStringDescriptor_UNICODE('C'),
208 USBStringDescriptor_UNICODE('R'),
209 USBStringDescriptor_UNICODE('O'),
210 USBStringDescriptor_UNICODE(' '),
211 USBStringDescriptor_UNICODE('U'),
212 USBStringDescriptor_UNICODE('S'),
213 USBStringDescriptor_UNICODE('B'),
214 USBStringDescriptor_UNICODE(' '),
215 USBStringDescriptor_UNICODE('D'),
216 USBStringDescriptor_UNICODE('E'),
217 USBStringDescriptor_UNICODE('V'),
218 USBStringDescriptor_UNICODE('I'),
219 USBStringDescriptor_UNICODE('C'),
220 USBStringDescriptor_UNICODE('E')
221 };
222
223 /// Serial number string descriptor. The serial number must be at least 12
224 /// characters long and made up of only letters & numbers to be compliant with
225 /// the MSD specification.
\ In section .rodata, align 4
226 static const unsigned char serialNumberDescriptor[] = {
\ serialNumberDescriptor:
\ 00000000 1A0330003100 DC8 26, 3, 48, 0, 49, 0, 50, 0, 51, 0, 52, 0, 53, 0, 54, 0, 55, 0, 56
\ 320033003400
\ 350036003700
\ 38
\ 00000013 003900410042 DC8 0, 57, 0, 65, 0, 66, 0, 0, 0
\ 000000
227
228 USBStringDescriptor_LENGTH(12),
229 USBGenericDescriptor_STRING,
230 USBStringDescriptor_UNICODE('0'),
231 USBStringDescriptor_UNICODE('1'),
232 USBStringDescriptor_UNICODE('2'),
233 USBStringDescriptor_UNICODE('3'),
234 USBStringDescriptor_UNICODE('4'),
235 USBStringDescriptor_UNICODE('5'),
236 USBStringDescriptor_UNICODE('6'),
237 USBStringDescriptor_UNICODE('7'),
238 USBStringDescriptor_UNICODE('8'),
239 USBStringDescriptor_UNICODE('9'),
240 USBStringDescriptor_UNICODE('A'),
241 USBStringDescriptor_UNICODE('B')
242 };
243
244 /// List of all string descriptors used.
\ In section .data, align 4
245 static const unsigned char *stringDescriptors[] = {
\ stringDescriptors:
\ 00000000 ............ DC32 languageIdDescriptor, manufacturerDescriptor, productDescriptor
\ ............
\ 0000000C ........ DC32 serialNumberDescriptor
246
247 languageIdDescriptor,
248 manufacturerDescriptor,
249 productDescriptor,
250 serialNumberDescriptor
251 };
252
253
254
255 /// List of descriptors used by the device.
\ In section .rodata, align 4
256 const USBDDriverDescriptors usbdDriverDescriptors = {
\ usbdDriverDescriptors:
\ 00000000 ............ DC32 usbDeviceDescriptor, configurationDescriptors
\ ....
\ 00000008 ........0000 DC32 usbDeviceQualifierDescriptor, 0H, 0H, 0H, 0H, 0H
\ 000000000000
\ 000000000000
\ 000000000000
\ 00000020 ........ DC32 stringDescriptors
\ 00000024 04000000 DC8 4, 0, 0, 0
257
258 &usbDeviceDescriptor,
259 (const USBConfigurationDescriptor *) &configurationDescriptors,
260 #ifdef BOARD_USB_UDPHS
261 0, // No full-speed device qualifier descriptor
262 0, // No full-speed other speed configuration descriptor
263 &usbDeviceDescriptor,
264 (const USBConfigurationDescriptor *) &configurationDescriptors,
265 0, // No high-speed device qualifier descriptor
266 0, // No high-speed other speed configuration descriptor
267 #else
268 &usbDeviceQualifierDescriptor, // No full-speed device qualifier descriptor
269 0, // No full-speed other speed configuration descriptor
270 0, // No high-speed device descriptor
271 0, // No high-speed configuration descriptor
272 0, // No high-speed device qualifier descriptor
273 0, // No high-speed other speed configuration descriptor
274 #endif
275
276 stringDescriptors, // No string descriptor
277 4 // No string descriptor
278 };
279
280
281 /// USB standard device driver.
\ In section .bss, align 4
282 USBDDriver usbdDriver;
\ usbdDriver:
\ 00000000 DS8 12
283
284
285
286
287 //------------------------------------------------------------------------------
288 // VBus monitoring (optional)
289 //------------------------------------------------------------------------------
290 #if defined(PIN_USB_VBUS)
291
292 #define VBUS_CONFIGURE() VBus_Configure()
293
294 /// VBus pin instance.
\ In section .rodata, align 4
295 static const Pin pinVbus = PIN_USB_VBUS;
\ pinVbus:
\ 00000000 0000080000F8 DC32 524288, 0FFFFF800H
\ FFFF
\ 00000008 04020000 DC8 4, 2, 0, 0
296
297 //------------------------------------------------------------------------------
298 /// Handles interrupts coming from PIO controllers.
299 //------------------------------------------------------------------------------
\ In section .text, align 4, keep-with-next
300 static void ISR_Vbus(const Pin *pPin)
^
Remark[Pe826]: parameter "pPin" was never referenced
301 {
\ ISR_Vbus:
\ 00000000 10402DE9 PUSH {R4,LR}
\ 00000004 0040B0E1 MOVS R4,R0
302 trace_LOG(trace_INFO, "VBUS ");
\ 00000008 34009FE5 LDR R0,??ISR_Vbus_0 ;; `?<Constant "VBUS ">`
\ 0000000C ........ BL printf
303
304 // Check current level on VBus
305 if (PIO_Get(&pinVbus)) {
\ 00000010 ........ LDR R0,??DataTable5 ;; pinVbus
\ 00000014 ........ BL PIO_Get
\ 00000018 000050E3 CMP R0,#+0
\ 0000001C 0300000A BEQ ??ISR_Vbus_1
306
307 trace_LOG(trace_INFO, "conn\n\r");
\ 00000020 ........ LDR R0,??DataTable6 ;; `?<Constant "conn\\n\\r">`
\ 00000024 ........ BL printf
308 USBD_Connect();
\ 00000028 ........ BL USBD_Connect
\ 0000002C 020000EA B ??ISR_Vbus_2
309 }
310 else {
311
312 trace_LOG(trace_INFO, "discon\n\r");
\ ??ISR_Vbus_1:
\ 00000030 10009FE5 LDR R0,??ISR_Vbus_0+0x4 ;; `?<Constant "discon\\n\\r">`
\ 00000034 ........ BL printf
313 USBD_Disconnect();
\ 00000038 ........ BL USBD_Disconnect
314 }
315 }
\ ??ISR_Vbus_2:
\ 0000003C 1040BDE8 POP {R4,LR}
\ 00000040 1EFF2FE1 BX LR ;; return
\ ??ISR_Vbus_0:
\ 00000044 ........ DC32 `?<Constant "VBUS ">`
\ 00000048 ........ DC32 `?<Constant "discon\\n\\r">`
316
317 //------------------------------------------------------------------------------
318 /// Configures the VBus pin to trigger an interrupt when the level on that pin
319 /// changes.
320 //------------------------------------------------------------------------------
\ In section .text, align 4, keep-with-next
321 static void VBus_Configure( void )
322 {
\ VBus_Configure:
\ 00000000 01402DE9 PUSH {R0,LR}
323 trace_LOG(trace_INFO, "VBus 配置\n\r");
\ 00000004 44009FE5 LDR R0,??VBus_Configure_0 ;; `?<Constant "VBus \\305\\344\\326\\303\\n\\r">`
\ 00000008 ........ BL printf
324
325 // Configure PIO
326 PIO_Configure(&pinVbus, 1);
\ 0000000C 0110A0E3 MOV R1,#+1
\ 00000010 ........ LDR R0,??DataTable5 ;; pinVbus
\ 00000014 ........ BL PIO_Configure
327 PIO_ConfigureIt(&pinVbus, ISR_Vbus);
\ 00000018 34109FE5 LDR R1,??VBus_Configure_0+0x4 ;; ISR_Vbus
\ 0000001C ........ LDR R0,??DataTable5 ;; pinVbus
\ 00000020 ........ BL PIO_ConfigureIt
328 PIO_EnableIt(&pinVbus);
\ 00000024 ........ LDR R0,??DataTable5 ;; pinVbus
\ 00000028 ........ BL PIO_EnableIt
329
330 // Check current level on VBus
331 if (PIO_Get(&pinVbus)) {
\ 0000002C ........ LDR R0,??DataTable5 ;; pinVbus
\ 00000030 ........ BL PIO_Get
\ 00000034 000050E3 CMP R0,#+0
\ 00000038 0200000A BEQ ??VBus_Configure_1
332
333 // if VBUS present, force the connect
334 trace_LOG(trace_INFO, "conn\n\r");
\ 0000003C ........ LDR R0,??DataTable6 ;; `?<Constant "conn\\n\\r">`
\ 00000040 ........ BL printf
335 USBD_Connect();
\ 00000044 ........ BL USBD_Connect
336 }
337 }
\ ??VBus_Configure_1:
\ 00000048 0050BDE8 POP {R12,LR}
\ 0000004C 1EFF2FE1 BX LR ;; return
\ ??VBus_Configure_0:
\ 00000050 ........ DC32 `?<Constant "VBus \\305\\344\\326\\303\\n\\r">`
\ 00000054 ........ DC32 ISR_Vbus
338
339 #else
340 #define VBUS_CONFIGURE()
341 #endif //#if defined(PIN_USB_VBUS)
342
343 //------------------------------------------------------------------------------
344 // Callbacks
345 //------------------------------------------------------------------------------
346
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -