📄 main.lst
字号:
###############################################################################
# #
# 29/Jul/2008 15:06:14 #
# 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 = D:\rock\atarm\at91sam7se\software\usb-device-core-projec #
# t-1.3-iar5-at91sam7se-ek\at91sam7se-ek\usb-device-core-p #
# roject\main.c #
# Command line = D:\rock\atarm\at91sam7se\software\usb-device-core-projec #
# t-1.3-iar5-at91sam7se-ek\at91sam7se-ek\usb-device-core-p #
# roject\main.c -D at91sam7se512 -lC #
# D:\rock\atarm\at91sam7se\software\usb-device-core-projec #
# t-1.3-iar5-at91sam7se-ek\at91sam7se-ek\usb-device-core-p #
# roject\ewp\at91sam7se512_sdram\List\ --remarks -o #
# D:\rock\atarm\at91sam7se\software\usb-device-core-projec #
# t-1.3-iar5-at91sam7se-ek\at91sam7se-ek\usb-device-core-p #
# roject\ewp\at91sam7se512_sdram\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\IAR Systems\Embedded Workbench 5.0 #
# Evaluation\ARM\INC\DLib_Config_Full.h" -I #
# D:\rock\atarm\at91sam7se\software\usb-device-core-projec #
# t-1.3-iar5-at91sam7se-ek\at91sam7se-ek\usb-device-core-p #
# roject\ewp\..\..\..\at91lib\ -I #
# D:\rock\atarm\at91sam7se\software\usb-device-core-projec #
# t-1.3-iar5-at91sam7se-ek\at91sam7se-ek\usb-device-core-p #
# roject\ewp\..\..\..\at91lib\boards\at91sam7se-ek\ -I #
# D:\rock\atarm\at91sam7se\software\usb-device-core-projec #
# t-1.3-iar5-at91sam7se-ek\at91sam7se-ek\usb-device-core-p #
# roject\ewp\..\..\..\at91lib\peripherals\ -I #
# D:\rock\atarm\at91sam7se\software\usb-device-core-projec #
# t-1.3-iar5-at91sam7se-ek\at91sam7se-ek\usb-device-core-p #
# roject\ewp\..\..\..\at91lib\components\ -I #
# D:\rock\atarm\at91sam7se\software\usb-device-core-projec #
# t-1.3-iar5-at91sam7se-ek\at91sam7se-ek\usb-device-core-p #
# roject\ewp\..\..\..\at91lib\usb\ -I "D:\Program #
# Files\IAR Systems\Embedded Workbench 5.0 #
# Evaluation\ARM\INC\" --interwork --cpu_mode arm -On #
# List file = D:\rock\atarm\at91sam7se\software\usb-device-core-projec #
# t-1.3-iar5-at91sam7se-ek\at91sam7se-ek\usb-device-core-p #
# roject\ewp\at91sam7se512_sdram\List\main.lst #
# Object file = D:\rock\atarm\at91sam7se\software\usb-device-core-projec #
# t-1.3-iar5-at91sam7se-ek\at91sam7se-ek\usb-device-core-p #
# roject\ewp\at91sam7se512_sdram\Obj\main.o #
# #
# #
###############################################################################
D:\rock\atarm\at91sam7se\software\usb-device-core-project-1.3-iar5-at91sam7se-ek\at91sam7se-ek\usb-device-core-project\main.c
1 /* ----------------------------------------------------------------------------
2 * ATMEL Microcontroller Software Support - ROUSSET -
3 * ----------------------------------------------------------------------------
4 * Copyright (c) 2007, Atmel Corporation
5
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions are met:
10 *
11 * - Redistributions of source code must retain the above copyright notice,
12 * this list of conditions and the disclaiimer below.
13 *
14 * - Redistributions in binary form must reproduce the above copyright notice,
15 * this list of conditions and the disclaimer below in the documentation and/or
16 * other materials provided with the distribution.
17 *
18 * Atmel's name may not be used to endorse or promote products derived from
19 * this software without specific prior written permission.
20 *
21 * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR
22 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
23 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
24 * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,
25 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
27 * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
28 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
29 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 * ----------------------------------------------------------------------------
32 */
33
34 //------------------------------------------------------------------------------
35 // Headers
36 //------------------------------------------------------------------------------
37
38 #include <board.h>
39 #include <utility/trace.h>
40 #include <pio/pio.h>
41 #include <pio/pio_it.h>
42 #include <usb/common/core/USBGenericDescriptor.h>
43 #include <usb/common/core/USBDeviceDescriptor.h>
44 #include <usb/common/core/USBConfigurationDescriptor.h>
45 #include <usb/common/core/USBInterfaceDescriptor.h>
46 #include <usb/common/core/USBGenericRequest.h>
47 #include <usb/device/core/USBD.h>
48 #include <usb/device/core/USBDDriver.h>
49 #include <usb/device/core/USBDDriverDescriptors.h>
50 #include <usb/device/core/USBDCallbacks.h>
51 #include <usb/common/core/USBStringDescriptor.h>
52
53 //------------------------------------------------------------------------------
54 // Local types
55 //------------------------------------------------------------------------------
56
57 /// Configuration descriptors with one interface.
58 struct SimpleConfigurationDescriptors {
59
60 USBConfigurationDescriptor configuration;
61 USBInterfaceDescriptor interface;
62 USBEndpointDescriptor endpoint1in;
63 USBEndpointDescriptor endpoint1out;
64 USBEndpointDescriptor endpoint2in;
65 USBEndpointDescriptor endpoint2out;
66 };
67
68 //------------------------------------------------------------------------------
69 // Local variables
70 //------------------------------------------------------------------------------
71
72 /// Device descriptor.
\ In section .rodata, align 4
73 const USBDeviceDescriptor usbDeviceDescriptor = {
\ usbDeviceDescriptor:
\ 00000000 1201 DC8 18, 1
\ 00000002 0002 DC16 512
\ 00000004 00000040 DC8 0, 0, 0, 64
\ 00000008 CDAB00000100 DC16 43981, 0, 1
\ 0000000E 010203010000 DC8 1, 2, 3, 1, 0, 0
74
75 sizeof(USBDeviceDescriptor),
76 USBGenericDescriptor_DEVICE,
77 USBDeviceDescriptor_USB2_00,
78 0, // No device class code
79 0, // No device subclass code
80 0, // No device protocol code
81 64,//BOARD_USB_ENDPOINTS_MAXPACKETSIZE(0),
82 0xabcd, // Atmel vendor ID
83 0x0000, // Product ID
84 0x0001, // Product release 0.01
85 0x01, // manufacturer string descriptor
86 0x02, // product string descriptor
87 0x03, // serial number string descriptor
88 1 // One possible configuration
89 };
90
\ In section .rodata, align 4
91 const USBDeviceQualifierDescriptor usbDeviceQualifierDescriptor = {
\ usbDeviceQualifierDescriptor:
\ 00000000 0A06 DC8 10, 6
\ 00000002 0002 DC16 512
\ 00000004 000000400100 DC8 0, 0, 0, 64, 1, 0, 0, 0
\ 0000
92
93 sizeof(USBDeviceQualifierDescriptor),
94 USBGenericDescriptor_DEVICEQUALIFIER,
95 USBDeviceDescriptor_USB2_00, //device descript byt2-7
96 0, // No device class code
97 0, // No device subclass code
98 0, // No device protocol code
99 64,//BOARD_USB_ENDPOINTS_MAXPACKETSIZE(0),
100 0x01,
101 0
102 };
103
104
105 /// Configuration descriptors.
\ In section .rodata, align 4
106 const struct SimpleConfigurationDescriptors configurationDescriptors = {
\ configurationDescriptors:
\ 00000000 0902 DC8 9, 2
\ 00000002 2E00 DC16 46
\ 00000004 010100A03209 DC8 1, 1, 0, 160, 50, 9, 4, 0, 0, 4, 0, 0, 0, 0, 7, 5, 129, 2
\ 040000040000
\ 000007058102
\ 00000016 4000 DC16 64
\ 00000018 0007050102 DC8 0, 7, 5, 1, 2
\ 0000001D 4000 DC16 64
\ 0000001F 0007058202 DC8 0, 7, 5, 130, 2
\ 00000024 4000 DC16 64
\ 00000026 0007050202 DC8 0, 7, 5, 2, 2
\ 0000002B 4000 DC16 64
\ 0000002D 000000 DC8 0, 0, 0
107
108 // Configuration descriptor
109 {
110 sizeof(USBConfigurationDescriptor),
111 USBGenericDescriptor_CONFIGURATION,
112 sizeof(struct SimpleConfigurationDescriptors),
113 1, // No interface in this configuration
114 1, // This is configuration #1
115 0, // No string descriptor for this configuration
116 USBConfigurationDescriptor_BUSPOWERED_RWAKEUP,
117 USBConfigurationDescriptor_POWER(100)
118 },
119 // Interface descriptor
120 {
121 sizeof(USBInterfaceDescriptor),
122 USBGenericDescriptor_INTERFACE,
123 0, // This is interface #0
124 0, // This is setting #0 for interface
125 0x04, // Interface has no endpoint
126 0, // No interface class code
127 0, // No interface subclass code
128 0, // No interface protocol code
129 0, // No string descriptor
130 },
131 //endpoint1in_descriptor
132 { //中断输入端点描述
133 sizeof(USBEndpointDescriptor), //端点描述符的字节数大小
134 USBGenericDescriptor_ENDPOINT, //端点描述符类型编号
135 USBEndpointDescriptor_ADDRESS(USBEndpointDescriptor_IN,1), //端点号,输入端点1
136 USBEndpointDescriptor_BULK, //使用的传输类型:中断传输
137 0x0040, //该端点支持的最大包尺寸,16字节
138 0x00 //中断扫描时间:设置为10ms
139 },
140 //endpoint1out_descriptor
141 { //中断输出端点描述
142 sizeof(USBEndpointDescriptor), //端点描述符的字节数大小
143 USBGenericDescriptor_ENDPOINT, //端点描述符类型编号
144 USBEndpointDescriptor_ADDRESS(USBEndpointDescriptor_OUT,1),//端点号,输入端点1, //端点号,输出端点1
145 USBEndpointDescriptor_BULK, //使用的传输类型:中断传输
146 0x0040, //该端点支持的最大包尺寸,16字节
147 0x00 //中断扫描时间:设置为10ms
148 },
149 //endpoint2in_descriptor
150 { //主端点输入描述
151 sizeof(USBEndpointDescriptor), //端点描述符的字节数大小
152 USBGenericDescriptor_ENDPOINT, //端点描述符类型编号
153 USBEndpointDescriptor_ADDRESS(USBEndpointDescriptor_IN,2), //端点号,输入端点2, //端点号,主输入端点
154 USBEndpointDescriptor_BULK, //使用的传输类型:批量传输
155 0x0040, //该端点支持的最大包尺寸,64字节
156 0x00 //中断扫描时间:批量端点无效
157 },
158 //endpoint2out_descriptor
159 { //主端点输出描述
160 sizeof(USBEndpointDescriptor), //端点描述符的字节数大小
161 USBGenericDescriptor_ENDPOINT, //端点描述符类型编号
162 USBEndpointDescriptor_ADDRESS(USBEndpointDescriptor_OUT,2),//端点号,输入端点2 //端点号,主输出端点
163 USBEndpointDescriptor_BULK, //使用的传输类型:批量传输
164 0x0040, //该端点支持的最大包尺寸,64字节
165 0x00 //中断扫描时间:批量端点无效
166 }
167 };
168
169
170 /// Language ID string descriptor.
\ In section .rodata, align 4
171 static const unsigned char languageIdDescriptor[] = {
\ languageIdDescriptor:
\ 00000000 04030904 DC8 4, 3, 9, 4
172
173 USBStringDescriptor_LENGTH(1),
174 USBGenericDescriptor_STRING,
175 USBStringDescriptor_ENGLISH_US
176 };
177
178 /// Manufacturer string descriptor.
\ In section .rodata, align 4
179 static const unsigned char manufacturerDescriptor[] = {
\ manufacturerDescriptor:
\ 00000000 160354004100 DC8 22, 3, 84, 0, 65, 0, 73, 0, 72, 0, 85, 0, 77, 0, 73, 0, 67, 0, 82
\ 490048005500
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -