📄 usbconfigurationdescriptor.lst
字号:
###############################################################################
# #
# 24/Apr/2009 16:18:15 #
# 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:\basic-dataflash-project-at91sam7se-ek\at91lib\usb\com #
# mon\core\USBConfigurationDescriptor.c #
# Command line = D:\basic-dataflash-project-at91sam7se-ek\at91lib\usb\com #
# mon\core\USBConfigurationDescriptor.c -D at91sam7se512 #
# -D sram -D TRACE_LEVEL=4 -lC #
# D:\basic-dataflash-project-at91sam7se-ek\at91sam7se-ek\b #
# asic-dataflash-project\ewp\at91sam7se512_sram\List\ #
# --remarks --diag_suppress Pe826,Pe1375 -o #
# D:\basic-dataflash-project-at91sam7se-ek\at91sam7se-ek\b #
# asic-dataflash-project\ewp\at91sam7se512_sram\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 D:\basic-dataflash-project-at91sam7se-ek\at91 #
# sam7se-ek\basic-dataflash-project\ewp\..\..\..\at91lib/p #
# eripherals\ -I D:\basic-dataflash-project-at91sam7se-ek\ #
# at91sam7se-ek\basic-dataflash-project\ewp\..\..\..\at91l #
# ib\ -I D:\basic-dataflash-project-at91sam7se-ek\at91sam7 #
# se-ek\basic-dataflash-project\ewp\..\..\..\at91lib/memor #
# ies\ -I D:\basic-dataflash-project-at91sam7se-ek\at91sam #
# 7se-ek\basic-dataflash-project\ewp\..\..\..\at91lib/boar #
# ds/at91sam7se-ek\ -I "D:\Program Files\arm\ARM\INC\" #
# --interwork --cpu_mode arm -Oh #
# List file = D:\basic-dataflash-project-at91sam7se-ek\at91sam7se-ek\b #
# asic-dataflash-project\ewp\at91sam7se512_sram\List\USBCo #
# nfigurationDescriptor.lst #
# Object file = D:\basic-dataflash-project-at91sam7se-ek\at91sam7se-ek\b #
# asic-dataflash-project\ewp\at91sam7se512_sram\Obj\USBCon #
# figurationDescriptor.o #
# #
# #
###############################################################################
D:\basic-dataflash-project-at91sam7se-ek\at91lib\usb\common\core\USBConfigurationDescriptor.c
1 /* ----------------------------------------------------------------------------
2 * ATMEL Microcontroller Software Support
3 * ----------------------------------------------------------------------------
4 * Copyright (c) 2008, 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 disclaimer below.
13 *
14 * Atmel's name may not be used to endorse or promote products derived from
15 * this software without specific prior written permission.
16 *
17 * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR
18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
19 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
20 * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
23 * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
24 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
25 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
26 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 * ----------------------------------------------------------------------------
28 */
29
30 /*
31 Title: USBConfigurationDescriptor implementation
32
33 About: Purpose
34 Implementation of the USBConfigurationDescriptor class.
35 */
36
37 //-----------------------------------------------------------------------------
38 // Headers
39 //-----------------------------------------------------------------------------
40
41 #include "USBConfigurationDescriptor.h"
42
43 //-----------------------------------------------------------------------------
44 // Exported functions
45 //-----------------------------------------------------------------------------
46
47 //-----------------------------------------------------------------------------
48 /// Returns the total length of a configuration, i.e. including the
49 /// descriptors following it.
50 /// \param configuration Pointer to a USBConfigurationDescriptor instance.
51 /// \return Total length (in bytes) of the configuration.
52 //-----------------------------------------------------------------------------
\ In section .text, align 4, keep-with-next
53 unsigned int USBConfigurationDescriptor_GetTotalLength(
54 const USBConfigurationDescriptor *configuration)
55 {
56 return configuration->wTotalLength;
\ USBConfigurationDescriptor_GetTotalLength:
\ 00000000 0310D0E5 LDRB R1,[R0, #+3]
\ 00000004 0220D0E5 LDRB R2,[R0, #+2]
\ 00000008 010482E1 ORR R0,R2,R1, LSL #+8
\ 0000000C 1EFF2FE1 BX LR ;; return
57 }
58
59 //-----------------------------------------------------------------------------
60 /// Returns the number of interfaces in a configuration.
61 /// \param configuration Pointer to a USBConfigurationDescriptor instance.
62 /// \return Number of interfaces in configuration.
63 //-----------------------------------------------------------------------------
\ In section .text, align 4, keep-with-next
64 unsigned char USBConfigurationDescriptor_GetNumInterfaces(
65 const USBConfigurationDescriptor *configuration)
66 {
67 return configuration->bNumInterfaces;
\ USBConfigurationDescriptor_GetNumInterfaces:
\ 00000000 0400D0E5 LDRB R0,[R0, #+4]
\ 00000004 1EFF2FE1 BX LR ;; return
68 }
69
70 //-----------------------------------------------------------------------------
71 /// Indicates if the device is self-powered when in a given configuration.
72 /// \param configuration Pointer to a USBConfigurationDescriptor instance.
73 /// \return 1 if the device is self-powered when in the given configuration;
74 /// otherwise 0.
75 //-----------------------------------------------------------------------------
\ In section .text, align 4, keep-with-next
76 unsigned char USBConfigurationDescriptor_IsSelfPowered(
77 const USBConfigurationDescriptor *configuration)
78 {
79 if ((configuration->bmAttributes & (1 << 6)) != 0) {
\ USBConfigurationDescriptor_IsSelfPowered:
\ 00000000 0700D0E5 LDRB R0,[R0, #+7]
\ 00000004 400010E3 TST R0,#0x40
\ 00000008 0000A003 MOVEQ R0,#+0
80
81 return 1;
\ 0000000C 0100A013 MOVNE R0,#+1
\ 00000010 1EFF2FE1 BX LR
82 }
83 else {
84
85 return 0;
86 }
87 }
88
89 //-----------------------------------------------------------------------------
90 /// Parses the given Configuration descriptor (followed by relevant
91 /// interface, endpoint and class-specific descriptors) into three arrays.
92 /// *Each array must have its size equal or greater to the number of
93 /// descriptors it stores plus one*. A null-value is inserted after the last
94 /// descriptor of each type to indicate the array end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -