[GYRO] Refactor gyro driver for dual-gyro support
[inav.git] / lib / main / STM32_USB_OTG_Driver / inc / usb_dcd.h
blob123126cb6724a4326e6b1f77b934b608576875f4
1 /**
2 ******************************************************************************
3 * @file usb_dcd.h
4 * @author MCD Application Team
5 * @version V2.2.0
6 * @date 09-November-2015
7 * @brief Peripheral Driver Header file
8 ******************************************************************************
9 * @attention
11 * <h2><center>&copy; COPYRIGHT 2015 STMicroelectronics</center></h2>
13 * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
14 * You may not use this file except in compliance with the License.
15 * You may obtain a copy of the License at:
17 * http://www.st.com/software_license_agreement_liberty_v2
19 * Unless required by applicable law or agreed to in writing, software
20 * distributed under the License is distributed on an "AS IS" BASIS,
21 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22 * See the License for the specific language governing permissions and
23 * limitations under the License.
25 ******************************************************************************
28 /* Define to prevent recursive inclusion -------------------------------------*/
29 #ifndef __DCD_H__
30 #define __DCD_H__
32 /* Includes ------------------------------------------------------------------*/
33 #include "usb_core.h"
36 /** @addtogroup USB_OTG_DRIVER
37 * @{
40 /** @defgroup USB_DCD
41 * @brief This file is the
42 * @{
43 */
46 /** @defgroup USB_DCD_Exported_Defines
47 * @{
48 */
49 #define USB_OTG_EP_CONTROL 0
50 #define USB_OTG_EP_ISOC 1
51 #define USB_OTG_EP_BULK 2
52 #define USB_OTG_EP_INT 3
53 #define USB_OTG_EP_MASK 3
55 /* Device Status */
56 #define USB_OTG_DEFAULT 1
57 #define USB_OTG_ADDRESSED 2
58 #define USB_OTG_CONFIGURED 3
59 #define USB_OTG_SUSPENDED 4
61 /**
62 * @}
63 */
66 /** @defgroup USB_DCD_Exported_Types
67 * @{
68 */
69 /********************************************************************************
70 Data structure type
71 ********************************************************************************/
72 typedef struct
74 uint8_t bLength;
75 uint8_t bDescriptorType;
76 uint8_t bEndpointAddress;
77 uint8_t bmAttributes;
78 uint16_t wMaxPacketSize;
79 uint8_t bInterval;
81 EP_DESCRIPTOR , *PEP_DESCRIPTOR;
83 /**
84 * @}
85 */
88 /** @defgroup USB_DCD_Exported_Macros
89 * @{
90 */
91 /**
92 * @}
93 */
95 /** @defgroup USB_DCD_Exported_Variables
96 * @{
97 */
98 /**
99 * @}
102 /** @defgroup USB_DCD_Exported_FunctionsPrototype
103 * @{
105 /********************************************************************************
106 EXPORTED FUNCTION FROM THE USB-OTG LAYER
107 ********************************************************************************/
108 void DCD_Init(USB_OTG_CORE_HANDLE *pdev ,
109 USB_OTG_CORE_ID_TypeDef coreID);
111 void DCD_DevConnect (USB_OTG_CORE_HANDLE *pdev);
112 void DCD_DevDisconnect (USB_OTG_CORE_HANDLE *pdev);
113 void DCD_EP_SetAddress (USB_OTG_CORE_HANDLE *pdev,
114 uint8_t address);
115 uint32_t DCD_EP_Open(USB_OTG_CORE_HANDLE *pdev ,
116 uint8_t ep_addr,
117 uint16_t ep_mps,
118 uint8_t ep_type);
120 uint32_t DCD_EP_Close (USB_OTG_CORE_HANDLE *pdev,
121 uint8_t ep_addr);
124 uint32_t DCD_EP_PrepareRx ( USB_OTG_CORE_HANDLE *pdev,
125 uint8_t ep_addr,
126 uint8_t *pbuf,
127 uint16_t buf_len);
129 uint32_t DCD_EP_Tx (USB_OTG_CORE_HANDLE *pdev,
130 uint8_t ep_addr,
131 uint8_t *pbuf,
132 uint32_t buf_len);
133 uint32_t DCD_EP_Stall (USB_OTG_CORE_HANDLE *pdev,
134 uint8_t epnum);
135 uint32_t DCD_EP_ClrStall (USB_OTG_CORE_HANDLE *pdev,
136 uint8_t epnum);
137 uint32_t DCD_EP_Flush (USB_OTG_CORE_HANDLE *pdev,
138 uint8_t epnum);
139 uint32_t DCD_Handle_ISR(USB_OTG_CORE_HANDLE *pdev);
141 uint32_t DCD_GetEPStatus(USB_OTG_CORE_HANDLE *pdev ,
142 uint8_t epnum);
144 void DCD_SetEPStatus (USB_OTG_CORE_HANDLE *pdev ,
145 uint8_t epnum ,
146 uint32_t Status);
149 * @}
153 #endif /* __DCD_H__ */
157 * @}
161 * @}
163 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/