Rev 2 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 2 | Rev 9 | ||
|---|---|---|---|
| Line 4... | Line 4... | ||
| 4 | * @author MCD Application Team |
4 | * @author MCD Application Team |
| 5 | * @brief Header file of HCD HAL module. |
5 | * @brief Header file of HCD HAL module. |
| 6 | ****************************************************************************** |
6 | ****************************************************************************** |
| 7 | * @attention |
7 | * @attention |
| 8 | * |
8 | * |
| 9 | * <h2><center>© COPYRIGHT(c) 2016 STMicroelectronics</center></h2> |
9 | * <h2><center>© Copyright (c) 2016 STMicroelectronics. |
| - | 10 | * All rights reserved.</center></h2> |
|
| 10 | * |
11 | * |
| 11 | * Redistribution and use in source and binary forms, with or without modification, |
12 | * This software component is licensed by ST under BSD 3-Clause license, |
| 12 | * are permitted provided that the following conditions are met: |
13 | * the "License"; You may not use this file except in compliance with the |
| 13 | * 1. Redistributions of source code must retain the above copyright notice, |
- | |
| 14 | * this list of conditions and the following disclaimer. |
- | |
| 15 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
- | |
| 16 | * this list of conditions and the following disclaimer in the documentation |
- | |
| 17 | * and/or other materials provided with the distribution. |
14 | * License. You may obtain a copy of the License at: |
| 18 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
- | |
| 19 | * may be used to endorse or promote products derived from this software |
15 | * opensource.org/licenses/BSD-3-Clause |
| 20 | * without specific prior written permission. |
- | |
| 21 | * |
- | |
| 22 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
- | |
| 23 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
- | |
| 24 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
- | |
| 25 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
- | |
| 26 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
- | |
| 27 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
- | |
| 28 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
- | |
| 29 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
- | |
| 30 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
- | |
| 31 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
- | |
| 32 | * |
16 | * |
| 33 | ****************************************************************************** |
17 | ****************************************************************************** |
| 34 | */ |
18 | */ |
| 35 | 19 | ||
| 36 | /* Define to prevent recursive inclusion -------------------------------------*/ |
20 | /* Define to prevent recursive inclusion -------------------------------------*/ |
| 37 | #ifndef __STM32F1xx_HAL_HCD_H |
21 | #ifndef STM32F1xx_HAL_HCD_H |
| 38 | #define __STM32F1xx_HAL_HCD_H |
22 | #define STM32F1xx_HAL_HCD_H |
| 39 | 23 | ||
| 40 | #ifdef __cplusplus |
24 | #ifdef __cplusplus |
| 41 | extern "C" { |
25 | extern "C" { |
| 42 | #endif |
26 | #endif |
| 43 | 27 | ||
| 44 | #if defined(STM32F105xC) || defined(STM32F107xC) |
- | |
| 45 | - | ||
| 46 | - | ||
| 47 | /* Includes ------------------------------------------------------------------*/ |
28 | /* Includes ------------------------------------------------------------------*/ |
| 48 | #include "stm32f1xx_ll_usb.h" |
29 | #include "stm32f1xx_ll_usb.h" |
| 49 | 30 | ||
| - | 31 | #if defined (USB_OTG_FS) |
|
| 50 | /** @addtogroup STM32F1xx_HAL_Driver |
32 | /** @addtogroup STM32F1xx_HAL_Driver |
| 51 | * @{ |
33 | * @{ |
| 52 | */ |
34 | */ |
| 53 | 35 | ||
| 54 | /** @addtogroup HCD |
36 | /** @addtogroup HCD HCD |
| 55 | * @{ |
37 | * @{ |
| 56 | */ |
38 | */ |
| 57 | 39 | ||
| 58 | /* Exported types ------------------------------------------------------------*/ |
40 | /* Exported types ------------------------------------------------------------*/ |
| 59 | /** @defgroup HCD_Exported_Types HCD Exported Types |
41 | /** @defgroup HCD_Exported_Types HCD Exported Types |
| 60 | * @{ |
42 | * @{ |
| 61 | */ |
43 | */ |
| 62 | 44 | ||
| 63 | /** |
- | |
| 64 | * @brief HCD Status structure definition |
45 | /** @defgroup HCD_Exported_Types_Group1 HCD State Structure definition |
| - | 46 | * @{ |
|
| 65 | */ |
47 | */ |
| 66 | typedef enum |
48 | typedef enum |
| 67 | { |
49 | { |
| 68 | HAL_HCD_STATE_RESET = 0x00U, |
50 | HAL_HCD_STATE_RESET = 0x00, |
| 69 | HAL_HCD_STATE_READY = 0x01U, |
51 | HAL_HCD_STATE_READY = 0x01, |
| 70 | HAL_HCD_STATE_ERROR = 0x02U, |
52 | HAL_HCD_STATE_ERROR = 0x02, |
| 71 | HAL_HCD_STATE_BUSY = 0x03U, |
53 | HAL_HCD_STATE_BUSY = 0x03, |
| 72 | HAL_HCD_STATE_TIMEOUT = 0x04U |
54 | HAL_HCD_STATE_TIMEOUT = 0x04 |
| 73 | } HCD_StateTypeDef; |
55 | } HCD_StateTypeDef; |
| 74 | 56 | ||
| 75 | typedef USB_OTG_GlobalTypeDef HCD_TypeDef; |
57 | typedef USB_OTG_GlobalTypeDef HCD_TypeDef; |
| 76 | typedef USB_OTG_CfgTypeDef HCD_InitTypeDef; |
58 | typedef USB_OTG_CfgTypeDef HCD_InitTypeDef; |
| 77 | typedef USB_OTG_HCTypeDef HCD_HCTypeDef; |
59 | typedef USB_OTG_HCTypeDef HCD_HCTypeDef; |
| 78 | typedef USB_OTG_URBStateTypeDef HCD_URBStateTypeDef; |
60 | typedef USB_OTG_URBStateTypeDef HCD_URBStateTypeDef; |
| 79 | typedef USB_OTG_HCStateTypeDef HCD_HCStateTypeDef; |
61 | typedef USB_OTG_HCStateTypeDef HCD_HCStateTypeDef; |
| 80 | - | ||
| 81 | /** |
62 | /** |
| - | 63 | * @} |
|
| - | 64 | */ |
|
| - | 65 | ||
| 82 | * @brief HCD Handle Structure definition |
66 | /** @defgroup HCD_Exported_Types_Group2 HCD Handle Structure definition |
| - | 67 | * @{ |
|
| 83 | */ |
68 | */ |
| - | 69 | #if (USE_HAL_HCD_REGISTER_CALLBACKS == 1U) |
|
| - | 70 | typedef struct __HCD_HandleTypeDef |
|
| - | 71 | #else |
|
| 84 | typedef struct |
72 | typedef struct |
| - | 73 | #endif /* USE_HAL_HCD_REGISTER_CALLBACKS */ |
|
| 85 | { |
74 | { |
| 86 | HCD_TypeDef *Instance; /*!< Register base address */ |
75 | HCD_TypeDef *Instance; /*!< Register base address */ |
| 87 | HCD_InitTypeDef Init; /*!< HCD required parameters */ |
76 | HCD_InitTypeDef Init; /*!< HCD required parameters */ |
| 88 | HCD_HCTypeDef hc[15U]; /*!< Host channels parameters */ |
77 | HCD_HCTypeDef hc[16]; /*!< Host channels parameters */ |
| 89 | HAL_LockTypeDef Lock; /*!< HCD peripheral status */ |
78 | HAL_LockTypeDef Lock; /*!< HCD peripheral status */ |
| 90 | __IO HCD_StateTypeDef State; /*!< HCD communication state */ |
79 | __IO HCD_StateTypeDef State; /*!< HCD communication state */ |
| - | 80 | __IO uint32_t ErrorCode; /*!< HCD Error code */ |
|
| 91 | void *pData; /*!< Pointer Stack Handler */ |
81 | void *pData; /*!< Pointer Stack Handler */ |
| - | 82 | #if (USE_HAL_HCD_REGISTER_CALLBACKS == 1U) |
|
| - | 83 | void (* SOFCallback)(struct __HCD_HandleTypeDef *hhcd); /*!< USB OTG HCD SOF callback */ |
|
| - | 84 | void (* ConnectCallback)(struct __HCD_HandleTypeDef *hhcd); /*!< USB OTG HCD Connect callback */ |
|
| - | 85 | void (* DisconnectCallback)(struct __HCD_HandleTypeDef *hhcd); /*!< USB OTG HCD Disconnect callback */ |
|
| - | 86 | void (* PortEnabledCallback)(struct __HCD_HandleTypeDef *hhcd); /*!< USB OTG HCD Port Enable callback */ |
|
| - | 87 | void (* PortDisabledCallback)(struct __HCD_HandleTypeDef *hhcd); /*!< USB OTG HCD Port Disable callback */ |
|
| - | 88 | void (* HC_NotifyURBChangeCallback)(struct __HCD_HandleTypeDef *hhcd, uint8_t chnum, |
|
| - | 89 | HCD_URBStateTypeDef urb_state); /*!< USB OTG HCD Host Channel Notify URB Change callback */ |
|
| - | 90 | ||
| - | 91 | void (* MspInitCallback)(struct __HCD_HandleTypeDef *hhcd); /*!< USB OTG HCD Msp Init callback */ |
|
| - | 92 | void (* MspDeInitCallback)(struct __HCD_HandleTypeDef *hhcd); /*!< USB OTG HCD Msp DeInit callback */ |
|
| - | 93 | #endif /* USE_HAL_HCD_REGISTER_CALLBACKS */ |
|
| 92 | } HCD_HandleTypeDef; |
94 | } HCD_HandleTypeDef; |
| - | 95 | /** |
|
| - | 96 | * @} |
|
| - | 97 | */ |
|
| 93 | 98 | ||
| 94 | /** |
99 | /** |
| 95 | * @} |
100 | * @} |
| 96 | */ |
101 | */ |
| 97 | 102 | ||
| 98 | /* Exported constants --------------------------------------------------------*/ |
103 | /* Exported constants --------------------------------------------------------*/ |
| 99 | /** @defgroup HCD_Exported_Constants HCD Exported Constants |
104 | /** @defgroup HCD_Exported_Constants HCD Exported Constants |
| 100 | * @{ |
105 | * @{ |
| 101 | */ |
106 | */ |
| - | 107 | ||
| 102 | /** @defgroup HCD_Speed HCD Speed |
108 | /** @defgroup HCD_Speed HCD Speed |
| 103 | * @{ |
109 | * @{ |
| 104 | */ |
110 | */ |
| - | 111 | #define HCD_SPEED_FULL USBH_FSLS_SPEED |
|
| - | 112 | #define HCD_SPEED_LOW USBH_FSLS_SPEED |
|
| - | 113 | ||
| - | 114 | /** |
|
| - | 115 | * @} |
|
| - | 116 | */ |
|
| - | 117 | ||
| - | 118 | /** @defgroup HCD_PHY_Module HCD PHY Module |
|
| - | 119 | * @{ |
|
| - | 120 | */ |
|
| 105 | #define HCD_SPEED_LOW 2U |
121 | #define HCD_PHY_ULPI 1U |
| 106 | #define HCD_SPEED_FULL 3U |
122 | #define HCD_PHY_EMBEDDED 2U |
| - | 123 | /** |
|
| - | 124 | * @} |
|
| - | 125 | */ |
|
| - | 126 | ||
| - | 127 | /** @defgroup HCD_Error_Code_definition HCD Error Code definition |
|
| - | 128 | * @brief HCD Error Code definition |
|
| - | 129 | * @{ |
|
| - | 130 | */ |
|
| - | 131 | #if (USE_HAL_HCD_REGISTER_CALLBACKS == 1U) |
|
| - | 132 | #define HAL_HCD_ERROR_INVALID_CALLBACK (0x00000010U) /*!< Invalid Callback error */ |
|
| - | 133 | #endif /* USE_HAL_HCD_REGISTER_CALLBACKS */ |
|
| 107 | 134 | ||
| 108 | /** |
135 | /** |
| 109 | * @} |
136 | * @} |
| 110 | */ |
137 | */ |
| 111 | 138 | ||
| 112 | /** |
139 | /** |
| 113 | * @} |
140 | * @} |
| 114 | */ |
141 | */ |
| 115 | 142 | ||
| 116 | /* Exported macro ------------------------------------------------------------*/ |
143 | /* Exported macro ------------------------------------------------------------*/ |
| 117 | /** @defgroup HCD_Exported_Macros HCD Exported Macros |
144 | /** @defgroup HCD_Exported_Macros HCD Exported Macros |
| 118 | * @brief macros to handle interrupts and specific clock configurations |
145 | * @brief macros to handle interrupts and specific clock configurations |
| 119 | * @{ |
146 | * @{ |
| 120 | */ |
147 | */ |
| 121 | #define __HAL_HCD_ENABLE(__HANDLE__) USB_EnableGlobalInt ((__HANDLE__)->Instance) |
148 | #define __HAL_HCD_ENABLE(__HANDLE__) (void)USB_EnableGlobalInt ((__HANDLE__)->Instance) |
| 122 | #define __HAL_HCD_DISABLE(__HANDLE__) USB_DisableGlobalInt ((__HANDLE__)->Instance) |
149 | #define __HAL_HCD_DISABLE(__HANDLE__) (void)USB_DisableGlobalInt ((__HANDLE__)->Instance) |
| 123 | - | ||
| 124 | 150 | ||
| 125 | #define __HAL_HCD_GET_FLAG(__HANDLE__, __INTERRUPT__) ((USB_ReadInterrupts((__HANDLE__)->Instance) & (__INTERRUPT__)) == (__INTERRUPT__)) |
151 | #define __HAL_HCD_GET_FLAG(__HANDLE__, __INTERRUPT__) ((USB_ReadInterrupts((__HANDLE__)->Instance) & (__INTERRUPT__)) == (__INTERRUPT__)) |
| 126 | #define __HAL_HCD_CLEAR_FLAG(__HANDLE__, __INTERRUPT__) (((__HANDLE__)->Instance->GINTSTS) = (__INTERRUPT__)) |
152 | #define __HAL_HCD_CLEAR_FLAG(__HANDLE__, __INTERRUPT__) (((__HANDLE__)->Instance->GINTSTS) = (__INTERRUPT__)) |
| 127 | #define __HAL_HCD_IS_INVALID_INTERRUPT(__HANDLE__) (USB_ReadInterrupts((__HANDLE__)->Instance) == 0U) |
153 | #define __HAL_HCD_IS_INVALID_INTERRUPT(__HANDLE__) (USB_ReadInterrupts((__HANDLE__)->Instance) == 0U) |
| 128 | - | ||
| 129 | - | ||
| 130 | #define __HAL_HCD_CLEAR_HC_INT(chnum, __INTERRUPT__) (USBx_HC(chnum)->HCINT = (__INTERRUPT__)) |
- | |
| 131 | #define __HAL_HCD_MASK_HALT_HC_INT(chnum) (USBx_HC(chnum)->HCINTMSK &= ~USB_OTG_HCINTMSK_CHHM) |
- | |
| 132 | #define __HAL_HCD_UNMASK_HALT_HC_INT(chnum) (USBx_HC(chnum)->HCINTMSK |= USB_OTG_HCINTMSK_CHHM) |
- | |
| 133 | #define __HAL_HCD_MASK_ACK_HC_INT(chnum) (USBx_HC(chnum)->HCINTMSK &= ~USB_OTG_HCINTMSK_ACKM) |
- | |
| 134 | #define __HAL_HCD_UNMASK_ACK_HC_INT(chnum) (USBx_HC(chnum)->HCINTMSK |= USB_OTG_HCINTMSK_ACKM) |
- | |
| 135 | 154 | ||
| - | 155 | #define __HAL_HCD_CLEAR_HC_INT(chnum, __INTERRUPT__) (USBx_HC(chnum)->HCINT = (__INTERRUPT__)) |
|
| - | 156 | #define __HAL_HCD_MASK_HALT_HC_INT(chnum) (USBx_HC(chnum)->HCINTMSK &= ~USB_OTG_HCINTMSK_CHHM) |
|
| - | 157 | #define __HAL_HCD_UNMASK_HALT_HC_INT(chnum) (USBx_HC(chnum)->HCINTMSK |= USB_OTG_HCINTMSK_CHHM) |
|
| - | 158 | #define __HAL_HCD_MASK_ACK_HC_INT(chnum) (USBx_HC(chnum)->HCINTMSK &= ~USB_OTG_HCINTMSK_ACKM) |
|
| - | 159 | #define __HAL_HCD_UNMASK_ACK_HC_INT(chnum) (USBx_HC(chnum)->HCINTMSK |= USB_OTG_HCINTMSK_ACKM) |
|
| 136 | /** |
160 | /** |
| 137 | * @} |
161 | * @} |
| 138 | */ |
162 | */ |
| 139 | 163 | ||
| 140 | /* Exported functions --------------------------------------------------------*/ |
164 | /* Exported functions --------------------------------------------------------*/ |
| 141 | /** @addtogroup HCD_Exported_Functions HCD Exported Functions |
165 | /** @addtogroup HCD_Exported_Functions HCD Exported Functions |
| 142 | * @{ |
166 | * @{ |
| 143 | */ |
167 | */ |
| 144 | 168 | ||
| 145 | /* Initialization/de-initialization functions ********************************/ |
169 | /** @defgroup HCD_Exported_Functions_Group1 Initialization and de-initialization functions |
| - | 170 | * @{ |
|
| - | 171 | */ |
|
| - | 172 | HAL_StatusTypeDef HAL_HCD_Init(HCD_HandleTypeDef *hhcd); |
|
| - | 173 | HAL_StatusTypeDef HAL_HCD_DeInit(HCD_HandleTypeDef *hhcd); |
|
| - | 174 | HAL_StatusTypeDef HAL_HCD_HC_Init(HCD_HandleTypeDef *hhcd, uint8_t ch_num, |
|
| - | 175 | uint8_t epnum, uint8_t dev_address, |
|
| - | 176 | uint8_t speed, uint8_t ep_type, uint16_t mps); |
|
| - | 177 | ||
| - | 178 | HAL_StatusTypeDef HAL_HCD_HC_Halt(HCD_HandleTypeDef *hhcd, uint8_t ch_num); |
|
| - | 179 | void HAL_HCD_MspInit(HCD_HandleTypeDef *hhcd); |
|
| - | 180 | void HAL_HCD_MspDeInit(HCD_HandleTypeDef *hhcd); |
|
| - | 181 | ||
| - | 182 | #if (USE_HAL_HCD_REGISTER_CALLBACKS == 1U) |
|
| 146 | /** @addtogroup HCD_Exported_Functions_Group1 Initialization and de-initialization functions |
183 | /** @defgroup HAL_HCD_Callback_ID_enumeration_definition HAL USB OTG HCD Callback ID enumeration definition |
| - | 184 | * @brief HAL USB OTG HCD Callback ID enumeration definition |
|
| 147 | * @{ |
185 | * @{ |
| 148 | */ |
186 | */ |
| 149 | HAL_StatusTypeDef HAL_HCD_Init(HCD_HandleTypeDef *hhcd); |
187 | typedef enum |
| - | 188 | { |
|
| 150 | HAL_StatusTypeDef HAL_HCD_DeInit (HCD_HandleTypeDef *hhcd); |
189 | HAL_HCD_SOF_CB_ID = 0x01, /*!< USB HCD SOF callback ID */ |
| 151 | HAL_StatusTypeDef HAL_HCD_HC_Init(HCD_HandleTypeDef *hhcd, |
190 | HAL_HCD_CONNECT_CB_ID = 0x02, /*!< USB HCD Connect callback ID */ |
| 152 | uint8_t ch_num, |
191 | HAL_HCD_DISCONNECT_CB_ID = 0x03, /*!< USB HCD Disconnect callback ID */ |
| 153 | uint8_t epnum, |
192 | HAL_HCD_PORT_ENABLED_CB_ID = 0x04, /*!< USB HCD Port Enable callback ID */ |
| 154 | uint8_t dev_address, |
193 | HAL_HCD_PORT_DISABLED_CB_ID = 0x05, /*!< USB HCD Port Disable callback ID */ |
| - | 194 | ||
| 155 | uint8_t speed, |
195 | HAL_HCD_MSPINIT_CB_ID = 0x06, /*!< USB HCD MspInit callback ID */ |
| 156 | uint8_t ep_type, |
196 | HAL_HCD_MSPDEINIT_CB_ID = 0x07 /*!< USB HCD MspDeInit callback ID */ |
| - | 197 | ||
| 157 | uint16_t mps); |
198 | } HAL_HCD_CallbackIDTypeDef; |
| - | 199 | /** |
|
| - | 200 | * @} |
|
| - | 201 | */ |
|
| 158 | 202 | ||
| 159 | HAL_StatusTypeDef HAL_HCD_HC_Halt(HCD_HandleTypeDef *hhcd, |
203 | /** @defgroup HAL_HCD_Callback_pointer_definition HAL USB OTG HCD Callback pointer definition |
| 160 | uint8_t ch_num); |
204 | * @brief HAL USB OTG HCD Callback pointer definition |
| - | 205 | * @{ |
|
| - | 206 | */ |
|
| 161 | 207 | ||
| - | 208 | typedef void (*pHCD_CallbackTypeDef)(HCD_HandleTypeDef *hhcd); /*!< pointer to a common USB OTG HCD callback function */ |
|
| - | 209 | typedef void (*pHCD_HC_NotifyURBChangeCallbackTypeDef)(HCD_HandleTypeDef *hhcd, |
|
| - | 210 | uint8_t epnum, |
|
| - | 211 | HCD_URBStateTypeDef urb_state); /*!< pointer to USB OTG HCD host channel callback */ |
|
| - | 212 | /** |
|
| - | 213 | * @} |
|
| - | 214 | */ |
|
| - | 215 | ||
| 162 | void HAL_HCD_MspInit(HCD_HandleTypeDef *hhcd); |
216 | HAL_StatusTypeDef HAL_HCD_RegisterCallback(HCD_HandleTypeDef *hhcd, |
| - | 217 | HAL_HCD_CallbackIDTypeDef CallbackID, |
|
| 163 | void HAL_HCD_MspDeInit(HCD_HandleTypeDef *hhcd); |
218 | pHCD_CallbackTypeDef pCallback); |
| - | 219 | ||
| - | 220 | HAL_StatusTypeDef HAL_HCD_UnRegisterCallback(HCD_HandleTypeDef *hhcd, |
|
| - | 221 | HAL_HCD_CallbackIDTypeDef CallbackID); |
|
| - | 222 | ||
| - | 223 | HAL_StatusTypeDef HAL_HCD_RegisterHC_NotifyURBChangeCallback(HCD_HandleTypeDef *hhcd, |
|
| - | 224 | pHCD_HC_NotifyURBChangeCallbackTypeDef pCallback); |
|
| - | 225 | ||
| - | 226 | HAL_StatusTypeDef HAL_HCD_UnRegisterHC_NotifyURBChangeCallback(HCD_HandleTypeDef *hhcd); |
|
| - | 227 | #endif /* USE_HAL_HCD_REGISTER_CALLBACKS */ |
|
| 164 | /** |
228 | /** |
| 165 | * @} |
229 | * @} |
| 166 | */ |
230 | */ |
| 167 | 231 | ||
| 168 | /* I/O operation functions ***************************************************/ |
232 | /* I/O operation functions ***************************************************/ |
| 169 | /** @addtogroup HCD_Exported_Functions_Group2 IO operation functions |
233 | /** @addtogroup HCD_Exported_Functions_Group2 Input and Output operation functions |
| 170 | * @{ |
234 | * @{ |
| 171 | */ |
235 | */ |
| 172 | HAL_StatusTypeDef HAL_HCD_HC_SubmitRequest(HCD_HandleTypeDef *hhcd, |
236 | HAL_StatusTypeDef HAL_HCD_HC_SubmitRequest(HCD_HandleTypeDef *hhcd, uint8_t ch_num, |
| 173 | uint8_t pipe, |
- | |
| 174 | uint8_t direction, |
- | |
| 175 | uint8_t ep_type, |
237 | uint8_t direction, uint8_t ep_type, |
| 176 | uint8_t token, |
- | |
| 177 | uint8_t* pbuff, |
238 | uint8_t token, uint8_t *pbuff, |
| 178 | uint16_t length, |
- | |
| 179 | uint8_t do_ping); |
239 | uint16_t length, uint8_t do_ping); |
| 180 | 240 | ||
| 181 | /* Non-Blocking mode: Interrupt */ |
241 | /* Non-Blocking mode: Interrupt */ |
| 182 | void HAL_HCD_IRQHandler(HCD_HandleTypeDef *hhcd); |
242 | void HAL_HCD_IRQHandler(HCD_HandleTypeDef *hhcd); |
| - | 243 | void HAL_HCD_WKUP_IRQHandler(HCD_HandleTypeDef *hhcd); |
|
| 183 | void HAL_HCD_SOF_Callback(HCD_HandleTypeDef *hhcd); |
244 | void HAL_HCD_SOF_Callback(HCD_HandleTypeDef *hhcd); |
| 184 | void HAL_HCD_Connect_Callback(HCD_HandleTypeDef *hhcd); |
245 | void HAL_HCD_Connect_Callback(HCD_HandleTypeDef *hhcd); |
| 185 | void HAL_HCD_Disconnect_Callback(HCD_HandleTypeDef *hhcd); |
246 | void HAL_HCD_Disconnect_Callback(HCD_HandleTypeDef *hhcd); |
| - | 247 | void HAL_HCD_PortEnabled_Callback(HCD_HandleTypeDef *hhcd); |
|
| 186 | void HAL_HCD_HC_NotifyURBChange_Callback(HCD_HandleTypeDef *hhcd, |
248 | void HAL_HCD_PortDisabled_Callback(HCD_HandleTypeDef *hhcd); |
| 187 | uint8_t chnum, |
249 | void HAL_HCD_HC_NotifyURBChange_Callback(HCD_HandleTypeDef *hhcd, uint8_t chnum, |
| 188 | HCD_URBStateTypeDef urb_state); |
250 | HCD_URBStateTypeDef urb_state); |
| 189 | /** |
251 | /** |
| 190 | * @} |
252 | * @} |
| 191 | */ |
253 | */ |
| - | 254 | ||
| 192 | /* Peripheral Control functions **********************************************/ |
255 | /* Peripheral Control functions **********************************************/ |
| 193 | /** @addtogroup HCD_Exported_Functions_Group3 Peripheral Control functions |
256 | /** @addtogroup HCD_Exported_Functions_Group3 Peripheral Control functions |
| 194 | * @{ |
257 | * @{ |
| 195 | */ |
258 | */ |
| 196 | HAL_StatusTypeDef HAL_HCD_ResetPort(HCD_HandleTypeDef *hhcd); |
259 | HAL_StatusTypeDef HAL_HCD_ResetPort(HCD_HandleTypeDef *hhcd); |
| 197 | HAL_StatusTypeDef HAL_HCD_Start(HCD_HandleTypeDef *hhcd); |
260 | HAL_StatusTypeDef HAL_HCD_Start(HCD_HandleTypeDef *hhcd); |
| 198 | HAL_StatusTypeDef HAL_HCD_Stop(HCD_HandleTypeDef *hhcd); |
261 | HAL_StatusTypeDef HAL_HCD_Stop(HCD_HandleTypeDef *hhcd); |
| 199 | /** |
262 | /** |
| 200 | * @} |
263 | * @} |
| 201 | */ |
264 | */ |
| - | 265 | ||
| 202 | /* Peripheral State functions ************************************************/ |
266 | /* Peripheral State functions ************************************************/ |
| 203 | /** @addtogroup HCD_Exported_Functions_Group4 Peripheral State functions |
267 | /** @addtogroup HCD_Exported_Functions_Group4 Peripheral State functions |
| 204 | * @{ |
268 | * @{ |
| 205 | */ |
269 | */ |
| 206 | HCD_StateTypeDef HAL_HCD_GetState(HCD_HandleTypeDef *hhcd); |
270 | HCD_StateTypeDef HAL_HCD_GetState(HCD_HandleTypeDef *hhcd); |
| 207 | HCD_URBStateTypeDef HAL_HCD_HC_GetURBState(HCD_HandleTypeDef *hhcd, uint8_t chnum); |
271 | HCD_URBStateTypeDef HAL_HCD_HC_GetURBState(HCD_HandleTypeDef *hhcd, uint8_t chnum); |
| 208 | uint32_t HAL_HCD_HC_GetXferCount(HCD_HandleTypeDef *hhcd, uint8_t chnum); |
272 | HCD_HCStateTypeDef HAL_HCD_HC_GetState(HCD_HandleTypeDef *hhcd, uint8_t chnum); |
| 209 | HCD_HCStateTypeDef HAL_HCD_HC_GetState(HCD_HandleTypeDef *hhcd, uint8_t chnum); |
273 | uint32_t HAL_HCD_HC_GetXferCount(HCD_HandleTypeDef *hhcd, uint8_t chnum); |
| 210 | uint32_t HAL_HCD_GetCurrentFrame(HCD_HandleTypeDef *hhcd); |
274 | uint32_t HAL_HCD_GetCurrentFrame(HCD_HandleTypeDef *hhcd); |
| 211 | uint32_t HAL_HCD_GetCurrentSpeed(HCD_HandleTypeDef *hhcd); |
275 | uint32_t HAL_HCD_GetCurrentSpeed(HCD_HandleTypeDef *hhcd); |
| - | 276 | ||
| 212 | /** |
277 | /** |
| 213 | * @} |
278 | * @} |
| 214 | */ |
279 | */ |
| 215 | 280 | ||
| 216 | /** |
281 | /** |
| 217 | * @} |
282 | * @} |
| 218 | */ |
283 | */ |
| 219 | 284 | ||
| 220 | /* Private macros ------------------------------------------------------------*/ |
285 | /* Private macros ------------------------------------------------------------*/ |
| 221 | /** @defgroup HCD_Private_Macros HCD Private Macros |
286 | /** @defgroup HCD_Private_Macros HCD Private Macros |
| 222 | * @{ |
- | |
| 223 | */ |
- | |
| 224 | /** @defgroup HCD_Instance_definition HCD Instance definition |
- | |
| 225 | * @{ |
287 | * @{ |
| 226 | */ |
288 | */ |
| 227 | #define IS_HCD_ALL_INSTANCE(INSTANCE) (((INSTANCE) == USB_OTG_FS)) |
- | |
| 228 | /** |
289 | /** |
| 229 | * @} |
290 | * @} |
| 230 | */ |
291 | */ |
| 231 | /** |
- | |
| 232 | * @} |
- | |
| 233 | */ |
- | |
| - | 292 | /* Private functions prototypes ----------------------------------------------*/ |
|
| 234 | 293 | ||
| 235 | /** |
294 | /** |
| 236 | * @} |
295 | * @} |
| 237 | */ |
296 | */ |
| 238 | - | ||
| 239 | /** |
297 | /** |
| 240 | * @} |
298 | * @} |
| 241 | */ |
299 | */ |
| 242 | - | ||
| 243 | #endif /* STM32F105xC || STM32F107xC */ |
300 | #endif /* defined (USB_OTG_FS) */ |
| 244 | - | ||
| 245 | 301 | ||
| 246 | #ifdef __cplusplus |
302 | #ifdef __cplusplus |
| 247 | } |
303 | } |
| 248 | #endif |
304 | #endif |
| 249 | 305 | ||
| 250 | #endif /* __STM32F1xx_HAL_HCD_H */ |
306 | #endif /* STM32F1xx_HAL_HCD_H */ |
| 251 | 307 | ||
| 252 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |
308 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |