ARMEBS4  revision-26.06.2015
usbd_def.h
1 #include "heivs/config.h"
2 #if (USE_STM32_USB_HOST_MODE || USE_STM32_USB_USE_DEVICE_MODE || USE_STM32_USB_OTG_MODE)
3 /**
4  ******************************************************************************
5  * @file usbd_def.h
6  * @author MCD Application Team
7  * @version V1.1.0
8  * @date 19-March-2012
9  * @brief general defines for the usb device library
10  ******************************************************************************
11  * @attention
12  *
13  * <h2><center>&copy; COPYRIGHT 2012 STMicroelectronics</center></h2>
14  *
15  * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
16  * You may not use this file except in compliance with the License.
17  * You may obtain a copy of the License at:
18  *
19  * http://www.st.com/software_license_agreement_liberty_v2
20  *
21  * Unless required by applicable law or agreed to in writing, software
22  * distributed under the License is distributed on an "AS IS" BASIS,
23  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
24  * See the License for the specific language governing permissions and
25  * limitations under the License.
26  *
27  ******************************************************************************
28  */
29 
30 /* Define to prevent recursive inclusion -------------------------------------*/
31 
32 #ifndef __USBD_DEF_H
33 #define __USBD_DEF_H
34 
35 /* Includes ------------------------------------------------------------------*/
36 
37 /** @addtogroup STM32_USB_OTG_DEVICE_LIBRARY
38  * @{
39  */
40 
41 /** @defgroup USB_DEF
42  * @brief general defines for the usb device library file
43  * @{
44  */
45 
46 /** @defgroup USB_DEF_Exported_Defines
47  * @{
48  */
49 
50 #ifndef NULL
51 #define NULL 0
52 #endif
53 
54 #define USB_LEN_DEV_QUALIFIER_DESC 0x0A
55 #define USB_LEN_DEV_DESC 0x12
56 #define USB_LEN_CFG_DESC 0x09
57 #define USB_LEN_IF_DESC 0x09
58 #define USB_LEN_EP_DESC 0x07
59 #define USB_LEN_OTG_DESC 0x03
60 
61 #define USBD_IDX_LANGID_STR 0x00
62 #define USBD_IDX_MFC_STR 0x01
63 #define USBD_IDX_PRODUCT_STR 0x02
64 #define USBD_IDX_SERIAL_STR 0x03
65 #define USBD_IDX_CONFIG_STR 0x04
66 #define USBD_IDX_INTERFACE_STR 0x05
67 
68 #define USB_REQ_TYPE_STANDARD 0x00
69 #define USB_REQ_TYPE_CLASS 0x20
70 #define USB_REQ_TYPE_VENDOR 0x40
71 #define USB_REQ_TYPE_MASK 0x60
72 
73 #define USB_REQ_RECIPIENT_DEVICE 0x00
74 #define USB_REQ_RECIPIENT_INTERFACE 0x01
75 #define USB_REQ_RECIPIENT_ENDPOINT 0x02
76 #define USB_REQ_RECIPIENT_MASK 0x03
77 
78 #define USB_REQ_GET_STATUS 0x00
79 #define USB_REQ_CLEAR_FEATURE 0x01
80 #define USB_REQ_SET_FEATURE 0x03
81 #define USB_REQ_SET_ADDRESS 0x05
82 #define USB_REQ_GET_DESCRIPTOR 0x06
83 #define USB_REQ_SET_DESCRIPTOR 0x07
84 #define USB_REQ_GET_CONFIGURATION 0x08
85 #define USB_REQ_SET_CONFIGURATION 0x09
86 #define USB_REQ_GET_INTERFACE 0x0A
87 #define USB_REQ_SET_INTERFACE 0x0B
88 #define USB_REQ_SYNCH_FRAME 0x0C
89 
90 #define USB_DESC_TYPE_DEVICE 1
91 #define USB_DESC_TYPE_CONFIGURATION 2
92 #define USB_DESC_TYPE_STRING 3
93 #define USB_DESC_TYPE_INTERFACE 4
94 #define USB_DESC_TYPE_ENDPOINT 5
95 #define USB_DESC_TYPE_DEVICE_QUALIFIER 6
96 #define USB_DESC_TYPE_OTHER_SPEED_CONFIGURATION 7
97 
98 
99 #define USB_CONFIG_REMOTE_WAKEUP 2
100 #define USB_CONFIG_SELF_POWERED 1
101 
102 #define USB_FEATURE_EP_HALT 0
103 #define USB_FEATURE_REMOTE_WAKEUP 1
104 #define USB_FEATURE_TEST_MODE 2
105 
106 /**
107  * @}
108  */
109 
110 
111 /** @defgroup USBD_DEF_Exported_TypesDefinitions
112  * @{
113  */
114 /**
115  * @}
116  */
117 
118 
119 
120 /** @defgroup USBD_DEF_Exported_Macros
121  * @{
122  */
123 #define SWAPBYTE(addr) (((uint16_t)(*((uint8_t *)(addr)))) + \
124  (((uint16_t)(*(((uint8_t *)(addr)) + 1))) << 8))
125 
126 #define LOBYTE(x) ((uint8_t)(x & 0x00FF))
127 #define HIBYTE(x) ((uint8_t)((x & 0xFF00) >>8))
128 /**
129  * @}
130  */
131 
132 /** @defgroup USBD_DEF_Exported_Variables
133  * @{
134  */
135 
136 /**
137  * @}
138  */
139 
140 /** @defgroup USBD_DEF_Exported_FunctionsPrototype
141  * @{
142  */
143 
144 /**
145  * @}
146  */
147 
148 #endif /* __USBD_DEF_H */
149 
150 /**
151  * @}
152  */
153 
154 /**
155 * @}
156 */
157 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
158 #endif /* (USE_STM32_USB_HOST_MODE || USE_STM32_USB_USE_DEVICE_MODE || USE_STM32_USB_OTG_MODE) */
libheivs configuration file