stm32f7xx_hal_pcd.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451
  1. /**
  2. ******************************************************************************
  3. * @file stm32f7xx_hal_pcd.h
  4. * @author MCD Application Team
  5. * @brief Header file of PCD HAL module.
  6. ******************************************************************************
  7. * @attention
  8. *
  9. * Copyright (c) 2017 STMicroelectronics.
  10. * All rights reserved.
  11. *
  12. * This software is licensed under terms that can be found in the LICENSE file
  13. * in the root directory of this software component.
  14. * If no LICENSE file comes with this software, it is provided AS-IS.
  15. *
  16. ******************************************************************************
  17. */
  18. /* Define to prevent recursive inclusion -------------------------------------*/
  19. #ifndef STM32F7xx_HAL_PCD_H
  20. #define STM32F7xx_HAL_PCD_H
  21. #ifdef __cplusplus
  22. extern "C" {
  23. #endif
  24. /* Includes ------------------------------------------------------------------*/
  25. #include "stm32f7xx_ll_usb.h"
  26. #if defined (USB_OTG_FS) || defined (USB_OTG_HS)
  27. /** @addtogroup STM32F7xx_HAL_Driver
  28. * @{
  29. */
  30. /** @addtogroup PCD
  31. * @{
  32. */
  33. /* Exported types ------------------------------------------------------------*/
  34. /** @defgroup PCD_Exported_Types PCD Exported Types
  35. * @{
  36. */
  37. /**
  38. * @brief PCD State structure definition
  39. */
  40. typedef enum
  41. {
  42. HAL_PCD_STATE_RESET = 0x00,
  43. HAL_PCD_STATE_READY = 0x01,
  44. HAL_PCD_STATE_ERROR = 0x02,
  45. HAL_PCD_STATE_BUSY = 0x03,
  46. HAL_PCD_STATE_TIMEOUT = 0x04
  47. } PCD_StateTypeDef;
  48. /* Device LPM suspend state */
  49. typedef enum
  50. {
  51. LPM_L0 = 0x00, /* on */
  52. LPM_L1 = 0x01, /* LPM L1 sleep */
  53. LPM_L2 = 0x02, /* suspend */
  54. LPM_L3 = 0x03, /* off */
  55. } PCD_LPM_StateTypeDef;
  56. typedef enum
  57. {
  58. PCD_LPM_L0_ACTIVE = 0x00, /* on */
  59. PCD_LPM_L1_ACTIVE = 0x01, /* LPM L1 sleep */
  60. } PCD_LPM_MsgTypeDef;
  61. typedef enum
  62. {
  63. PCD_BCD_ERROR = 0xFF,
  64. PCD_BCD_CONTACT_DETECTION = 0xFE,
  65. PCD_BCD_STD_DOWNSTREAM_PORT = 0xFD,
  66. PCD_BCD_CHARGING_DOWNSTREAM_PORT = 0xFC,
  67. PCD_BCD_DEDICATED_CHARGING_PORT = 0xFB,
  68. PCD_BCD_DISCOVERY_COMPLETED = 0x00,
  69. } PCD_BCD_MsgTypeDef;
  70. #if defined (USB_OTG_FS) || defined (USB_OTG_HS)
  71. typedef USB_OTG_GlobalTypeDef PCD_TypeDef;
  72. typedef USB_OTG_CfgTypeDef PCD_InitTypeDef;
  73. typedef USB_OTG_EPTypeDef PCD_EPTypeDef;
  74. #endif /* defined (USB_OTG_FS) || defined (USB_OTG_HS) */
  75. /**
  76. * @brief PCD Handle Structure definition
  77. */
  78. #if (USE_HAL_PCD_REGISTER_CALLBACKS == 1U)
  79. typedef struct __PCD_HandleTypeDef
  80. #else
  81. typedef struct
  82. #endif /* USE_HAL_PCD_REGISTER_CALLBACKS */
  83. {
  84. PCD_TypeDef *Instance; /*!< Register base address */
  85. PCD_InitTypeDef Init; /*!< PCD required parameters */
  86. __IO uint8_t USB_Address; /*!< USB Address */
  87. PCD_EPTypeDef IN_ep[16]; /*!< IN endpoint parameters */
  88. PCD_EPTypeDef OUT_ep[16]; /*!< OUT endpoint parameters */
  89. HAL_LockTypeDef Lock; /*!< PCD peripheral status */
  90. __IO PCD_StateTypeDef State; /*!< PCD communication state */
  91. __IO uint32_t ErrorCode; /*!< PCD Error code */
  92. uint32_t Setup[12]; /*!< Setup packet buffer */
  93. PCD_LPM_StateTypeDef LPM_State; /*!< LPM State */
  94. uint32_t BESL;
  95. uint32_t FrameNumber; /*!< Store Current Frame number */
  96. uint32_t lpm_active; /*!< Enable or disable the Link Power Management .
  97. This parameter can be set to ENABLE or DISABLE */
  98. void *pData; /*!< Pointer to upper stack Handler */
  99. #if (USE_HAL_PCD_REGISTER_CALLBACKS == 1U)
  100. void (* SOFCallback)(struct __PCD_HandleTypeDef *hpcd); /*!< USB OTG PCD SOF callback */
  101. void (* SetupStageCallback)(struct __PCD_HandleTypeDef *hpcd); /*!< USB OTG PCD Setup Stage callback */
  102. void (* ResetCallback)(struct __PCD_HandleTypeDef *hpcd); /*!< USB OTG PCD Reset callback */
  103. void (* SuspendCallback)(struct __PCD_HandleTypeDef *hpcd); /*!< USB OTG PCD Suspend callback */
  104. void (* ResumeCallback)(struct __PCD_HandleTypeDef *hpcd); /*!< USB OTG PCD Resume callback */
  105. void (* ConnectCallback)(struct __PCD_HandleTypeDef *hpcd); /*!< USB OTG PCD Connect callback */
  106. void (* DisconnectCallback)(struct __PCD_HandleTypeDef *hpcd); /*!< USB OTG PCD Disconnect callback */
  107. void (* DataOutStageCallback)(struct __PCD_HandleTypeDef *hpcd, uint8_t epnum); /*!< USB OTG PCD Data OUT Stage callback */
  108. void (* DataInStageCallback)(struct __PCD_HandleTypeDef *hpcd, uint8_t epnum); /*!< USB OTG PCD Data IN Stage callback */
  109. void (* ISOOUTIncompleteCallback)(struct __PCD_HandleTypeDef *hpcd, uint8_t epnum); /*!< USB OTG PCD ISO OUT Incomplete callback */
  110. void (* ISOINIncompleteCallback)(struct __PCD_HandleTypeDef *hpcd, uint8_t epnum); /*!< USB OTG PCD ISO IN Incomplete callback */
  111. void (* LPMCallback)(struct __PCD_HandleTypeDef *hpcd, PCD_LPM_MsgTypeDef msg); /*!< USB OTG PCD LPM callback */
  112. void (* MspInitCallback)(struct __PCD_HandleTypeDef *hpcd); /*!< USB OTG PCD Msp Init callback */
  113. void (* MspDeInitCallback)(struct __PCD_HandleTypeDef *hpcd); /*!< USB OTG PCD Msp DeInit callback */
  114. #endif /* USE_HAL_PCD_REGISTER_CALLBACKS */
  115. } PCD_HandleTypeDef;
  116. /**
  117. * @}
  118. */
  119. /* Include PCD HAL Extended module */
  120. #include "stm32f7xx_hal_pcd_ex.h"
  121. /* Exported constants --------------------------------------------------------*/
  122. /** @defgroup PCD_Exported_Constants PCD Exported Constants
  123. * @{
  124. */
  125. /** @defgroup PCD_Speed PCD Speed
  126. * @{
  127. */
  128. #define PCD_SPEED_HIGH USBD_HS_SPEED
  129. #define PCD_SPEED_HIGH_IN_FULL USBD_HSINFS_SPEED
  130. #define PCD_SPEED_FULL USBD_FS_SPEED
  131. /**
  132. * @}
  133. */
  134. /** @defgroup PCD_PHY_Module PCD PHY Module
  135. * @{
  136. */
  137. #define PCD_PHY_ULPI 1U
  138. #define PCD_PHY_EMBEDDED 2U
  139. #define PCD_PHY_UTMI 3U
  140. /**
  141. * @}
  142. */
  143. /** @defgroup PCD_Error_Code_definition PCD Error Code definition
  144. * @brief PCD Error Code definition
  145. * @{
  146. */
  147. #if (USE_HAL_PCD_REGISTER_CALLBACKS == 1U)
  148. #define HAL_PCD_ERROR_INVALID_CALLBACK (0x00000010U) /*!< Invalid Callback error */
  149. #endif /* USE_HAL_PCD_REGISTER_CALLBACKS */
  150. /**
  151. * @}
  152. */
  153. /**
  154. * @}
  155. */
  156. /* Exported macros -----------------------------------------------------------*/
  157. /** @defgroup PCD_Exported_Macros PCD Exported Macros
  158. * @brief macros to handle interrupts and specific clock configurations
  159. * @{
  160. */
  161. #if defined (USB_OTG_FS) || defined (USB_OTG_HS)
  162. #define __HAL_PCD_ENABLE(__HANDLE__) (void)USB_EnableGlobalInt ((__HANDLE__)->Instance)
  163. #define __HAL_PCD_DISABLE(__HANDLE__) (void)USB_DisableGlobalInt ((__HANDLE__)->Instance)
  164. #define __HAL_PCD_GET_FLAG(__HANDLE__, __INTERRUPT__) \
  165. ((USB_ReadInterrupts((__HANDLE__)->Instance) & (__INTERRUPT__)) == (__INTERRUPT__))
  166. #define __HAL_PCD_CLEAR_FLAG(__HANDLE__, __INTERRUPT__) (((__HANDLE__)->Instance->GINTSTS) &= (__INTERRUPT__))
  167. #define __HAL_PCD_IS_INVALID_INTERRUPT(__HANDLE__) (USB_ReadInterrupts((__HANDLE__)->Instance) == 0U)
  168. #define __HAL_PCD_UNGATE_PHYCLOCK(__HANDLE__) \
  169. *(__IO uint32_t *)((uint32_t)((__HANDLE__)->Instance) + USB_OTG_PCGCCTL_BASE) &= ~(USB_OTG_PCGCCTL_STOPCLK)
  170. #define __HAL_PCD_GATE_PHYCLOCK(__HANDLE__) \
  171. *(__IO uint32_t *)((uint32_t)((__HANDLE__)->Instance) + USB_OTG_PCGCCTL_BASE) |= USB_OTG_PCGCCTL_STOPCLK
  172. #define __HAL_PCD_IS_PHY_SUSPENDED(__HANDLE__) \
  173. ((*(__IO uint32_t *)((uint32_t)((__HANDLE__)->Instance) + USB_OTG_PCGCCTL_BASE)) & 0x10U)
  174. #define __HAL_USB_OTG_HS_WAKEUP_EXTI_ENABLE_IT() EXTI->IMR |= (USB_OTG_HS_WAKEUP_EXTI_LINE)
  175. #define __HAL_USB_OTG_HS_WAKEUP_EXTI_DISABLE_IT() EXTI->IMR &= ~(USB_OTG_HS_WAKEUP_EXTI_LINE)
  176. #define __HAL_USB_OTG_HS_WAKEUP_EXTI_GET_FLAG() EXTI->PR & (USB_OTG_HS_WAKEUP_EXTI_LINE)
  177. #define __HAL_USB_OTG_HS_WAKEUP_EXTI_CLEAR_FLAG() EXTI->PR = (USB_OTG_HS_WAKEUP_EXTI_LINE)
  178. #define __HAL_USB_OTG_HS_WAKEUP_EXTI_ENABLE_RISING_EDGE() \
  179. do { \
  180. EXTI->FTSR &= ~(USB_OTG_HS_WAKEUP_EXTI_LINE); \
  181. EXTI->RTSR |= USB_OTG_HS_WAKEUP_EXTI_LINE; \
  182. } while(0U)
  183. #define __HAL_USB_OTG_FS_WAKEUP_EXTI_ENABLE_IT() EXTI->IMR |= USB_OTG_FS_WAKEUP_EXTI_LINE
  184. #define __HAL_USB_OTG_FS_WAKEUP_EXTI_DISABLE_IT() EXTI->IMR &= ~(USB_OTG_FS_WAKEUP_EXTI_LINE)
  185. #define __HAL_USB_OTG_FS_WAKEUP_EXTI_GET_FLAG() EXTI->PR & (USB_OTG_FS_WAKEUP_EXTI_LINE)
  186. #define __HAL_USB_OTG_FS_WAKEUP_EXTI_CLEAR_FLAG() EXTI->PR = USB_OTG_FS_WAKEUP_EXTI_LINE
  187. #define __HAL_USB_OTG_FS_WAKEUP_EXTI_ENABLE_RISING_EDGE() \
  188. do { \
  189. EXTI->FTSR &= ~(USB_OTG_FS_WAKEUP_EXTI_LINE); \
  190. EXTI->RTSR |= USB_OTG_FS_WAKEUP_EXTI_LINE; \
  191. } while(0U)
  192. #endif /* defined (USB_OTG_FS) || defined (USB_OTG_HS) */
  193. /**
  194. * @}
  195. */
  196. /* Exported functions --------------------------------------------------------*/
  197. /** @addtogroup PCD_Exported_Functions PCD Exported Functions
  198. * @{
  199. */
  200. /* Initialization/de-initialization functions ********************************/
  201. /** @addtogroup PCD_Exported_Functions_Group1 Initialization and de-initialization functions
  202. * @{
  203. */
  204. HAL_StatusTypeDef HAL_PCD_Init(PCD_HandleTypeDef *hpcd);
  205. HAL_StatusTypeDef HAL_PCD_DeInit(PCD_HandleTypeDef *hpcd);
  206. void HAL_PCD_MspInit(PCD_HandleTypeDef *hpcd);
  207. void HAL_PCD_MspDeInit(PCD_HandleTypeDef *hpcd);
  208. #if (USE_HAL_PCD_REGISTER_CALLBACKS == 1U)
  209. /** @defgroup HAL_PCD_Callback_ID_enumeration_definition HAL USB OTG PCD Callback ID enumeration definition
  210. * @brief HAL USB OTG PCD Callback ID enumeration definition
  211. * @{
  212. */
  213. typedef enum
  214. {
  215. HAL_PCD_SOF_CB_ID = 0x01, /*!< USB PCD SOF callback ID */
  216. HAL_PCD_SETUPSTAGE_CB_ID = 0x02, /*!< USB PCD Setup Stage callback ID */
  217. HAL_PCD_RESET_CB_ID = 0x03, /*!< USB PCD Reset callback ID */
  218. HAL_PCD_SUSPEND_CB_ID = 0x04, /*!< USB PCD Suspend callback ID */
  219. HAL_PCD_RESUME_CB_ID = 0x05, /*!< USB PCD Resume callback ID */
  220. HAL_PCD_CONNECT_CB_ID = 0x06, /*!< USB PCD Connect callback ID */
  221. HAL_PCD_DISCONNECT_CB_ID = 0x07, /*!< USB PCD Disconnect callback ID */
  222. HAL_PCD_MSPINIT_CB_ID = 0x08, /*!< USB PCD MspInit callback ID */
  223. HAL_PCD_MSPDEINIT_CB_ID = 0x09 /*!< USB PCD MspDeInit callback ID */
  224. } HAL_PCD_CallbackIDTypeDef;
  225. /**
  226. * @}
  227. */
  228. /** @defgroup HAL_PCD_Callback_pointer_definition HAL USB OTG PCD Callback pointer definition
  229. * @brief HAL USB OTG PCD Callback pointer definition
  230. * @{
  231. */
  232. typedef void (*pPCD_CallbackTypeDef)(PCD_HandleTypeDef *hpcd); /*!< pointer to a common USB OTG PCD callback function */
  233. typedef void (*pPCD_DataOutStageCallbackTypeDef)(PCD_HandleTypeDef *hpcd, uint8_t epnum); /*!< pointer to USB OTG PCD Data OUT Stage callback */
  234. typedef void (*pPCD_DataInStageCallbackTypeDef)(PCD_HandleTypeDef *hpcd, uint8_t epnum); /*!< pointer to USB OTG PCD Data IN Stage callback */
  235. typedef void (*pPCD_IsoOutIncpltCallbackTypeDef)(PCD_HandleTypeDef *hpcd, uint8_t epnum); /*!< pointer to USB OTG PCD ISO OUT Incomplete callback */
  236. typedef void (*pPCD_IsoInIncpltCallbackTypeDef)(PCD_HandleTypeDef *hpcd, uint8_t epnum); /*!< pointer to USB OTG PCD ISO IN Incomplete callback */
  237. typedef void (*pPCD_LpmCallbackTypeDef)(PCD_HandleTypeDef *hpcd, PCD_LPM_MsgTypeDef msg); /*!< pointer to USB OTG PCD LPM callback */
  238. /**
  239. * @}
  240. */
  241. HAL_StatusTypeDef HAL_PCD_RegisterCallback(PCD_HandleTypeDef *hpcd, HAL_PCD_CallbackIDTypeDef CallbackID,
  242. pPCD_CallbackTypeDef pCallback);
  243. HAL_StatusTypeDef HAL_PCD_UnRegisterCallback(PCD_HandleTypeDef *hpcd, HAL_PCD_CallbackIDTypeDef CallbackID);
  244. HAL_StatusTypeDef HAL_PCD_RegisterDataOutStageCallback(PCD_HandleTypeDef *hpcd,
  245. pPCD_DataOutStageCallbackTypeDef pCallback);
  246. HAL_StatusTypeDef HAL_PCD_UnRegisterDataOutStageCallback(PCD_HandleTypeDef *hpcd);
  247. HAL_StatusTypeDef HAL_PCD_RegisterDataInStageCallback(PCD_HandleTypeDef *hpcd,
  248. pPCD_DataInStageCallbackTypeDef pCallback);
  249. HAL_StatusTypeDef HAL_PCD_UnRegisterDataInStageCallback(PCD_HandleTypeDef *hpcd);
  250. HAL_StatusTypeDef HAL_PCD_RegisterIsoOutIncpltCallback(PCD_HandleTypeDef *hpcd,
  251. pPCD_IsoOutIncpltCallbackTypeDef pCallback);
  252. HAL_StatusTypeDef HAL_PCD_UnRegisterIsoOutIncpltCallback(PCD_HandleTypeDef *hpcd);
  253. HAL_StatusTypeDef HAL_PCD_RegisterIsoInIncpltCallback(PCD_HandleTypeDef *hpcd,
  254. pPCD_IsoInIncpltCallbackTypeDef pCallback);
  255. HAL_StatusTypeDef HAL_PCD_UnRegisterIsoInIncpltCallback(PCD_HandleTypeDef *hpcd);
  256. HAL_StatusTypeDef HAL_PCD_RegisterLpmCallback(PCD_HandleTypeDef *hpcd, pPCD_LpmCallbackTypeDef pCallback);
  257. HAL_StatusTypeDef HAL_PCD_UnRegisterLpmCallback(PCD_HandleTypeDef *hpcd);
  258. #endif /* USE_HAL_PCD_REGISTER_CALLBACKS */
  259. /**
  260. * @}
  261. */
  262. /* I/O operation functions ***************************************************/
  263. /* Non-Blocking mode: Interrupt */
  264. /** @addtogroup PCD_Exported_Functions_Group2 Input and Output operation functions
  265. * @{
  266. */
  267. HAL_StatusTypeDef HAL_PCD_Start(PCD_HandleTypeDef *hpcd);
  268. HAL_StatusTypeDef HAL_PCD_Stop(PCD_HandleTypeDef *hpcd);
  269. void HAL_PCD_IRQHandler(PCD_HandleTypeDef *hpcd);
  270. void HAL_PCD_WKUP_IRQHandler(PCD_HandleTypeDef *hpcd);
  271. void HAL_PCD_SOFCallback(PCD_HandleTypeDef *hpcd);
  272. void HAL_PCD_SetupStageCallback(PCD_HandleTypeDef *hpcd);
  273. void HAL_PCD_ResetCallback(PCD_HandleTypeDef *hpcd);
  274. void HAL_PCD_SuspendCallback(PCD_HandleTypeDef *hpcd);
  275. void HAL_PCD_ResumeCallback(PCD_HandleTypeDef *hpcd);
  276. void HAL_PCD_ConnectCallback(PCD_HandleTypeDef *hpcd);
  277. void HAL_PCD_DisconnectCallback(PCD_HandleTypeDef *hpcd);
  278. void HAL_PCD_DataOutStageCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum);
  279. void HAL_PCD_DataInStageCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum);
  280. void HAL_PCD_ISOOUTIncompleteCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum);
  281. void HAL_PCD_ISOINIncompleteCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum);
  282. /**
  283. * @}
  284. */
  285. /* Peripheral Control functions **********************************************/
  286. /** @addtogroup PCD_Exported_Functions_Group3 Peripheral Control functions
  287. * @{
  288. */
  289. HAL_StatusTypeDef HAL_PCD_DevConnect(PCD_HandleTypeDef *hpcd);
  290. HAL_StatusTypeDef HAL_PCD_DevDisconnect(PCD_HandleTypeDef *hpcd);
  291. HAL_StatusTypeDef HAL_PCD_SetAddress(PCD_HandleTypeDef *hpcd, uint8_t address);
  292. HAL_StatusTypeDef HAL_PCD_EP_Open(PCD_HandleTypeDef *hpcd, uint8_t ep_addr, uint16_t ep_mps, uint8_t ep_type);
  293. HAL_StatusTypeDef HAL_PCD_EP_Close(PCD_HandleTypeDef *hpcd, uint8_t ep_addr);
  294. HAL_StatusTypeDef HAL_PCD_EP_Receive(PCD_HandleTypeDef *hpcd, uint8_t ep_addr, uint8_t *pBuf, uint32_t len);
  295. HAL_StatusTypeDef HAL_PCD_EP_Transmit(PCD_HandleTypeDef *hpcd, uint8_t ep_addr, uint8_t *pBuf, uint32_t len);
  296. HAL_StatusTypeDef HAL_PCD_EP_SetStall(PCD_HandleTypeDef *hpcd, uint8_t ep_addr);
  297. HAL_StatusTypeDef HAL_PCD_EP_ClrStall(PCD_HandleTypeDef *hpcd, uint8_t ep_addr);
  298. HAL_StatusTypeDef HAL_PCD_EP_Flush(PCD_HandleTypeDef *hpcd, uint8_t ep_addr);
  299. HAL_StatusTypeDef HAL_PCD_EP_Abort(PCD_HandleTypeDef *hpcd, uint8_t ep_addr);
  300. HAL_StatusTypeDef HAL_PCD_ActivateRemoteWakeup(PCD_HandleTypeDef *hpcd);
  301. HAL_StatusTypeDef HAL_PCD_DeActivateRemoteWakeup(PCD_HandleTypeDef *hpcd);
  302. HAL_StatusTypeDef HAL_PCD_SetTestMode(PCD_HandleTypeDef *hpcd, uint8_t testmode);
  303. uint32_t HAL_PCD_EP_GetRxCount(PCD_HandleTypeDef *hpcd, uint8_t ep_addr);
  304. /**
  305. * @}
  306. */
  307. /* Peripheral State functions ************************************************/
  308. /** @addtogroup PCD_Exported_Functions_Group4 Peripheral State functions
  309. * @{
  310. */
  311. PCD_StateTypeDef HAL_PCD_GetState(PCD_HandleTypeDef *hpcd);
  312. /**
  313. * @}
  314. */
  315. /**
  316. * @}
  317. */
  318. /* Private constants ---------------------------------------------------------*/
  319. /** @defgroup PCD_Private_Constants PCD Private Constants
  320. * @{
  321. */
  322. /** @defgroup USB_EXTI_Line_Interrupt USB EXTI line interrupt
  323. * @{
  324. */
  325. #if defined (USB_OTG_FS) || defined (USB_OTG_HS)
  326. #define USB_OTG_FS_WAKEUP_EXTI_LINE (0x1U << 18) /*!< USB FS EXTI Line WakeUp Interrupt */
  327. #define USB_OTG_HS_WAKEUP_EXTI_LINE (0x1U << 20) /*!< USB HS EXTI Line WakeUp Interrupt */
  328. #endif /* defined (USB_OTG_FS) || defined (USB_OTG_HS) */
  329. /**
  330. * @}
  331. */
  332. /**
  333. * @}
  334. */
  335. #if defined (USB_OTG_FS) || defined (USB_OTG_HS)
  336. #ifndef USB_OTG_DOEPINT_OTEPSPR
  337. #define USB_OTG_DOEPINT_OTEPSPR (0x1UL << 5) /*!< Status Phase Received interrupt */
  338. #endif /* defined USB_OTG_DOEPINT_OTEPSPR */
  339. #ifndef USB_OTG_DOEPMSK_OTEPSPRM
  340. #define USB_OTG_DOEPMSK_OTEPSPRM (0x1UL << 5) /*!< Setup Packet Received interrupt mask */
  341. #endif /* defined USB_OTG_DOEPMSK_OTEPSPRM */
  342. #ifndef USB_OTG_DOEPINT_NAK
  343. #define USB_OTG_DOEPINT_NAK (0x1UL << 13) /*!< NAK interrupt */
  344. #endif /* defined USB_OTG_DOEPINT_NAK */
  345. #ifndef USB_OTG_DOEPMSK_NAKM
  346. #define USB_OTG_DOEPMSK_NAKM (0x1UL << 13) /*!< OUT Packet NAK interrupt mask */
  347. #endif /* defined USB_OTG_DOEPMSK_NAKM */
  348. #ifndef USB_OTG_DOEPINT_STPKTRX
  349. #define USB_OTG_DOEPINT_STPKTRX (0x1UL << 15) /*!< Setup Packet Received interrupt */
  350. #endif /* defined USB_OTG_DOEPINT_STPKTRX */
  351. #ifndef USB_OTG_DOEPMSK_NYETM
  352. #define USB_OTG_DOEPMSK_NYETM (0x1UL << 14) /*!< Setup Packet Received interrupt mask */
  353. #endif /* defined USB_OTG_DOEPMSK_NYETM */
  354. #endif /* defined (USB_OTG_FS) || defined (USB_OTG_HS) */
  355. /* Private macros ------------------------------------------------------------*/
  356. /** @defgroup PCD_Private_Macros PCD Private Macros
  357. * @{
  358. */
  359. /**
  360. * @}
  361. */
  362. /**
  363. * @}
  364. */
  365. /**
  366. * @}
  367. */
  368. #endif /* defined (USB_OTG_FS) || defined (USB_OTG_HS) */
  369. #ifdef __cplusplus
  370. }
  371. #endif
  372. #endif /* STM32F7xx_HAL_PCD_H */