STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
stm32h7xx_ll_usb.h
Go to the documentation of this file.
1/**
2 ******************************************************************************
3 * @file stm32h7xx_ll_usb.h
4 * @author MCD Application Team
5 * @brief Header file of USB Low Layer 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
19/* Define to prevent recursive inclusion -------------------------------------*/
20#ifndef STM32H7xx_LL_USB_H
21#define STM32H7xx_LL_USB_H
22
23#ifdef __cplusplus
24extern "C" {
25#endif /* __cplusplus */
26
27/* Includes ------------------------------------------------------------------*/
28#include "stm32h7xx_hal_def.h"
29
30#if defined (USB_OTG_FS) || defined (USB_OTG_HS)
31/** @addtogroup STM32H7xx_HAL_Driver
32 * @{
33 */
34
35/** @addtogroup USB_LL
36 * @{
37 */
38
39/* Exported types ------------------------------------------------------------*/
40#ifndef HAL_USB_TIMEOUT
41#define HAL_USB_TIMEOUT 0xF000000U
42#endif /* define HAL_USB_TIMEOUT */
43
44#ifndef HAL_USB_CURRENT_MODE_MAX_DELAY_MS
45#define HAL_USB_CURRENT_MODE_MAX_DELAY_MS 200U
46#endif /* define HAL_USB_CURRENT_MODE_MAX_DELAY_MS */
47
48/**
49 * @brief USB Mode definition
50 */
51
52typedef enum
53{
54 USB_DEVICE_MODE = 0,
55 USB_HOST_MODE = 1,
56 USB_DRD_MODE = 2
57} USB_ModeTypeDef;
58
59#if defined (HAL_HCD_MODULE_ENABLED)
60/**
61 * @brief URB States definition
62 */
63typedef enum
64{
65 URB_IDLE = 0,
66 URB_DONE,
67 URB_NOTREADY,
68 URB_NYET,
69 URB_ERROR,
70 URB_STALL,
71 URB_NAK_WAIT
72} USB_URBStateTypeDef;
73
74/**
75 * @brief Host channel States definition
76 */
77typedef enum
78{
79 HC_IDLE = 0,
80 HC_XFRC,
81 HC_HALTED,
82 HC_ACK,
83 HC_NAK,
84 HC_NYET,
85 HC_STALL,
86 HC_XACTERR,
87 HC_BBLERR,
88 HC_DATATGLERR
89} USB_HCStateTypeDef;
90#endif /* defined (HAL_HCD_MODULE_ENABLED) */
91
92
93/**
94 * @brief USB Instance Initialization Structure definition
95 */
96typedef struct
97{
98 uint8_t dev_endpoints; /*!< Device Endpoints number.
99 This parameter depends on the used USB core.
100 This parameter must be a number between Min_Data = 1 and Max_Data = 15 */
101
102 uint8_t Host_channels; /*!< Host Channels number.
103 This parameter Depends on the used USB core.
104 This parameter must be a number between Min_Data = 1 and Max_Data = 15 */
105
106 uint8_t dma_enable; /*!< USB DMA state.
107 If DMA is not supported this parameter shall be set by default to zero */
108
109 uint8_t speed; /*!< USB Core speed.
110 This parameter can be any value of @ref PCD_Speed/HCD_Speed
111 (HCD_SPEED_xxx, HCD_SPEED_xxx) */
112
113 uint8_t ep0_mps; /*!< Set the Endpoint 0 Max Packet size. */
114
115 uint8_t phy_itface; /*!< Select the used PHY interface.
116 This parameter can be any value of @ref PCD_PHY_Module/HCD_PHY_Module */
117
118 uint8_t Sof_enable; /*!< Enable or disable the output of the SOF signal. */
119
120 uint8_t low_power_enable; /*!< Enable or disable the low Power Mode. */
121
122 uint8_t lpm_enable; /*!< Enable or disable Link Power Management. */
123
124 uint8_t battery_charging_enable; /*!< Enable or disable Battery charging. */
125
126 uint8_t vbus_sensing_enable; /*!< Enable or disable the VBUS Sensing feature. */
127
128 uint8_t use_dedicated_ep1; /*!< Enable or disable the use of the dedicated EP1 interrupt. */
129
130 uint8_t use_external_vbus; /*!< Enable or disable the use of the external VBUS. */
131
132} USB_CfgTypeDef;
133
134#if defined (HAL_PCD_MODULE_ENABLED)
135typedef struct
136{
137 uint8_t num; /*!< Endpoint number
138 This parameter must be a number between Min_Data = 1 and Max_Data = 15 */
139
140 uint8_t is_in; /*!< Endpoint direction
141 This parameter must be a number between Min_Data = 0 and Max_Data = 1 */
142
143 uint8_t is_stall; /*!< Endpoint stall condition
144 This parameter must be a number between Min_Data = 0 and Max_Data = 1 */
145
146 uint8_t is_iso_incomplete; /*!< Endpoint isoc condition
147 This parameter must be a number between Min_Data = 0 and Max_Data = 1 */
148
149 uint8_t type; /*!< Endpoint type
150 This parameter can be any value of @ref USB_LL_EP_Type */
151
152 uint8_t data_pid_start; /*!< Initial data PID
153 This parameter must be a number between Min_Data = 0 and Max_Data = 1 */
154
155 uint32_t maxpacket; /*!< Endpoint Max packet size
156 This parameter must be a number between Min_Data = 0 and Max_Data = 64KB */
157
158 uint8_t *xfer_buff; /*!< Pointer to transfer buffer */
159
160 uint32_t xfer_len; /*!< Current transfer length */
161
162 uint32_t xfer_count; /*!< Partial transfer length in case of multi packet transfer */
163
164 uint8_t even_odd_frame; /*!< IFrame parity
165 This parameter must be a number between Min_Data = 0 and Max_Data = 1 */
166
167 uint16_t tx_fifo_num; /*!< Transmission FIFO number
168 This parameter must be a number between Min_Data = 1 and Max_Data = 15 */
169
170 uint32_t dma_addr; /*!< 32 bits aligned transfer buffer address */
171
172 uint32_t xfer_size; /*!< requested transfer size */
173} USB_EPTypeDef;
174#endif /* defined (HAL_PCD_MODULE_ENABLED) */
175
176#if defined (HAL_HCD_MODULE_ENABLED)
177typedef struct
178{
179 uint8_t dev_addr; /*!< USB device address.
180 This parameter must be a number between Min_Data = 1 and Max_Data = 255 */
181
182 uint8_t ch_num; /*!< Host channel number.
183 This parameter must be a number between Min_Data = 1 and Max_Data = 15 */
184
185 uint8_t ep_num; /*!< Endpoint number.
186 This parameter must be a number between Min_Data = 1 and Max_Data = 15 */
187
188 uint8_t ep_is_in; /*!< Endpoint direction
189 This parameter must be a number between Min_Data = 0 and Max_Data = 1 */
190
191 uint8_t ch_dir; /*!< channel direction
192 This parameter store the physical channel direction IN/OUT/BIDIR */
193
194 uint8_t speed; /*!< USB Host Channel speed.
195 This parameter can be any value of @ref HCD_Device_Speed:
196 (HCD_DEVICE_SPEED_xxx) */
197
198 uint8_t do_ping; /*!< Enable or disable the use of the PING protocol for HS mode. */
199 uint8_t do_ssplit; /*!< Enable start split transaction in HS mode. */
200 uint8_t do_csplit; /*!< Enable complete split transaction in HS mode. */
201 uint8_t ep_ss_schedule; /*!< Enable periodic endpoint start split schedule . */
202 uint32_t iso_splt_xactPos; /*!< iso split transfer transaction position. */
203
204 uint8_t hub_port_nbr; /*!< USB HUB port number */
205 uint8_t hub_addr; /*!< USB HUB address */
206
207 uint8_t ep_type; /*!< Endpoint Type.
208 This parameter can be any value of @ref USB_LL_EP_Type */
209
210 uint16_t max_packet; /*!< Endpoint Max packet size.
211 This parameter must be a number between Min_Data = 0 and Max_Data = 64KB */
212
213 uint8_t data_pid; /*!< Initial data PID.
214 This parameter must be a number between Min_Data = 0 and Max_Data = 1 */
215
216 uint8_t *xfer_buff; /*!< Pointer to transfer buffer. */
217
218 uint32_t XferSize; /*!< OTG Channel transfer size. */
219
220 uint32_t xfer_len; /*!< Current transfer length. */
221
222 uint32_t xfer_count; /*!< Partial transfer length in case of multi packet transfer. */
223
224 uint8_t toggle_in; /*!< IN transfer current toggle flag.
225 This parameter must be a number between Min_Data = 0 and Max_Data = 1 */
226
227 uint8_t toggle_out; /*!< OUT transfer current toggle flag
228 This parameter must be a number between Min_Data = 0 and Max_Data = 1 */
229
230 uint32_t dma_addr; /*!< 32 bits aligned transfer buffer address. */
231
232 uint32_t NakCnt; /*!< Host channel NAK count. */
233
234 uint32_t ErrCnt; /*!< Host channel error count. */
235 uint32_t NyetErrCnt; /*!< Complete Split NYET Host channel error count. */
236
237 USB_URBStateTypeDef urb_state; /*!< URB state.
238 This parameter can be any value of @ref USB_URBStateTypeDef */
239
240 USB_HCStateTypeDef state; /*!< Host Channel state.
241 This parameter can be any value of @ref USB_HCStateTypeDef */
242} USB_HCTypeDef;
243#endif /* defined (HAL_HCD_MODULE_ENABLED) */
244
245typedef USB_ModeTypeDef USB_OTG_ModeTypeDef;
246typedef USB_CfgTypeDef USB_OTG_CfgTypeDef;
247
248#if defined (HAL_PCD_MODULE_ENABLED)
249typedef USB_EPTypeDef USB_OTG_EPTypeDef;
250#endif /* defined (HAL_PCD_MODULE_ENABLED) */
251
252#if defined (HAL_HCD_MODULE_ENABLED)
253typedef USB_URBStateTypeDef USB_OTG_URBStateTypeDef;
254typedef USB_HCStateTypeDef USB_OTG_HCStateTypeDef;
255typedef USB_HCTypeDef USB_OTG_HCTypeDef;
256#endif /* defined (HAL_HCD_MODULE_ENABLED) */
257
258/* Exported constants --------------------------------------------------------*/
259
260/** @defgroup PCD_Exported_Constants PCD Exported Constants
261 * @{
262 */
263
264#if defined (USB_OTG_FS) || defined (USB_OTG_HS)
265/** @defgroup USB_OTG_CORE VERSION ID
266 * @{
267 */
268#define USB_OTG_CORE_ID_300A 0x4F54300AU
269#define USB_OTG_CORE_ID_310A 0x4F54310AU
270/**
271 * @}
272 */
273
274/** @defgroup USB_Core_Mode_ USB Core Mode
275 * @{
276 */
277#define USB_OTG_MODE_DEVICE 0U
278#define USB_OTG_MODE_HOST 1U
279#define USB_OTG_MODE_DRD 2U
280/**
281 * @}
282 */
283
284/** @defgroup USB_LL_Core_Speed USB Low Layer Core Speed
285 * @{
286 */
287#define USB_OTG_SPEED_HIGH 0U
288#define USB_OTG_SPEED_HIGH_IN_FULL 1U
289#define USB_OTG_SPEED_FULL 3U
290/**
291 * @}
292 */
293
294/** @defgroup USB_LL_Core_PHY USB Low Layer Core PHY
295 * @{
296 */
297#define USB_OTG_ULPI_PHY 1U
298#define USB_OTG_EMBEDDED_PHY 2U
299/**
300 * @}
301 */
302
303/** @defgroup USB_LL_Turnaround_Timeout Turnaround Timeout Value
304 * @{
305 */
306#ifndef USBD_HS_TRDT_VALUE
307#define USBD_HS_TRDT_VALUE 9U
308#endif /* USBD_HS_TRDT_VALUE */
309#ifndef USBD_FS_TRDT_VALUE
310#define USBD_FS_TRDT_VALUE 5U
311#define USBD_DEFAULT_TRDT_VALUE 9U
312#endif /* USBD_HS_TRDT_VALUE */
313/**
314 * @}
315 */
316
317/** @defgroup USB_LL_Core_MPS USB Low Layer Core MPS
318 * @{
319 */
320#define USB_OTG_HS_MAX_PACKET_SIZE 512U
321#define USB_OTG_FS_MAX_PACKET_SIZE 64U
322#define USB_OTG_MAX_EP0_SIZE 64U
323/**
324 * @}
325 */
326
327/** @defgroup USB_LL_Core_PHY_Frequency USB Low Layer Core PHY Frequency
328 * @{
329 */
330#define DSTS_ENUMSPD_HS_PHY_30MHZ_OR_60MHZ (0UL << 1)
331#define DSTS_ENUMSPD_FS_PHY_30MHZ_OR_60MHZ (1UL << 1)
332#define DSTS_ENUMSPD_FS_PHY_48MHZ (3UL << 1)
333/**
334 * @}
335 */
336
337/** @defgroup USB_LL_CORE_Frame_Interval USB Low Layer Core Frame Interval
338 * @{
339 */
340#define DCFG_FRAME_INTERVAL_80 0U
341#define DCFG_FRAME_INTERVAL_85 1U
342#define DCFG_FRAME_INTERVAL_90 2U
343#define DCFG_FRAME_INTERVAL_95 3U
344/**
345 * @}
346 */
347#endif /* defined (USB_OTG_FS) || defined (USB_OTG_HS) */
348/** @defgroup USB_LL_EP0_MPS USB Low Layer EP0 MPS
349 * @{
350 */
351#define EP_MPS_64 0U
352#define EP_MPS_32 1U
353#define EP_MPS_16 2U
354#define EP_MPS_8 3U
355/**
356 * @}
357 */
358
359/** @defgroup USB_LL_EP_Type USB Low Layer EP Type
360 * @{
361 */
362#define EP_TYPE_CTRL 0U
363#define EP_TYPE_ISOC 1U
364#define EP_TYPE_BULK 2U
365#define EP_TYPE_INTR 3U
366#define EP_TYPE_MSK 3U
367/**
368 * @}
369 */
370
371/** @defgroup USB_LL_EP_Speed USB Low Layer EP Speed
372 * @{
373 */
374#define EP_SPEED_LOW 0U
375#define EP_SPEED_FULL 1U
376#define EP_SPEED_HIGH 2U
377/**
378 * @}
379 */
380
381/** @defgroup USB_LL_CH_PID_Type USB Low Layer Channel PID Type
382 * @{
383 */
384#define HC_PID_DATA0 0U
385#define HC_PID_DATA2 1U
386#define HC_PID_DATA1 2U
387#define HC_PID_SETUP 3U
388/**
389 * @}
390 */
391
392/** @defgroup USB_LL Device Speed
393 * @{
394 */
395#define USBD_HS_SPEED 0U
396#define USBD_HSINFS_SPEED 1U
397#define USBH_HS_SPEED 0U
398#define USBD_FS_SPEED 2U
399#define USBH_FSLS_SPEED 1U
400/**
401 * @}
402 */
403
404#if defined (USB_OTG_FS) || defined (USB_OTG_HS)
405/** @defgroup USB_LL_STS_Defines USB Low Layer STS Defines
406 * @{
407 */
408#define STS_GOUT_NAK 1U
409#define STS_DATA_UPDT 2U
410#define STS_XFER_COMP 3U
411#define STS_SETUP_COMP 4U
412#define STS_SETUP_UPDT 6U
413/**
414 * @}
415 */
416
417/** @defgroup USB_LL_HCFG_SPEED_Defines USB Low Layer HCFG Speed Defines
418 * @{
419 */
420#define HCFG_30_60_MHZ 0U
421#define HCFG_48_MHZ 1U
422#define HCFG_6_MHZ 2U
423/**
424 * @}
425 */
426
427/** @defgroup USB_LL_HFIR_Defines USB Low Layer frame interval Defines
428 * @{
429 */
430#define HFIR_6_MHZ 6000U
431#define HFIR_60_MHZ 60000U
432#define HFIR_48_MHZ 48000U
433/**
434 * @}
435 */
436
437/** @defgroup USB_LL_HPRT0_PRTSPD_SPEED_Defines USB Low Layer HPRT0 PRTSPD Speed Defines
438 * @{
439 */
440#define HPRT0_PRTSPD_HIGH_SPEED 0UL
441#define HPRT0_PRTSPD_FULL_SPEED 1UL
442#define HPRT0_PRTSPD_LOW_SPEED 2UL
443/**
444 * @}
445 */
446
447#define HCCHAR_CTRL 0U
448#define HCCHAR_ISOC 1U
449#define HCCHAR_BULK 2U
450#define HCCHAR_INTR 3U
451
452#define GRXSTS_PKTSTS_IN 2U
453#define GRXSTS_PKTSTS_IN_XFER_COMP 3U
454#define GRXSTS_PKTSTS_DATA_TOGGLE_ERR 5U
455#define GRXSTS_PKTSTS_CH_HALTED 7U
456
457#define CLEAR_INTERRUPT_MASK 0xFFFFFFFFU
458
459#define HC_MAX_PKT_CNT 256U
460#define ISO_SPLT_MPS 188U
461
462#define HCSPLT_BEGIN 1U
463#define HCSPLT_MIDDLE 2U
464#define HCSPLT_END 3U
465#define HCSPLT_FULL 4U
466
467#define TEST_J 1U
468#define TEST_K 2U
469#define TEST_SE0_NAK 3U
470#define TEST_PACKET 4U
471#define TEST_FORCE_EN 5U
472
473#define USB_OTG_GAHBCFG_HBSTLEN_SINGLE (0x0UL << USB_OTG_GAHBCFG_HBSTLEN_Pos)
474#define USB_OTG_GAHBCFG_HBSTLEN_INCR (0x1UL << USB_OTG_GAHBCFG_HBSTLEN_Pos)
475#define USB_OTG_GAHBCFG_HBSTLEN_INCR4 (0x3UL << USB_OTG_GAHBCFG_HBSTLEN_Pos)
476#define USB_OTG_GAHBCFG_HBSTLEN_INCR8 (0x5UL << USB_OTG_GAHBCFG_HBSTLEN_Pos)
477#define USB_OTG_GAHBCFG_HBSTLEN_INCR16 (0x7UL << USB_OTG_GAHBCFG_HBSTLEN_Pos)
478
479#define USBx_PCGCCTL *(__IO uint32_t *)((uint32_t)USBx_BASE + USB_OTG_PCGCCTL_BASE)
480#define USBx_HPRT0 *(__IO uint32_t *)((uint32_t)USBx_BASE + USB_OTG_HOST_PORT_BASE)
481
482#define USBx_DEVICE ((USB_OTG_DeviceTypeDef *)(USBx_BASE + USB_OTG_DEVICE_BASE))
483#define USBx_INEP(i) ((USB_OTG_INEndpointTypeDef *)(USBx_BASE\
484 + USB_OTG_IN_ENDPOINT_BASE + ((i) * USB_OTG_EP_REG_SIZE)))
485
486#define USBx_OUTEP(i) ((USB_OTG_OUTEndpointTypeDef *)(USBx_BASE\
487 + USB_OTG_OUT_ENDPOINT_BASE + ((i) * USB_OTG_EP_REG_SIZE)))
488
489#define USBx_DFIFO(i) *(__IO uint32_t *)(USBx_BASE + USB_OTG_FIFO_BASE + ((i) * USB_OTG_FIFO_SIZE))
490
491#define USBx_HOST ((USB_OTG_HostTypeDef *)(USBx_BASE + USB_OTG_HOST_BASE))
492#define USBx_HC(i) ((USB_OTG_HostChannelTypeDef *)(USBx_BASE\
493 + USB_OTG_HOST_CHANNEL_BASE\
494 + ((i) * USB_OTG_HOST_CHANNEL_SIZE)))
495
496
497#define EP_ADDR_MSK 0xFU
498#endif /* defined (USB_OTG_FS) || defined (USB_OTG_HS) */
499/**
500 * @}
501 */
502
503/* Exported macro ------------------------------------------------------------*/
504/** @defgroup USB_LL_Exported_Macros USB Low Layer Exported Macros
505 * @{
506 */
507#if defined (USB_OTG_FS) || defined (USB_OTG_HS)
508#define USB_MASK_INTERRUPT(__INSTANCE__, __INTERRUPT__) ((__INSTANCE__)->GINTMSK &= ~(__INTERRUPT__))
509#define USB_UNMASK_INTERRUPT(__INSTANCE__, __INTERRUPT__) ((__INSTANCE__)->GINTMSK |= (__INTERRUPT__))
510
511#define CLEAR_IN_EP_INTR(__EPNUM__, __INTERRUPT__) (USBx_INEP(__EPNUM__)->DIEPINT = (__INTERRUPT__))
512#define CLEAR_OUT_EP_INTR(__EPNUM__, __INTERRUPT__) (USBx_OUTEP(__EPNUM__)->DOEPINT = (__INTERRUPT__))
513#endif /* defined (USB_OTG_FS) || defined (USB_OTG_HS) */
514/**
515 * @}
516 */
517
518/* Exported functions --------------------------------------------------------*/
519/** @addtogroup USB_LL_Exported_Functions USB Low Layer Exported Functions
520 * @{
521 */
522#if defined (USB_OTG_FS) || defined (USB_OTG_HS)
523HAL_StatusTypeDef USB_CoreInit(USB_OTG_GlobalTypeDef *USBx, USB_OTG_CfgTypeDef cfg);
524HAL_StatusTypeDef USB_DevInit(USB_OTG_GlobalTypeDef *USBx, USB_OTG_CfgTypeDef cfg);
525HAL_StatusTypeDef USB_EnableGlobalInt(USB_OTG_GlobalTypeDef *USBx);
526HAL_StatusTypeDef USB_DisableGlobalInt(USB_OTG_GlobalTypeDef *USBx);
527HAL_StatusTypeDef USB_SetTurnaroundTime(USB_OTG_GlobalTypeDef *USBx, uint32_t hclk, uint8_t speed);
528HAL_StatusTypeDef USB_SetCurrentMode(USB_OTG_GlobalTypeDef *USBx, USB_OTG_ModeTypeDef mode);
529HAL_StatusTypeDef USB_SetDevSpeed(const USB_OTG_GlobalTypeDef *USBx, uint8_t speed);
530HAL_StatusTypeDef USB_FlushRxFifo(USB_OTG_GlobalTypeDef *USBx);
531HAL_StatusTypeDef USB_FlushTxFifo(USB_OTG_GlobalTypeDef *USBx, uint32_t num);
532
533#if defined (HAL_PCD_MODULE_ENABLED)
534HAL_StatusTypeDef USB_ActivateEndpoint(const USB_OTG_GlobalTypeDef *USBx, const USB_OTG_EPTypeDef *ep);
535HAL_StatusTypeDef USB_DeactivateEndpoint(const USB_OTG_GlobalTypeDef *USBx, const USB_OTG_EPTypeDef *ep);
536HAL_StatusTypeDef USB_ActivateDedicatedEndpoint(const USB_OTG_GlobalTypeDef *USBx, const USB_OTG_EPTypeDef *ep);
537HAL_StatusTypeDef USB_DeactivateDedicatedEndpoint(const USB_OTG_GlobalTypeDef *USBx, const USB_OTG_EPTypeDef *ep);
538HAL_StatusTypeDef USB_EPSetStall(const USB_OTG_GlobalTypeDef *USBx, const USB_OTG_EPTypeDef *ep);
539HAL_StatusTypeDef USB_EPClearStall(const USB_OTG_GlobalTypeDef *USBx, const USB_OTG_EPTypeDef *ep);
540HAL_StatusTypeDef USB_EPStartXfer(USB_OTG_GlobalTypeDef *USBx, USB_OTG_EPTypeDef *ep, uint8_t dma);
541HAL_StatusTypeDef USB_EPStopXfer(USB_OTG_GlobalTypeDef *USBx, USB_OTG_EPTypeDef *ep);
542#endif /* defined (HAL_PCD_MODULE_ENABLED) */
543
544HAL_StatusTypeDef USB_WritePacket(const USB_OTG_GlobalTypeDef *USBx, uint8_t *src,
545 uint8_t ch_ep_num, uint16_t len, uint8_t dma);
546
547void *USB_ReadPacket(const USB_OTG_GlobalTypeDef *USBx, uint8_t *dest, uint16_t len);
548
549HAL_StatusTypeDef USB_SetDevAddress(const USB_OTG_GlobalTypeDef *USBx, uint8_t address);
550HAL_StatusTypeDef USB_DevConnect(const USB_OTG_GlobalTypeDef *USBx);
551HAL_StatusTypeDef USB_DevDisconnect(const USB_OTG_GlobalTypeDef *USBx);
552HAL_StatusTypeDef USB_StopDevice(USB_OTG_GlobalTypeDef *USBx);
553HAL_StatusTypeDef USB_ActivateSetup(const USB_OTG_GlobalTypeDef *USBx);
554HAL_StatusTypeDef USB_EP0_OutStart(const USB_OTG_GlobalTypeDef *USBx, uint8_t dma, const uint8_t *psetup);
555uint8_t USB_GetDevSpeed(const USB_OTG_GlobalTypeDef *USBx);
556uint32_t USB_GetMode(const USB_OTG_GlobalTypeDef *USBx);
557uint32_t USB_ReadInterrupts(USB_OTG_GlobalTypeDef const *USBx);
558uint32_t USB_ReadChInterrupts(const USB_OTG_GlobalTypeDef *USBx, uint8_t chnum);
559uint32_t USB_ReadDevAllOutEpInterrupt(const USB_OTG_GlobalTypeDef *USBx);
560uint32_t USB_ReadDevOutEPInterrupt(const USB_OTG_GlobalTypeDef *USBx, uint8_t epnum);
561uint32_t USB_ReadDevAllInEpInterrupt(const USB_OTG_GlobalTypeDef *USBx);
562uint32_t USB_ReadDevInEPInterrupt(const USB_OTG_GlobalTypeDef *USBx, uint8_t epnum);
563void USB_ClearInterrupts(USB_OTG_GlobalTypeDef *USBx, uint32_t interrupt);
564HAL_StatusTypeDef USB_InitFSLSPClkSel(const USB_OTG_GlobalTypeDef *USBx, uint8_t freq);
565
566HAL_StatusTypeDef USB_HostInit(USB_OTG_GlobalTypeDef *USBx, USB_OTG_CfgTypeDef cfg);
567HAL_StatusTypeDef USB_ResetPort(const USB_OTG_GlobalTypeDef *USBx);
568HAL_StatusTypeDef USB_DriveVbus(const USB_OTG_GlobalTypeDef *USBx, uint8_t state);
569uint32_t USB_GetHostSpeed(USB_OTG_GlobalTypeDef const *USBx);
570uint32_t USB_GetCurrentFrame(USB_OTG_GlobalTypeDef const *USBx);
571HAL_StatusTypeDef USB_DoPing(const USB_OTG_GlobalTypeDef *USBx, uint8_t ch_num);
572HAL_StatusTypeDef USB_StopHost(USB_OTG_GlobalTypeDef *USBx);
573
574#if defined (HAL_HCD_MODULE_ENABLED)
575HAL_StatusTypeDef USB_HC_Init(USB_OTG_GlobalTypeDef *USBx, uint8_t ch_num,
576 uint8_t epnum, uint8_t dev_address, uint8_t speed,
577 uint8_t ep_type, uint16_t mps);
578HAL_StatusTypeDef USB_HC_StartXfer(USB_OTG_GlobalTypeDef *USBx,
579 USB_OTG_HCTypeDef *hc, uint8_t dma);
580
581uint32_t USB_HC_ReadInterrupt(const USB_OTG_GlobalTypeDef *USBx);
582HAL_StatusTypeDef USB_HC_Halt(const USB_OTG_GlobalTypeDef *USBx, uint8_t hc_num);
583HAL_StatusTypeDef USB_HC_Activate(const USB_OTG_GlobalTypeDef *USBx, uint8_t ch_num, uint8_t ch_dir);
584#endif /* defined (HAL_HCD_MODULE_ENABLED) */
585
586HAL_StatusTypeDef USB_ActivateRemoteWakeup(const USB_OTG_GlobalTypeDef *USBx);
587HAL_StatusTypeDef USB_DeActivateRemoteWakeup(const USB_OTG_GlobalTypeDef *USBx);
588#endif /* defined (USB_OTG_FS) || defined (USB_OTG_HS) */
589
590/**
591 * @}
592 */
593
594/**
595 * @}
596 */
597
598/**
599 * @}
600 */
601
602/**
603 * @}
604 */
605#endif /* defined (USB_OTG_FS) || defined (USB_OTG_HS) */
606
607#ifdef __cplusplus
608}
609#endif /* __cplusplus */
610
611#endif /* STM32H7xx_LL_USB_H */
static ActuatorControllerState state
Definition main.cpp:57
This file contains HAL common defines, enumeration, macros and structures definitions.
HAL_StatusTypeDef
HAL Status structures definition.
USB_OTG_Core_Registers.