37 #ifndef __STM32F4xx_HAL_HCD_H
38 #define __STM32F4xx_HAL_HCD_H
43 #if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) || \
44 defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) || \
45 defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F411xE) || defined(STM32F446xx) || \
46 defined(STM32F469xx) || defined(STM32F479xx) || defined(STM32F412Zx) || defined(STM32F412Vx) || \
47 defined(STM32F412Rx) || defined(STM32F412Cx) || defined(STM32F413xx) || defined(STM32F423xx)
69 HAL_HCD_STATE_RESET = 0x00U,
70 HAL_HCD_STATE_READY = 0x01U,
71 HAL_HCD_STATE_ERROR = 0x02U,
72 HAL_HCD_STATE_BUSY = 0x03U,
73 HAL_HCD_STATE_TIMEOUT = 0x04U
76 typedef USB_OTG_GlobalTypeDef HCD_TypeDef;
77 typedef USB_OTG_CfgTypeDef HCD_InitTypeDef;
78 typedef USB_OTG_HCTypeDef HCD_HCTypeDef ;
79 typedef USB_OTG_URBStateTypeDef HCD_URBStateTypeDef ;
80 typedef USB_OTG_HCStateTypeDef HCD_HCStateTypeDef ;
92 HCD_HCTypeDef hc[15U];
94 __IO HCD_StateTypeDef
State;
113 #define HCD_SPEED_HIGH 0U
114 #define HCD_SPEED_LOW 2U
115 #define HCD_SPEED_FULL 3U
123 #define HCD_PHY_ULPI 1U
124 #define HCD_PHY_EMBEDDED 2U
138 #define __HAL_HCD_ENABLE(__HANDLE__) USB_EnableGlobalInt ((__HANDLE__)->Instance)
139 #define __HAL_HCD_DISABLE(__HANDLE__) USB_DisableGlobalInt ((__HANDLE__)->Instance)
141 #define __HAL_HCD_GET_FLAG(__HANDLE__, __INTERRUPT__) ((USB_ReadInterrupts((__HANDLE__)->Instance) & (__INTERRUPT__)) == (__INTERRUPT__))
142 #define __HAL_HCD_CLEAR_FLAG(__HANDLE__, __INTERRUPT__) (((__HANDLE__)->Instance->GINTSTS) = (__INTERRUPT__))
143 #define __HAL_HCD_IS_INVALID_INTERRUPT(__HANDLE__) (USB_ReadInterrupts((__HANDLE__)->Instance) == 0U)
145 #define __HAL_HCD_CLEAR_HC_INT(chnum, __INTERRUPT__) (USBx_HC(chnum)->HCINT = (__INTERRUPT__))
146 #define __HAL_HCD_MASK_HALT_HC_INT(chnum) (USBx_HC(chnum)->HCINTMSK &= ~USB_OTG_HCINTMSK_CHHM)
147 #define __HAL_HCD_UNMASK_HALT_HC_INT(chnum) (USBx_HC(chnum)->HCINTMSK |= USB_OTG_HCINTMSK_CHHM)
148 #define __HAL_HCD_MASK_ACK_HC_INT(chnum) (USBx_HC(chnum)->HCINTMSK &= ~USB_OTG_HCINTMSK_ACKM)
149 #define __HAL_HCD_UNMASK_ACK_HC_INT(chnum) (USBx_HC(chnum)->HCINTMSK |= USB_OTG_HCINTMSK_ACKM)
195 void HAL_HCD_IRQHandler(HCD_HandleTypeDef *hhcd);
201 HCD_URBStateTypeDef urb_state);
221 HCD_StateTypeDef HAL_HCD_GetState(HCD_HandleTypeDef *hhcd);
222 HCD_URBStateTypeDef HAL_HCD_HC_GetURBState(HCD_HandleTypeDef *hhcd,
uint8_t chnum);
223 uint32_t HAL_HCD_HC_GetXferCount(HCD_HandleTypeDef *hhcd,
uint8_t chnum);
224 HCD_HCStateTypeDef HAL_HCD_HC_GetState(HCD_HandleTypeDef *hhcd,
uint8_t chnum);
225 uint32_t HAL_HCD_GetCurrentFrame(HCD_HandleTypeDef *hhcd);
226 uint32_t HAL_HCD_GetCurrentSpeed(HCD_HandleTypeDef *hhcd);