stm32f7xx_ll_usb.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493
  1. /**
  2. ******************************************************************************
  3. * @file stm32f7xx_ll_usb.h
  4. * @author MCD Application Team
  5. * @brief Header file of USB Low Layer HAL module.
  6. ******************************************************************************
  7. * @attention
  8. *
  9. * <h2><center>&copy; COPYRIGHT(c) 2017 STMicroelectronics</center></h2>
  10. *
  11. * Redistribution and use in source and binary forms, with or without modification,
  12. * are permitted provided that the following conditions are met:
  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.
  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
  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. *
  33. ******************************************************************************
  34. */
  35. /* Define to prevent recursive inclusion -------------------------------------*/
  36. #ifndef __STM32F7xx_LL_USB_H
  37. #define __STM32F7xx_LL_USB_H
  38. #ifdef __cplusplus
  39. extern "C" {
  40. #endif
  41. /* Includes ------------------------------------------------------------------*/
  42. #include "stm32f7xx_hal_def.h"
  43. /** @addtogroup STM32F7xx_HAL_Driver
  44. * @{
  45. */
  46. /** @addtogroup USB_LL
  47. * @{
  48. */
  49. /* Exported types ------------------------------------------------------------*/
  50. /**
  51. * @brief USB Mode definition
  52. */
  53. typedef enum
  54. {
  55. USB_DEVICE_MODE = 0,
  56. USB_HOST_MODE = 1,
  57. USB_DRD_MODE = 2
  58. }USB_OTG_ModeTypeDef;
  59. #if defined (USB_OTG_FS) || defined (USB_OTG_HS)
  60. /**
  61. * @brief URB States definition
  62. */
  63. typedef enum {
  64. URB_IDLE = 0,
  65. URB_DONE,
  66. URB_NOTREADY,
  67. URB_NYET,
  68. URB_ERROR,
  69. URB_STALL
  70. }USB_OTG_URBStateTypeDef;
  71. /**
  72. * @brief Host channel States definition
  73. */
  74. typedef enum {
  75. HC_IDLE = 0,
  76. HC_XFRC,
  77. HC_HALTED,
  78. HC_NAK,
  79. HC_NYET,
  80. HC_STALL,
  81. HC_XACTERR,
  82. HC_BBLERR,
  83. HC_DATATGLERR
  84. }USB_OTG_HCStateTypeDef;
  85. /**
  86. * @brief USB OTG Initialization Structure definition
  87. */
  88. typedef struct
  89. {
  90. uint32_t dev_endpoints; /*!< Device Endpoints number.
  91. This parameter depends on the used USB core.
  92. This parameter must be a number between Min_Data = 1 and Max_Data = 15 */
  93. uint32_t Host_channels; /*!< Host Channels number.
  94. This parameter Depends on the used USB core.
  95. This parameter must be a number between Min_Data = 1 and Max_Data = 15 */
  96. uint32_t speed; /*!< USB Core speed.
  97. This parameter can be any value of @ref USB_Core_Speed_ */
  98. uint32_t dma_enable; /*!< Enable or disable of the USB embedded DMA used only for OTG HS. */
  99. uint32_t ep0_mps; /*!< Set the Endpoint 0 Max Packet size.
  100. This parameter can be any value of @ref USB_EP0_MPS_ */
  101. uint32_t phy_itface; /*!< Select the used PHY interface.
  102. This parameter can be any value of @ref USB_Core_PHY_ */
  103. uint32_t Sof_enable; /*!< Enable or disable the output of the SOF signal. */
  104. uint32_t low_power_enable; /*!< Enable or disable the low power mode. */
  105. uint32_t lpm_enable; /*!< Enable or disable Link Power Management. */
  106. uint32_t battery_charging_enable; /*!< Enable or disable Battery charging. */
  107. uint32_t vbus_sensing_enable; /*!< Enable or disable the VBUS Sensing feature. */
  108. uint32_t use_dedicated_ep1; /*!< Enable or disable the use of the dedicated EP1 interrupt. */
  109. uint32_t use_external_vbus; /*!< Enable or disable the use of the external VBUS. */
  110. }USB_OTG_CfgTypeDef;
  111. typedef struct
  112. {
  113. uint8_t num; /*!< Endpoint number
  114. This parameter must be a number between Min_Data = 1 and Max_Data = 15 */
  115. uint8_t is_in; /*!< Endpoint direction
  116. This parameter must be a number between Min_Data = 0 and Max_Data = 1 */
  117. uint8_t is_stall; /*!< Endpoint stall condition
  118. This parameter must be a number between Min_Data = 0 and Max_Data = 1 */
  119. uint8_t type; /*!< Endpoint type
  120. This parameter can be any value of @ref USB_EP_Type_ */
  121. uint8_t data_pid_start; /*!< Initial data PID
  122. This parameter must be a number between Min_Data = 0 and Max_Data = 1 */
  123. uint8_t even_odd_frame; /*!< IFrame parity
  124. This parameter must be a number between Min_Data = 0 and Max_Data = 1 */
  125. uint16_t tx_fifo_num; /*!< Transmission FIFO number
  126. This parameter must be a number between Min_Data = 1 and Max_Data = 15 */
  127. uint32_t maxpacket; /*!< Endpoint Max packet size
  128. This parameter must be a number between Min_Data = 0 and Max_Data = 64KB */
  129. uint8_t *xfer_buff; /*!< Pointer to transfer buffer */
  130. uint32_t dma_addr; /*!< 32 bits aligned transfer buffer address */
  131. uint32_t xfer_len; /*!< Current transfer length */
  132. uint32_t xfer_count; /*!< Partial transfer length in case of multi packet transfer */
  133. }USB_OTG_EPTypeDef;
  134. typedef struct
  135. {
  136. uint8_t dev_addr ; /*!< USB device address.
  137. This parameter must be a number between Min_Data = 1 and Max_Data = 255 */
  138. uint8_t ch_num; /*!< Host channel number.
  139. This parameter must be a number between Min_Data = 1 and Max_Data = 15 */
  140. uint8_t ep_num; /*!< Endpoint number.
  141. This parameter must be a number between Min_Data = 1 and Max_Data = 15 */
  142. uint8_t ep_is_in; /*!< Endpoint direction
  143. This parameter must be a number between Min_Data = 0 and Max_Data = 1 */
  144. uint8_t speed; /*!< USB Host speed.
  145. This parameter can be any value of @ref USB_Core_Speed_ */
  146. uint8_t do_ping; /*!< Enable or disable the use of the PING protocol for HS mode. */
  147. uint8_t process_ping; /*!< Execute the PING protocol for HS mode. */
  148. uint8_t ep_type; /*!< Endpoint Type.
  149. This parameter can be any value of @ref USB_EP_Type_ */
  150. uint16_t max_packet; /*!< Endpoint Max packet size.
  151. This parameter must be a number between Min_Data = 0 and Max_Data = 64KB */
  152. uint8_t data_pid; /*!< Initial data PID.
  153. This parameter must be a number between Min_Data = 0 and Max_Data = 1 */
  154. uint8_t *xfer_buff; /*!< Pointer to transfer buffer. */
  155. uint32_t xfer_len; /*!< Current transfer length. */
  156. uint32_t xfer_count; /*!< Partial transfer length in case of multi packet transfer. */
  157. uint8_t toggle_in; /*!< IN transfer current toggle flag.
  158. This parameter must be a number between Min_Data = 0 and Max_Data = 1 */
  159. uint8_t toggle_out; /*!< OUT transfer current toggle flag
  160. This parameter must be a number between Min_Data = 0 and Max_Data = 1 */
  161. uint32_t dma_addr; /*!< 32 bits aligned transfer buffer address. */
  162. uint32_t ErrCnt; /*!< Host channel error count.*/
  163. USB_OTG_URBStateTypeDef urb_state; /*!< URB state.
  164. This parameter can be any value of @ref USB_OTG_URBStateTypeDef */
  165. USB_OTG_HCStateTypeDef state; /*!< Host Channel state.
  166. This parameter can be any value of @ref USB_OTG_HCStateTypeDef */
  167. }USB_OTG_HCTypeDef;
  168. #endif /* defined USB_OTG_FS || USB_OTG_HS */
  169. /* Exported constants --------------------------------------------------------*/
  170. /** @defgroup PCD_Exported_Constants PCD Exported Constants
  171. * @{
  172. */
  173. #if defined (USB_OTG_FS) || defined (USB_OTG_HS)
  174. /** @defgroup USB_Core_Mode_ USB Core Mode
  175. * @{
  176. */
  177. #define USB_OTG_MODE_DEVICE 0U
  178. #define USB_OTG_MODE_HOST 1U
  179. #define USB_OTG_MODE_DRD 2U
  180. /**
  181. * @}
  182. */
  183. /** @defgroup USB_LL_Core_Speed USB Low Layer Core Speed
  184. * @{
  185. */
  186. #define USB_OTG_SPEED_HIGH 0U
  187. #define USB_OTG_SPEED_HIGH_IN_FULL 1U
  188. #define USB_OTG_SPEED_LOW 2U
  189. #define USB_OTG_SPEED_FULL 3U
  190. /**
  191. * @}
  192. */
  193. /** @defgroup USB_LL_Core_PHY USB Low Layer Core PHY
  194. * @{
  195. */
  196. #define USB_OTG_ULPI_PHY 1U
  197. #define USB_OTG_EMBEDDED_PHY 2U
  198. #define USB_OTG_HS_EMBEDDED_PHY 3U
  199. #if !defined (USB_HS_PHYC_TUNE_VALUE)
  200. #define USB_HS_PHYC_TUNE_VALUE 0x00000F13U /*!< Value of USB HS PHY Tune */
  201. #endif /* USB_HS_PHYC_TUNE_VALUE */
  202. /**
  203. * @}
  204. */
  205. /** @defgroup USB_LL_Core_MPS USB Low Layer Core MPS
  206. * @{
  207. */
  208. #define USB_OTG_HS_MAX_PACKET_SIZE 512U
  209. #define USB_OTG_FS_MAX_PACKET_SIZE 64U
  210. #define USB_OTG_MAX_EP0_SIZE 64U
  211. /**
  212. * @}
  213. */
  214. /** @defgroup USB_LL_Core_PHY_Frequency USB Low Layer Core PHY Frequency
  215. * @{
  216. */
  217. #define DSTS_ENUMSPD_HS_PHY_30MHZ_OR_60MHZ (0U << 1)
  218. #define DSTS_ENUMSPD_FS_PHY_30MHZ_OR_60MHZ (1U << 1)
  219. #define DSTS_ENUMSPD_LS_PHY_6MHZ (2U << 1)
  220. #define DSTS_ENUMSPD_FS_PHY_48MHZ (3U << 1)
  221. /**
  222. * @}
  223. */
  224. /** @defgroup USB_LL_CORE_Frame_Interval USB Low Layer Core Frame Interval
  225. * @{
  226. */
  227. #define DCFG_FRAME_INTERVAL_80 0U
  228. #define DCFG_FRAME_INTERVAL_85 1U
  229. #define DCFG_FRAME_INTERVAL_90 2U
  230. #define DCFG_FRAME_INTERVAL_95 3U
  231. /**
  232. * @}
  233. */
  234. /** @defgroup USB_LL_EP0_MPS USB Low Layer EP0 MPS
  235. * @{
  236. */
  237. #define DEP0CTL_MPS_64 0U
  238. #define DEP0CTL_MPS_32 1U
  239. #define DEP0CTL_MPS_16 2U
  240. #define DEP0CTL_MPS_8 3U
  241. /**
  242. * @}
  243. */
  244. /** @defgroup USB_LL_EP_Speed USB Low Layer EP Speed
  245. * @{
  246. */
  247. #define EP_SPEED_LOW 0U
  248. #define EP_SPEED_FULL 1U
  249. #define EP_SPEED_HIGH 2U
  250. /**
  251. * @}
  252. */
  253. /** @defgroup USB_LL_EP_Type USB Low Layer EP Type
  254. * @{
  255. */
  256. #define EP_TYPE_CTRL 0U
  257. #define EP_TYPE_ISOC 1U
  258. #define EP_TYPE_BULK 2U
  259. #define EP_TYPE_INTR 3U
  260. #define EP_TYPE_MSK 3U
  261. /**
  262. * @}
  263. */
  264. /** @defgroup USB_LL_STS_Defines USB Low Layer STS Defines
  265. * @{
  266. */
  267. #define STS_GOUT_NAK 1U
  268. #define STS_DATA_UPDT 2U
  269. #define STS_XFER_COMP 3U
  270. #define STS_SETUP_COMP 4U
  271. #define STS_SETUP_UPDT 6U
  272. /**
  273. * @}
  274. */
  275. /** @defgroup USB_LL_HCFG_SPEED_Defines USB Low Layer HCFG Speed Defines
  276. * @{
  277. */
  278. #define HCFG_30_60_MHZ 0U
  279. #define HCFG_48_MHZ 1U
  280. #define HCFG_6_MHZ 2U
  281. /**
  282. * @}
  283. */
  284. /** @defgroup USB_LL_HPRT0_PRTSPD_SPEED_Defines USB Low Layer HPRT0 PRTSPD Speed Defines
  285. * @{
  286. */
  287. #define HPRT0_PRTSPD_HIGH_SPEED 0U
  288. #define HPRT0_PRTSPD_FULL_SPEED 1U
  289. #define HPRT0_PRTSPD_LOW_SPEED 2U
  290. /**
  291. * @}
  292. */
  293. #define HCCHAR_CTRL 0U
  294. #define HCCHAR_ISOC 1U
  295. #define HCCHAR_BULK 2U
  296. #define HCCHAR_INTR 3U
  297. #define HC_PID_DATA0 0U
  298. #define HC_PID_DATA2 1U
  299. #define HC_PID_DATA1 2U
  300. #define HC_PID_SETUP 3U
  301. #define GRXSTS_PKTSTS_IN 2U
  302. #define GRXSTS_PKTSTS_IN_XFER_COMP 3U
  303. #define GRXSTS_PKTSTS_DATA_TOGGLE_ERR 5U
  304. #define GRXSTS_PKTSTS_CH_HALTED 7U
  305. #define USBx_PCGCCTL *(__IO uint32_t *)((uint32_t)USBx_BASE + USB_OTG_PCGCCTL_BASE)
  306. #define USBx_HPRT0 *(__IO uint32_t *)((uint32_t)USBx_BASE + USB_OTG_HOST_PORT_BASE)
  307. #define USBx_DEVICE ((USB_OTG_DeviceTypeDef *)(USBx_BASE + USB_OTG_DEVICE_BASE))
  308. #define USBx_INEP(i) ((USB_OTG_INEndpointTypeDef *)(USBx_BASE + USB_OTG_IN_ENDPOINT_BASE + ((i) * USB_OTG_EP_REG_SIZE)))
  309. #define USBx_OUTEP(i) ((USB_OTG_OUTEndpointTypeDef *)(USBx_BASE + USB_OTG_OUT_ENDPOINT_BASE + ((i) * USB_OTG_EP_REG_SIZE)))
  310. #define USBx_DFIFO(i) *(__IO uint32_t *)(USBx_BASE + USB_OTG_FIFO_BASE + ((i) * USB_OTG_FIFO_SIZE))
  311. #define USBx_HOST ((USB_OTG_HostTypeDef *)(USBx_BASE + USB_OTG_HOST_BASE))
  312. #define USBx_HC(i) ((USB_OTG_HostChannelTypeDef *)(USBx_BASE + USB_OTG_HOST_CHANNEL_BASE + ((i) * USB_OTG_HOST_CHANNEL_SIZE)))
  313. #define USBPHYC ((USBPHYC_GlobalTypeDef *)((uint32_t )USB_PHY_HS_CONTROLLER_BASE))
  314. #endif /* USB_OTG_FS || USB_OTG_HS */
  315. /**
  316. * @}
  317. */
  318. /* Exported macro ------------------------------------------------------------*/
  319. /** @defgroup USB_LL_Exported_Macros USB Low Layer Exported Macros
  320. * @{
  321. */
  322. #if defined (USB_OTG_FS) || defined (USB_OTG_HS)
  323. #define USB_MASK_INTERRUPT(__INSTANCE__, __INTERRUPT__) ((__INSTANCE__)->GINTMSK &= ~(__INTERRUPT__))
  324. #define USB_UNMASK_INTERRUPT(__INSTANCE__, __INTERRUPT__) ((__INSTANCE__)->GINTMSK |= (__INTERRUPT__))
  325. #define CLEAR_IN_EP_INTR(__EPNUM__, __INTERRUPT__) (USBx_INEP(__EPNUM__)->DIEPINT = (__INTERRUPT__))
  326. #define CLEAR_OUT_EP_INTR(__EPNUM__, __INTERRUPT__) (USBx_OUTEP(__EPNUM__)->DOEPINT = (__INTERRUPT__))
  327. #endif /* USB_OTG_FS || USB_OTG_HS */
  328. /**
  329. * @}
  330. */
  331. /* Exported functions --------------------------------------------------------*/
  332. /** @addtogroup USB_LL_Exported_Functions USB Low Layer Exported Functions
  333. * @{
  334. */
  335. #if defined (USB_OTG_FS) || defined (USB_OTG_HS)
  336. HAL_StatusTypeDef USB_CoreInit(USB_OTG_GlobalTypeDef *USBx, USB_OTG_CfgTypeDef Init);
  337. HAL_StatusTypeDef USB_DevInit(USB_OTG_GlobalTypeDef *USBx, USB_OTG_CfgTypeDef Init);
  338. HAL_StatusTypeDef USB_EnableGlobalInt(USB_OTG_GlobalTypeDef *USBx);
  339. HAL_StatusTypeDef USB_DisableGlobalInt(USB_OTG_GlobalTypeDef *USBx);
  340. HAL_StatusTypeDef USB_SetCurrentMode(USB_OTG_GlobalTypeDef *USBx , USB_OTG_ModeTypeDef mode);
  341. HAL_StatusTypeDef USB_SetDevSpeed(USB_OTG_GlobalTypeDef *USBx , uint8_t speed);
  342. HAL_StatusTypeDef USB_FlushRxFifo (USB_OTG_GlobalTypeDef *USBx);
  343. HAL_StatusTypeDef USB_FlushTxFifo (USB_OTG_GlobalTypeDef *USBx, uint32_t num);
  344. HAL_StatusTypeDef USB_ActivateEndpoint(USB_OTG_GlobalTypeDef *USBx, USB_OTG_EPTypeDef *ep);
  345. HAL_StatusTypeDef USB_DeactivateEndpoint(USB_OTG_GlobalTypeDef *USBx, USB_OTG_EPTypeDef *ep);
  346. HAL_StatusTypeDef USB_ActivateDedicatedEndpoint(USB_OTG_GlobalTypeDef *USBx, USB_OTG_EPTypeDef *ep);
  347. HAL_StatusTypeDef USB_DeactivateDedicatedEndpoint(USB_OTG_GlobalTypeDef *USBx, USB_OTG_EPTypeDef *ep);
  348. HAL_StatusTypeDef USB_EPStartXfer(USB_OTG_GlobalTypeDef *USBx , USB_OTG_EPTypeDef *ep, uint8_t dma);
  349. HAL_StatusTypeDef USB_EP0StartXfer(USB_OTG_GlobalTypeDef *USBx , USB_OTG_EPTypeDef *ep, uint8_t dma);
  350. HAL_StatusTypeDef USB_WritePacket(USB_OTG_GlobalTypeDef *USBx, uint8_t *src, uint8_t ch_ep_num, uint16_t len, uint8_t dma);
  351. void * USB_ReadPacket(USB_OTG_GlobalTypeDef *USBx, uint8_t *dest, uint16_t len);
  352. HAL_StatusTypeDef USB_EPSetStall(USB_OTG_GlobalTypeDef *USBx , USB_OTG_EPTypeDef *ep);
  353. HAL_StatusTypeDef USB_EPClearStall(USB_OTG_GlobalTypeDef *USBx , USB_OTG_EPTypeDef *ep);
  354. HAL_StatusTypeDef USB_SetDevAddress (USB_OTG_GlobalTypeDef *USBx, uint8_t address);
  355. HAL_StatusTypeDef USB_DevConnect (USB_OTG_GlobalTypeDef *USBx);
  356. HAL_StatusTypeDef USB_DevDisconnect (USB_OTG_GlobalTypeDef *USBx);
  357. HAL_StatusTypeDef USB_StopDevice(USB_OTG_GlobalTypeDef *USBx);
  358. HAL_StatusTypeDef USB_ActivateSetup (USB_OTG_GlobalTypeDef *USBx);
  359. HAL_StatusTypeDef USB_EP0_OutStart(USB_OTG_GlobalTypeDef *USBx, uint8_t dma, uint8_t *psetup);
  360. uint8_t USB_GetDevSpeed(USB_OTG_GlobalTypeDef *USBx);
  361. uint32_t USB_GetMode(USB_OTG_GlobalTypeDef *USBx);
  362. uint32_t USB_ReadInterrupts (USB_OTG_GlobalTypeDef *USBx);
  363. uint32_t USB_ReadDevAllOutEpInterrupt (USB_OTG_GlobalTypeDef *USBx);
  364. uint32_t USB_ReadDevOutEPInterrupt (USB_OTG_GlobalTypeDef *USBx , uint8_t epnum);
  365. uint32_t USB_ReadDevAllInEpInterrupt (USB_OTG_GlobalTypeDef *USBx);
  366. uint32_t USB_ReadDevInEPInterrupt (USB_OTG_GlobalTypeDef *USBx , uint8_t epnum);
  367. void USB_ClearInterrupts (USB_OTG_GlobalTypeDef *USBx, uint32_t interrupt);
  368. HAL_StatusTypeDef USB_HostInit (USB_OTG_GlobalTypeDef *USBx, USB_OTG_CfgTypeDef cfg);
  369. HAL_StatusTypeDef USB_InitFSLSPClkSel(USB_OTG_GlobalTypeDef *USBx , uint8_t freq);
  370. HAL_StatusTypeDef USB_ResetPort(USB_OTG_GlobalTypeDef *USBx);
  371. HAL_StatusTypeDef USB_DriveVbus (USB_OTG_GlobalTypeDef *USBx, uint8_t state);
  372. uint32_t USB_GetHostSpeed (USB_OTG_GlobalTypeDef *USBx);
  373. uint32_t USB_GetCurrentFrame (USB_OTG_GlobalTypeDef *USBx);
  374. HAL_StatusTypeDef USB_HC_Init(USB_OTG_GlobalTypeDef *USBx,
  375. uint8_t ch_num,
  376. uint8_t epnum,
  377. uint8_t dev_address,
  378. uint8_t speed,
  379. uint8_t ep_type,
  380. uint16_t mps);
  381. HAL_StatusTypeDef USB_HC_StartXfer(USB_OTG_GlobalTypeDef *USBx, USB_OTG_HCTypeDef *hc, uint8_t dma);
  382. uint32_t USB_HC_ReadInterrupt (USB_OTG_GlobalTypeDef *USBx);
  383. HAL_StatusTypeDef USB_HC_Halt(USB_OTG_GlobalTypeDef *USBx , uint8_t hc_num);
  384. HAL_StatusTypeDef USB_DoPing(USB_OTG_GlobalTypeDef *USBx , uint8_t ch_num);
  385. HAL_StatusTypeDef USB_StopHost(USB_OTG_GlobalTypeDef *USBx);
  386. HAL_StatusTypeDef USB_ActivateRemoteWakeup(USB_OTG_GlobalTypeDef *USBx);
  387. HAL_StatusTypeDef USB_DeActivateRemoteWakeup(USB_OTG_GlobalTypeDef *USBx);
  388. #endif /* USB_OTG_FS || USB_OTG_HS */
  389. /**
  390. * @}
  391. */
  392. /**
  393. * @}
  394. */
  395. /**
  396. * @}
  397. */
  398. /**
  399. * @}
  400. */
  401. #ifdef __cplusplus
  402. }
  403. #endif
  404. #endif /* __STM32F7xx_LL_USB_H */
  405. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/