📄 usbprinter.lst
字号:
###############################################################################
# #
# 28/Apr/2009 09:28:30 #
# IAR ARM ANSI C/C++ Compiler V5.11.0.20622/W32 EVALUATION #
# Copyright 1999-2007 IAR Systems. All rights reserved. #
# #
# Cpu mode = arm #
# Endian = little #
# Source file = E:\workplace\bootloaderOK\at91sam7se-ek\basic-dataflash- #
# project\USBPrinter.c #
# Command line = E:\workplace\bootloaderOK\at91sam7se-ek\basic-dataflash- #
# project\USBPrinter.c -D at91sam7se512 -D flash -D #
# TRACE_LEVEL=4 -lC E:\workplace\bootloaderOK\at91sam7se-e #
# k\basic-dataflash-project\ewp\at91sam7se512_flash\List\ #
# --remarks --diag_suppress Pe826,Pe1375 -o #
# E:\workplace\bootloaderOK\at91sam7se-ek\basic-dataflash- #
# project\ewp\at91sam7se512_flash\Obj\ --no_cse #
# --no_unroll --no_inline --no_code_motion --no_tbaa #
# --no_clustering --no_scheduling --debug --endian little #
# --cpu ARM7TDMI -e --fpu None --dlib_config "D:\Program #
# Files\arm\ARM\INC\DLib_Config_Full.h" -I #
# E:\workplace\bootloaderOK\at91sam7se-ek\basic-dataflash- #
# project\ewp\..\..\..\at91lib/peripherals\ -I #
# E:\workplace\bootloaderOK\at91sam7se-ek\basic-dataflash- #
# project\ewp\..\..\..\at91lib\ -I #
# E:\workplace\bootloaderOK\at91sam7se-ek\basic-dataflash- #
# project\ewp\..\..\..\at91lib/memories\ -I #
# E:\workplace\bootloaderOK\at91sam7se-ek\basic-dataflash- #
# project\ewp\..\..\..\at91lib/boards/at91sam7se-ek\ -I #
# "D:\Program Files\arm\ARM\INC\" --interwork --cpu_mode #
# arm -Oh #
# List file = E:\workplace\bootloaderOK\at91sam7se-ek\basic-dataflash- #
# project\ewp\at91sam7se512_flash\List\USBPrinter.lst #
# Object file = E:\workplace\bootloaderOK\at91sam7se-ek\basic-dataflash- #
# project\ewp\at91sam7se512_flash\Obj\USBPrinter.o #
# #
# #
###############################################################################
E:\workplace\bootloaderOK\at91sam7se-ek\basic-dataflash-project\USBPrinter.c
1 #include <board.h>
2 #include <pio/pio.h>
3 #include <pio/pio_it.h>
4 #include <aic/aic.h>
5 #include <utility/trace.h>
6 #include<usb\device\core\USBD.h>
7 #include<usb\device\usbprinter\USBPrinterDriver.h>
8 #include <usb/device/usbprinter/USBPrinterDriverDescriptors.h>
9
10 #include "USBPrinter.h"
11
12 #define DATABUFFERSIZE \
13 BOARD_USB_ENDPOINTS_MAXPACKETSIZE(USBPrinterDriverDescriptors_DATAIN)
14
\ In section .bss, align 1
15 static unsigned char Flag_USBUpdataReday;
\ Flag_USBUpdataReday:
\ 00000000 DS8 1
16
\ In section .bss, align 4
17 static unsigned char usbBuffer[DATABUFFERSIZE];
\ usbBuffer:
\ 00000000 DS8 64
18
\ In section .rodata, align 4
19 static const Pin pinVbus = PIN_USB_VBUS;
\ pinVbus:
\ 00000000 0000080000F8 DC32 524288, 0FFFFF800H
\ FFFF
\ 00000008 04020000 DC8 4, 2, 0, 0
20
\ In section .bss, align 4
21 static INTERFACE Inter;
\ Inter:
\ 00000000 DS8 64
22
\ In section .bss, align 4
23 static unsigned char* AppBuf;
\ AppBuf:
\ 00000000 DS8 4
24
\ In section .bss, align 4
25 static unsigned char* temp;
\ temp:
\ 00000000 DS8 4
26
\ In section .text, align 4, keep-with-next
27 static void ISR_Vbus(const Pin *pPin)
28 {
\ ISR_Vbus:
\ 00000000 01402DE9 PUSH {R0,LR}
29 if (PIO_Get(&pinVbus)) {
\ 00000004 ........ LDR R0,??DataTable4 ;; pinVbus
\ 00000008 ........ BL PIO_Get
\ 0000000C 000050E3 CMP R0,#+0
\ 00000010 0100000A BEQ ??ISR_Vbus_0
30
31 USBD_Connect();
\ 00000014 0050BDE8 POP {R12,LR}
\ 00000018 ........ B USBD_Connect ;; tailcall
32 }
33 else {
34
35 USBD_Disconnect();
36 }
37 }
\ ??ISR_Vbus_0:
\ 0000001C 0050BDE8 POP {R12,LR}
\ 00000020 ........ B USBD_Disconnect ;; tailcall
38
39
\ In section .text, align 4, keep-with-next
40 static void VBus_Configure( void )
41 {
\ VBus_Configure:
\ 00000000 01402DE9 PUSH {R0,LR}
42
43 TRACE_INFO("VBus_Configure ");
\ 00000004 40009FE5 LDR R0,??VBus_Configure_0 ;; `?<Constant "-I- VBus_Configure ">`
\ 00000008 ........ BL printf
44
45 // Configure PIO
46 PIO_Configure(&pinVbus, 1);
\ 0000000C 0110A0E3 MOV R1,#+1
\ 00000010 ........ LDR R0,??DataTable4 ;; pinVbus
\ 00000014 ........ BL PIO_Configure
47 PIO_ConfigureIt(&pinVbus, ISR_Vbus);
\ 00000018 30109FE5 LDR R1,??VBus_Configure_0+0x4 ;; ISR_Vbus
\ 0000001C ........ LDR R0,??DataTable4 ;; pinVbus
\ 00000020 ........ BL PIO_ConfigureIt
48 PIO_EnableIt(&pinVbus);
\ 00000024 ........ LDR R0,??DataTable4 ;; pinVbus
\ 00000028 ........ BL PIO_EnableIt
49
50 // Check current level on VBus
51 if (PIO_Get(&pinVbus)) {
\ 0000002C ........ LDR R0,??DataTable4 ;; pinVbus
\ 00000030 ........ BL PIO_Get
\ 00000034 000050E3 CMP R0,#+0
\ 00000038 0100000A BEQ ??VBus_Configure_1
52
53 // if VBUS present, force the connect
54 USBD_Connect();
\ 0000003C 0050BDE8 POP {R12,LR}
\ 00000040 ........ B USBD_Connect ;; tailcall
55 }
56 else {
57 USBD_Disconnect();
58 }
59 }
\ ??VBus_Configure_1:
\ 00000044 0050BDE8 POP {R12,LR}
\ 00000048 ........ B USBD_Disconnect ;; tailcall
\ ??VBus_Configure_0:
\ 0000004C ........ DC32 `?<Constant "-I- VBus_Configure ">`
\ 00000050 ........ DC32 ISR_Vbus
\ In section .text, align 4, keep-with-next
60 void ReceiveData(unsigned int received)
61 {
62 unsigned int i;
63 for (i = 0;i < received;i++)
\ ReceiveData:
\ 00000000 000050E3 CMP R0,#+0
\ 00000004 1EFF2F01 BXEQ LR
\ 00000008 ........ LDR R1,??DataTable13 ;; usbBuffer
\ 0000000C ........ LDR R2,??DataTable22 ;; temp
\ 00000010 002092E5 LDR R2,[R2, #+0]
64 {
65 *temp = usbBuffer[i];
\ ??ReceiveData_0:
\ 00000014 0130D1E4 LDRB R3,[R1], #+1
\ 00000018 0130C2E4 STRB R3,[R2], #+1
66 temp++;
67 }
\ 0000001C 010050E2 SUBS R0,R0,#+1
\ 00000020 FBFFFF1A BNE ??ReceiveData_0
\ 00000024 ........ LDR R0,??DataTable22 ;; temp
\ 00000028 002080E5 STR R2,[R0, #+0]
68 }
\ 0000002C 1EFF2FE1 BX LR ;; return
\ In section .text, align 4, keep-with-next
69 static void UsbDataReceived(unsigned int unused,
70 unsigned char status,
71 unsigned int received,
72 unsigned int remaining)
73 {
\ UsbDataReceived:
\ 00000000 31402DE9 PUSH {R0,R4,R5,LR}
\ 00000004 0240A0E1 MOV R4,R2
\ 00000008 0350A0E1 MOV R5,R3
74
75
76 if (status == USBD_STATUS_SUCCESS)
\ 0000000C 000051E3 CMP R1,#+0
\ 00000010 0A00001A BNE ??UsbDataReceived_0
77 {
78
79 TRACE_INFO("UsbDataReceived: %x bytes\n\r",received);
\ 00000014 0410A0E1 MOV R1,R4
\ 00000018 3C009FE5 LDR R0,??UsbDataReceived_1 ;; `?<Constant "-I- UsbDataReceived: ...">`
\ 0000001C ........ BL printf
80 ReceiveData(received);
\ 00000020 0400A0E1 MOV R0,R4
\ 00000024 ........ BL ReceiveData
81 if ((received == DATABUFFERSIZE) && (remaining > 0)) {
\ 00000028 400054E3 CMP R4,#+64
\ 0000002C 0300001A BNE ??UsbDataReceived_0
\ 00000030 000055E3 CMP R5,#+0
82 TRACE_INFO("UsbDataReceived:%x byte\n\r",remaining)
\ 00000034 0510A011 MOVNE R1,R5
\ 00000038 20009F15 LDRNE R0,??UsbDataReceived_1+0x4 ;; `?<Constant "-I- UsbDataReceived:%...">`
\ 0000003C ........ BLNE printf
83 }
84 }
85 USBPrinterDriver_Read(usbBuffer,DATABUFFERSIZE,(TransferCallback) UsbDataReceived,0);
\ ??UsbDataReceived_0:
\ 00000040 0030A0E3 MOV R3,#+0
\ 00000044 ........ LDR R2,??DataTable12 ;; UsbDataReceived
\ 00000048 4010A0E3 MOV R1,#+64
\ 0000004C ........ LDR R0,??DataTable13 ;; usbBuffer
\ 00000050 ........ BL USBPrinterDriver_Read
86 }
\ 00000054 3840BDE8 POP {R3-R5,LR}
\ 00000058 1EFF2FE1 BX LR ;; return
\ ??UsbDataReceived_1:
\ 0000005C ........ DC32 `?<Constant "-I- UsbDataReceived: ...">`
\ 00000060 ........ DC32 `?<Constant "-I- UsbDataReceived:%...">`
87
\ In section .text, align 4, keep-with-next
88 void USBPortInit()
89 {
\ USBPortInit:
\ 00000000 01402DE9 PUSH {R0,LR}
90 PIO_InitializeInterrupts(0);
\ 00000004 0000A0E3 MOV R0,#+0
\ 00000008 ........ BL PIO_InitializeInterrupts
91 VBus_Configure();
\ 0000000C ........ BL VBus_Configure
92 USBPrinterDriver_Initialize();
\ 00000010 ........ BL USBPrinterDriver_Initialize
93 AppBuf = (unsigned char *) AT91C_EBI_SDRAM + 0xA00000;
\ 00000014 ........ LDR R0,??DataTable19 ;; AppBuf
\ 00000018 8015A0E3 MOV R1,#+536870912
\ 0000001C A01881E3 ORR R1,R1,#0xA00000
\ 00000020 001080E5 STR R1,[R0, #+0]
94 temp = AppBuf;
\ 00000024 ........ LDR R0,??DataTable22 ;; temp
\ 00000028 001080E5 STR R1,[R0, #+0]
95 }
\ 0000002C 0050BDE8 POP {R12,LR}
\ 00000030 1EFF2FE1 BX LR ;; return
96
\ In section .text, align 4, keep-with-next
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -