📄 adcuser.lst
字号:
ARM COMPILER V2.53, adcuser 05/09/06 14:20:50 PAGE 1
ARM COMPILER V2.53, COMPILATION OF MODULE adcuser
OBJECT MODULE PLACED IN .\Obj\adcuser.obj
COMPILER INVOKED BY: C:\Keil\ARM\BIN\CA.exe adcuser.c THUMB DEBUG PRINT(.\LST\ADCUSER.LST) TABS(4) OBJECT(.\Obj\adcuser.
-obj)
stmt level source
1 /*----------------------------------------------------------------------------
2 * U S B - K e r n e l
3 *----------------------------------------------------------------------------
4 * Name: ADCUSER.C
5 * Purpose: Audio Device Class Custom User Module
6 * Version: V1.10
7 *----------------------------------------------------------------------------
8 * This software is supplied "AS IS" without any warranties, express,
9 * implied or statutory, including but not limited to the implied
10 * warranties of fitness for purpose, satisfactory quality and
11 * noninfringement. Keil extends you a royalty-free right to reproduce
12 * and distribute executable files created using this software for use
13 * on Philips LPC2xxx microcontroller devices only. Nothing else gives
14 * you the right to use this software.
15 *
16 * Copyright (c) 2005-2006 Keil Software.
17 *---------------------------------------------------------------------------*/
18
19 #include "type.h"
20
21 #include "usb.h"
22 #include "audio.h"
23 #include "usbcfg.h"
24 #include "usbcore.h"
25 #include "adcuser.h"
26
27 #include "demo.h"
28
29
30 WORD VolCur = 0x0100; /* Volume Current Value */
31 const WORD VolMin = 0x0000; /* Volume Minimum Value */
32 const WORD VolMax = 0x0100; /* Volume Maximum Value */
33 const WORD VolRes = 0x0004; /* Volume Resolution */
34
35
36 /*
37 * Audio Device Class Interface Get Request Callback
38 * Called automatically on ADC Interface Get Request
39 * Parameters: None (global SetupPacket and EP0Buf)
40 * Return Value: TRUE - Success, FALSE - Error
41 */
42
43 BOOL ADC_IF_GetRequest (void) {
44 1
45 1 /*
46 1 Interface = SetupPacket.wIndex.WB.L;
47 1 EntityID = SetupPacket.wIndex.WB.H;
48 1 Request = SetupPacket.bRequest;
49 1 Value = SetupPacket.wValue.W;
50 1 ...
51 1 */
52 1
53 1 if (SetupPacket.wIndex.W == 0x0200) {
54 2 /* Feature Unit: Interface = 0, ID = 2 */
55 2 if (SetupPacket.wValue.WB.L == 0) {
56 3 /* Master Channel */
57 3 switch (SetupPacket.wValue.WB.H) {
58 4 case AUDIO_MUTE_CONTROL:
ARM COMPILER V2.53, adcuser 05/09/06 14:20:50 PAGE 2
59 4 switch (SetupPacket.bRequest) {
60 5 case AUDIO_REQUEST_GET_CUR:
61 5 EP0Buf[0] = Mute;
62 5 return (TRUE);
63 5 }
64 4 break;
65 4 case AUDIO_VOLUME_CONTROL:
66 4 switch (SetupPacket.bRequest) {
67 5 case AUDIO_REQUEST_GET_CUR:
68 5 *((__packed WORD *)EP0Buf) = VolCur;
69 5 return (TRUE);
70 5 case AUDIO_REQUEST_GET_MIN:
71 5 *((__packed WORD *)EP0Buf) = VolMin;
72 5 return (TRUE);
73 5 case AUDIO_REQUEST_GET_MAX:
74 5 *((__packed WORD *)EP0Buf) = VolMax;
75 5 return (TRUE);
76 5 case AUDIO_REQUEST_GET_RES:
77 5 *((__packed WORD *)EP0Buf) = VolRes;
78 5 return (TRUE);
79 5 }
80 4 break;
81 4 }
82 3 }
83 2 }
84 1
85 1 return (FALSE); /* Not Supported */
86 1 }
87
88
89 /*
90 * Audio Device Class Interface Set Request Callback
91 * Called automatically on ADC Interface Set Request
92 * Parameters: None (global SetupPacket and EP0Buf)
93 * Return Value: TRUE - Success, FALSE - Error
94 */
95
96 BOOL ADC_IF_SetRequest (void) {
97 1
98 1 /*
99 1 Interface = SetupPacket.wIndex.WB.L;
100 1 EntityID = SetupPacket.wIndex.WB.H;
101 1 Request = SetupPacket.bRequest;
102 1 Value = SetupPacket.wValue.W;
103 1 ...
104 1 */
105 1
106 1 if (SetupPacket.wIndex.W == 0x0200) {
107 2 /* Feature Unit: Interface = 0, ID = 2 */
108 2 if (SetupPacket.wValue.WB.L == 0) {
109 3 /* Master Channel */
110 3 switch (SetupPacket.wValue.WB.H) {
111 4 case AUDIO_MUTE_CONTROL:
112 4 switch (SetupPacket.bRequest) {
113 5 case AUDIO_REQUEST_SET_CUR:
114 5 Mute = EP0Buf[0];
115 5 return (TRUE);
116 5 }
117 4 break;
118 4 case AUDIO_VOLUME_CONTROL:
119 4 switch (SetupPacket.bRequest) {
120 5 case AUDIO_REQUEST_SET_CUR:
121 5 VolCur = *((__packed WORD *)EP0Buf);
122 5 return (TRUE);
123 5 }
124 4 break;
ARM COMPILER V2.53, adcuser 05/09/06 14:20:50 PAGE 3
125 4 }
126 3 }
127 2 }
128 1
129 1 return (FALSE); /* Not Supported */
130 1 }
131
132
133 /*
134 * Audio Device Class EndPoint Get Request Callback
135 * Called automatically on ADC EndPoint Get Request
136 * Parameters: None (global SetupPacket and EP0Buf)
137 * Return Value: TRUE - Success, FALSE - Error
138 */
139
140 BOOL ADC_EP_GetRequest (void) {
141 1
142 1 /*
143 1 EndPoint = SetupPacket.wIndex.WB.L;
144 1 Request = SetupPacket.bRequest;
145 1 Value = SetupPacket.wValue.W;
146 1 ...
147 1 */
148 1 return (FALSE); /* Not Supported */
149 1 }
150
151
152 /*
153 * Audio Device Class EndPoint Set Request Callback
154 * Called automatically on ADC EndPoint Set Request
155 * Parameters: None (global SetupPacket and EP0Buf)
156 * Return Value: TRUE - Success, FALSE - Error
157 */
158
159 BOOL ADC_EP_SetRequest (void) {
160 1
161 1 /*
162 1 EndPoint = SetupPacket.wIndex.WB.L;
163 1 Request = SetupPacket.bRequest;
164 1 Value = SetupPacket.wValue.W;
165 1 ...
166 1 */
167 1 return (FALSE); /* Not Supported */
168 1 }
ARM COMPILER V2.53, adcuser 05/09/06 14:20:50 PAGE 4
ASSEMBLY LISTING OF GENERATED OBJECT CODE
*** EXTERNALS:
EXTERN DATA (EP0Buf)
EXTERN DATA (SetupPacket)
EXTERN DATA (Mute)
*** PUBLICS:
PUBLIC ADC_IF_GetRequest?T
PUBLIC ADC_IF_SetRequest?T
PUBLIC ADC_EP_GetRequest?T
PUBLIC ADC_EP_SetRequest?T
PUBLIC VolCur
PUBLIC VolMin
PUBLIC VolMax
PUBLIC VolRes
*** DATA SEGMENT '?DT0?adcuser':
00000000 VolCur:
00000000 BEGIN_INIT
00000000 0100 DW 0x100
00000002 END_INIT
*** DATA SEGMENT '?CON?adcuser':
00000000 VolMin:
00000000 BEGIN_INIT
00000000 0000 DW 0x0
00000002 END_INIT
00000002 VolMax:
00000002 BEGIN_INIT
00000002 0100 DW 0x100
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -