USBRequests.h
Go to the documentation of this file.
1 /* ---------------------------------------------------------------------------- */
2 /* Atmel Microcontroller Software Support */
3 /* SAM Software Package License */
4 /* ---------------------------------------------------------------------------- */
5 /* Copyright (c) 2015, Atmel Corporation */
6 /* */
7 /* All rights reserved. */
8 /* */
9 /* Redistribution and use in source and binary forms, with or without */
10 /* modification, are permitted provided that the following condition is met: */
11 /* */
12 /* - Redistributions of source code must retain the above copyright notice, */
13 /* this list of conditions and the disclaimer below. */
14 /* */
15 /* Atmel's name may not be used to endorse or promote products derived from */
16 /* this software without specific prior written permission. */
17 /* */
18 /* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */
19 /* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
20 /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */
21 /* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */
22 /* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */
23 /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */
24 /* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */
25 /* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */
26 /* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
27 /* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
28 /* ---------------------------------------------------------------------------- */
29 
40 #ifndef _USBREQUESTS_H_
41 #define _USBREQUESTS_H_
42 
48 /*---------------------------------------------------------------------------
49  * Headers
50  *---------------------------------------------------------------------------*/
51 
52 /* These headers were introduced in C99 by working group
53  * ISO/IEC JTC1/SC22/WG14.
54  */
55 #include <stdint.h>
56 
57 /*---------------------------------------------------------------------------
58  * Definitions
59  *---------------------------------------------------------------------------*/
60 
61 /*----------- Generic Request ------------*/
62 
112 #define USBGenericRequest_GETSTATUS 0
113 
114 #define USBGenericRequest_CLEARFEATURE 1
115 
116 #define USBGenericRequest_SETFEATURE 3
117 
118 #define USBGenericRequest_SETADDRESS 5
119 
120 #define USBGenericRequest_GETDESCRIPTOR 6
121 
122 #define USBGenericRequest_SETDESCRIPTOR 7
123 
124 #define USBGenericRequest_GETCONFIGURATION 8
125 
126 #define USBGenericRequest_SETCONFIGURATION 9
127 
128 #define USBGenericRequest_GETINTERFACE 10
129 
130 #define USBGenericRequest_SETINTERFACE 11
131 
132 #define USBGenericRequest_SYNCHFRAME 12
133 
144 #define USBGenericRequest_DEVICE 0
145 
146 #define USBGenericRequest_INTERFACE 1
147 
148 #define USBGenericRequest_ENDPOINT 2
149 
150 #define USBGenericRequest_OTHER 3
151 
161 #define USBGenericRequest_STANDARD 0
162 
163 #define USBGenericRequest_CLASS 1
164 
165 #define USBGenericRequest_VENDOR 2
166 
175 #define USBGenericRequest_OUT 0
176 
177 #define USBGenericRequest_IN 1
178 
182 /*----------- Feature Request ------------*/
183 
210 #define USBFeatureRequest_ENDPOINTHALT 0
211 
212 #define USBFeatureRequest_DEVICEREMOTEWAKEUP 1
213 
214 #define USBFeatureRequest_TESTMODE 2
215 
216 #define USBFeatureRequest_OTG 0x0B
217 
218 #define USBFeatureRequest_OTG_B_HNP_ENABLE 3
219 
220 #define USBFeatureRequest_OTG_A_HNP_SUPPORT 4
221 
222 #define USBFeatureRequest_OTG_A_ALT_HNP_SUPPORT 5
223 
237 #define USBFeatureRequest_TESTJ 1
238 
239 #define USBFeatureRequest_TESTK 2
240 
242 #define USBFeatureRequest_TESTSE0NAK 3
243 
244 #define USBFeatureRequest_TESTPACKET 4
245 
246 #define USBFeatureRequest_TESTFORCEENABLE 5
247 
248 #define USBFeatureRequest_TESTSENDZLP 6
249 
252 /*---------------------------------------------------------------------------
253  * Types
254  *---------------------------------------------------------------------------*/
255 typedef uint8_t USBHS_Add_t;
256 typedef uint8_t USBHS_Ep_t;
257 /*
258  * Function types
259  */
260 
261 /*
262  * Descriptor structs types
263  */
264 #pragma pack(1)
265 #if defined ( __CC_ARM ) /* Keil ¦̀Vision 4 */
266 #elif defined ( __ICCARM__ ) /* IAR Ewarm 5.41+ */
267 #define __attribute__(...)
268 #elif defined ( __GNUC__ ) /* GCC CS3 2009q3-68 */
269 #endif
270 
274 typedef struct {
275 
280  uint8_t bmRequestType:8;
283  uint8_t bRequest:8;
285  uint16_t wValue:16;
287  uint16_t wIndex:16;
289  uint16_t wLength:16;
290 
292 
293 #pragma pack()
294 
295 /*---------------------------------------------------------------------------
296  * Exported Functions
297  *---------------------------------------------------------------------------*/
298 
299 extern uint8_t USBGenericRequest_GetType(
300  const USBGenericRequest *request);
301 
302 extern uint8_t USBGenericRequest_GetRequest(
303  const USBGenericRequest *request);
304 
305 extern uint16_t USBGenericRequest_GetValue(
306  const USBGenericRequest *request);
307 
308 extern uint16_t USBGenericRequest_GetIndex(
309  const USBGenericRequest *request);
310 
311 extern uint16_t USBGenericRequest_GetLength(
312  const USBGenericRequest *request);
313 
315  const USBGenericRequest *request);
316 
317 extern uint8_t USBGenericRequest_GetRecipient(
318  const USBGenericRequest *request);
319 
320 extern uint8_t USBGenericRequest_GetDirection(
321  const USBGenericRequest *request);
322 
323 
325  const USBGenericRequest *request);
326 
328  const USBGenericRequest *request);
329 
330 
331 extern uint8_t USBSetAddressRequest_GetAddress(
332  const USBGenericRequest *request);
333 
334 
336  const USBGenericRequest *request);
337 
338 
339 extern uint8_t USBInterfaceRequest_GetInterface(
340  const USBGenericRequest *request);
341 
343  const USBGenericRequest *request);
344 
345 
347  const USBGenericRequest *request);
348 
349 extern uint8_t USBFeatureRequest_GetTestSelector(
350  const USBGenericRequest *request);
351 
354 #endif /* #ifndef _USBREQUESTS_H_ */
355 
uint8_t USBSetAddressRequest_GetAddress(const USBGenericRequest *request)
Definition: USBRequests.c:172
uint8_t USBGenericRequest_GetRecipient(const USBGenericRequest *request)
Definition: USBRequests.c:117
uint8_t bmRequestType
Definition: USBRequests.h:280
uint8_t USBGenericRequest_GetType(const USBGenericRequest *request)
Definition: USBRequests.c:54
uint16_t USBGenericRequest_GetValue(const USBGenericRequest *request)
Definition: USBRequests.c:75
uint8_t USBInterfaceRequest_GetInterface(const USBGenericRequest *request)
Definition: USBRequests.c:197
uint8_t USBSetConfigurationRequest_GetConfiguration(const USBGenericRequest *request)
Definition: USBRequests.c:184
uint16_t USBGenericRequest_GetLength(const USBGenericRequest *request)
Definition: USBRequests.c:95
uint8_t USBFeatureRequest_GetTestSelector(const USBGenericRequest *request)
Definition: USBRequests.c:233
uint8_t USBGenericRequest_GetDirection(const USBGenericRequest *request)
Definition: USBRequests.c:129
uint8_t USBGenericRequest_GetEndpointNumber(const USBGenericRequest *request)
Definition: USBRequests.c:105
uint8_t USBGetDescriptorRequest_GetDescriptorType(const USBGenericRequest *request)
Definition: USBRequests.c:145
uint8_t USBGenericRequest_GetRequest(const USBGenericRequest *request)
Definition: USBRequests.c:65
uint8_t USBHS_Add_t
Definition: USBRequests.h:255
uint8_t USBHS_Ep_t
Definition: USBRequests.h:256
uint8_t USBInterfaceRequest_GetAlternateSetting(const USBGenericRequest *request)
Definition: USBRequests.c:208
uint16_t USBGenericRequest_GetIndex(const USBGenericRequest *request)
Definition: USBRequests.c:85
uint8_t USBGetDescriptorRequest_GetDescriptorIndex(const USBGenericRequest *request)
Definition: USBRequests.c:158
uint8_t USBFeatureRequest_GetFeatureSelector(const USBGenericRequest *request)
Definition: USBRequests.c:221


inertial_sense_ros
Author(s):
autogenerated on Sun Feb 28 2021 03:17:58