usbd_def.h
Go to the documentation of this file.
1 
28 /* Define to prevent recursive inclusion -------------------------------------*/
29 
30 #ifndef __USBD_DEF_H
31 #define __USBD_DEF_H
32 
33 /* Includes ------------------------------------------------------------------*/
34 #include "usbd_conf.h"
35 
49 #ifndef NULL
50 #define NULL 0
51 #endif
52 
53 #define USB_LEN_DEV_QUALIFIER_DESC 0x0A
54 #define USB_LEN_DEV_DESC 0x12
55 #define USB_LEN_CFG_DESC 0x09
56 #define USB_LEN_IF_DESC 0x09
57 #define USB_LEN_EP_DESC 0x07
58 #define USB_LEN_OTG_DESC 0x03
59 
60 #define USBD_IDX_LANGID_STR 0x00
61 #define USBD_IDX_MFC_STR 0x01
62 #define USBD_IDX_PRODUCT_STR 0x02
63 #define USBD_IDX_SERIAL_STR 0x03
64 #define USBD_IDX_CONFIG_STR 0x04
65 #define USBD_IDX_INTERFACE_STR 0x05
66 
67 #define USB_REQ_TYPE_STANDARD 0x00
68 #define USB_REQ_TYPE_CLASS 0x20
69 #define USB_REQ_TYPE_VENDOR 0x40
70 #define USB_REQ_TYPE_MASK 0x60
71 
72 #define USB_REQ_RECIPIENT_DEVICE 0x00
73 #define USB_REQ_RECIPIENT_INTERFACE 0x01
74 #define USB_REQ_RECIPIENT_ENDPOINT 0x02
75 #define USB_REQ_RECIPIENT_MASK 0x03
76 
77 #define USB_REQ_GET_STATUS 0x00
78 #define USB_REQ_CLEAR_FEATURE 0x01
79 #define USB_REQ_SET_FEATURE 0x03
80 #define USB_REQ_SET_ADDRESS 0x05
81 #define USB_REQ_GET_DESCRIPTOR 0x06
82 #define USB_REQ_SET_DESCRIPTOR 0x07
83 #define USB_REQ_GET_CONFIGURATION 0x08
84 #define USB_REQ_SET_CONFIGURATION 0x09
85 #define USB_REQ_GET_INTERFACE 0x0A
86 #define USB_REQ_SET_INTERFACE 0x0B
87 #define USB_REQ_SYNCH_FRAME 0x0C
88 
89 #define USB_DESC_TYPE_DEVICE 1
90 #define USB_DESC_TYPE_CONFIGURATION 2
91 #define USB_DESC_TYPE_STRING 3
92 #define USB_DESC_TYPE_INTERFACE 4
93 #define USB_DESC_TYPE_ENDPOINT 5
94 #define USB_DESC_TYPE_DEVICE_QUALIFIER 6
95 #define USB_DESC_TYPE_OTHER_SPEED_CONFIGURATION 7
96 #define USB_DESC_TYPE_BOS 0x0F
97 
98 #define USB_CONFIG_REMOTE_WAKEUP 2
99 #define USB_CONFIG_SELF_POWERED 1
100 
101 #define USB_FEATURE_EP_HALT 0
102 #define USB_FEATURE_REMOTE_WAKEUP 1
103 #define USB_FEATURE_TEST_MODE 2
104 
122 #define SWAPBYTE(addr) (((uint16_t)(*((uint8_t *)(addr)))) + \
123  (((uint16_t)(*(((uint8_t *)(addr)) + 1))) << 8))
124 
125 #define LOBYTE(x) ((uint8_t)((x) & 0x00FF))
126 #define HIBYTE(x) ((uint8_t)(((x) & 0xFF00) >>8))
127 
147 #endif /* __USBD_DEF_H */
148 
156 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
USB Device configuration file.


rosflight_firmware
Author(s): Daniel Koch , James Jackson
autogenerated on Thu Apr 15 2021 05:07:50