Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
USB_Core
[STM32L4xx_HAL]
Data Structures | |
struct | USB_OTG_CfgTypeDef |
PCD Initialization Structure definition. More... | |
struct | USB_CfgTypeDef |
USB Initialization Structure definition. More... | |
Modules | |
PCD Exported Constants | |
Enumerations | |
enum | USB_ModeTypeDef |
USB Mode definition. More... | |
enum | USB_OTG_URBStateTypeDef |
URB States definition. More... | |
enum | USB_OTG_HCStateTypeDef |
Host channel States definition. More... | |
Functions | |
HAL_StatusTypeDef | USB_CoreInit (USB_OTG_GlobalTypeDef *USBx, USB_OTG_CfgTypeDef Init) |
Initializes the USB Core. | |
HAL_StatusTypeDef | USB_DevInit (USB_OTG_GlobalTypeDef *USBx, USB_OTG_CfgTypeDef Init) |
USB_DevInit : Initializes the USB_OTG controller registers for device mode. | |
HAL_StatusTypeDef | USB_EnableGlobalInt (USB_OTG_GlobalTypeDef *USBx) |
USB_EnableGlobalInt Enables the controller's Global Int in the AHB Config reg. | |
HAL_StatusTypeDef | USB_DisableGlobalInt (USB_OTG_GlobalTypeDef *USBx) |
USB_DisableGlobalInt Disable the controller's Global Int in the AHB Config reg. | |
HAL_StatusTypeDef | USB_SetCurrentMode (USB_OTG_GlobalTypeDef *USBx, USB_ModeTypeDef mode) |
USB_SetCurrentMode : Set functional mode. | |
HAL_StatusTypeDef | USB_SetDevSpeed (USB_OTG_GlobalTypeDef *USBx, uint8_t speed) |
USB_SetDevSpeed :Initializes the DevSpd field of DCFG register depending the PHY type and the enumeration speed of the device. | |
HAL_StatusTypeDef | USB_FlushRxFifo (USB_OTG_GlobalTypeDef *USBx) |
USB_FlushRxFifo : Flush Rx FIFO. | |
HAL_StatusTypeDef | USB_FlushTxFifo (USB_OTG_GlobalTypeDef *USBx, uint32_t num) |
USB_OTG_FlushTxFifo : Flush a Tx FIFO. | |
HAL_StatusTypeDef | USB_ActivateEndpoint (USB_OTG_GlobalTypeDef *USBx, USB_OTG_EPTypeDef *ep) |
Activate and configure an endpoint. | |
HAL_StatusTypeDef | USB_DeactivateEndpoint (USB_OTG_GlobalTypeDef *USBx, USB_OTG_EPTypeDef *ep) |
De-activate and de-initialize an endpoint. | |
HAL_StatusTypeDef | USB_ActivateDedicatedEndpoint (USB_OTG_GlobalTypeDef *USBx, USB_OTG_EPTypeDef *ep) |
Activate and configure a dedicated endpoint. | |
HAL_StatusTypeDef | USB_DeactivateDedicatedEndpoint (USB_OTG_GlobalTypeDef *USBx, USB_OTG_EPTypeDef *ep) |
De-activate and de-initialize a dedicated endpoint. | |
HAL_StatusTypeDef | USB_EPStartXfer (USB_OTG_GlobalTypeDef *USBx, USB_OTG_EPTypeDef *ep, uint8_t dma) |
USB_EPStartXfer : setup and starts a transfer over an EP. | |
HAL_StatusTypeDef | USB_EP0StartXfer (USB_OTG_GlobalTypeDef *USBx, USB_OTG_EPTypeDef *ep, uint8_t dma) |
USB_EP0StartXfer : setup and starts a transfer over the EP 0. | |
HAL_StatusTypeDef | USB_WritePacket (USB_OTG_GlobalTypeDef *USBx, uint8_t *src, uint8_t ch_ep_num, uint16_t len, uint8_t dma) |
USB_WritePacket : Writes a packet into the Tx FIFO associated with the EP/channel. | |
void * | USB_ReadPacket (USB_OTG_GlobalTypeDef *USBx, uint8_t *dest, uint16_t len) |
USB_ReadPacket : read a packet from the Tx FIFO associated with the EP/channel. | |
HAL_StatusTypeDef | USB_EPSetStall (USB_OTG_GlobalTypeDef *USBx, USB_OTG_EPTypeDef *ep) |
USB_EPSetStall : set a stall condition over an EP. | |
HAL_StatusTypeDef | USB_EPClearStall (USB_OTG_GlobalTypeDef *USBx, USB_OTG_EPTypeDef *ep) |
USB_EPClearStall : Clear a stall condition over an EP. | |
HAL_StatusTypeDef | USB_SetDevAddress (USB_OTG_GlobalTypeDef *USBx, uint8_t address) |
USB_SetDevAddress : Stop the USB device mode. | |
HAL_StatusTypeDef | USB_DevConnect (USB_OTG_GlobalTypeDef *USBx) |
USB_DevConnect : Connect the USB device by enabling the pull-up/pull-down. | |
HAL_StatusTypeDef | USB_DevDisconnect (USB_OTG_GlobalTypeDef *USBx) |
USB_DevDisconnect : Disconnect the USB device by disabling the pull-up/pull-down. | |
HAL_StatusTypeDef | USB_StopDevice (USB_OTG_GlobalTypeDef *USBx) |
USB_StopDevice : Stop the USB device mode. | |
HAL_StatusTypeDef | USB_ActivateSetup (USB_OTG_GlobalTypeDef *USBx) |
Activate EP0 for Setup transactions. | |
HAL_StatusTypeDef | USB_EP0_OutStart (USB_OTG_GlobalTypeDef *USBx, uint8_t dma, uint8_t *psetup) |
Prepare the EP0 to start the first control setup. | |
uint8_t | USB_GetDevSpeed (USB_OTG_GlobalTypeDef *USBx) |
USB_GetDevSpeed :Return the Dev Speed. | |
uint32_t | USB_GetMode (USB_OTG_GlobalTypeDef *USBx) |
Returns USB core mode. | |
uint32_t | USB_ReadInterrupts (USB_OTG_GlobalTypeDef *USBx) |
USB_ReadInterrupts: return the global USB interrupt status. | |
uint32_t | USB_ReadDevAllOutEpInterrupt (USB_OTG_GlobalTypeDef *USBx) |
USB_ReadDevAllOutEpInterrupt: return the USB device OUT endpoints interrupt status. | |
uint32_t | USB_ReadDevOutEPInterrupt (USB_OTG_GlobalTypeDef *USBx, uint8_t epnum) |
Returns Device OUT EP Interrupt register. | |
uint32_t | USB_ReadDevAllInEpInterrupt (USB_OTG_GlobalTypeDef *USBx) |
USB_ReadDevAllInEpInterrupt: return the USB device IN endpoints interrupt status. | |
uint32_t | USB_ReadDevInEPInterrupt (USB_OTG_GlobalTypeDef *USBx, uint8_t epnum) |
Returns Device IN EP Interrupt register. | |
void | USB_ClearInterrupts (USB_OTG_GlobalTypeDef *USBx, uint32_t interrupt) |
USB_ClearInterrupts: clear a USB interrupt. | |
HAL_StatusTypeDef | USB_HostInit (USB_OTG_GlobalTypeDef *USBx, USB_OTG_CfgTypeDef cfg) |
USB_HostInit : Initializes the USB OTG controller registers for Host mode. | |
HAL_StatusTypeDef | USB_InitFSLSPClkSel (USB_OTG_GlobalTypeDef *USBx, uint8_t freq) |
USB_InitFSLSPClkSel : Initializes the FSLSPClkSel field of the HCFG register on the PHY type and set the right frame interval. | |
HAL_StatusTypeDef | USB_ResetPort (USB_OTG_GlobalTypeDef *USBx) |
USB_OTG_ResetPort : Reset Host Port. | |
HAL_StatusTypeDef | USB_DriveVbus (USB_OTG_GlobalTypeDef *USBx, uint8_t state) |
USB_DriveVbus : activate or de-activate vbus. | |
uint32_t | USB_GetHostSpeed (USB_OTG_GlobalTypeDef *USBx) |
Return Host Core speed. | |
uint32_t | USB_GetCurrentFrame (USB_OTG_GlobalTypeDef *USBx) |
Return Host Current Frame number. | |
HAL_StatusTypeDef | USB_HC_Init (USB_OTG_GlobalTypeDef *USBx, uint8_t ch_num, uint8_t epnum, uint8_t dev_address, uint8_t speed, uint8_t ep_type, uint16_t mps) |
Initialize a host channel. | |
HAL_StatusTypeDef | USB_HC_StartXfer (USB_OTG_GlobalTypeDef *USBx, USB_OTG_HCTypeDef *hc, uint8_t dma) |
Start a transfer over a host channel. | |
uint32_t | USB_HC_ReadInterrupt (USB_OTG_GlobalTypeDef *USBx) |
Read all host channel interrupts status. | |
HAL_StatusTypeDef | USB_HC_Halt (USB_OTG_GlobalTypeDef *USBx, uint8_t hc_num) |
Halt a host channel. | |
HAL_StatusTypeDef | USB_DoPing (USB_OTG_GlobalTypeDef *USBx, uint8_t ch_num) |
Initiate Do Ping protocol. | |
HAL_StatusTypeDef | USB_StopHost (USB_OTG_GlobalTypeDef *USBx) |
Stop Host Core. | |
HAL_StatusTypeDef | USB_ActivateRemoteWakeup (USB_OTG_GlobalTypeDef *USBx) |
USB_ActivateRemoteWakeup : active remote wakeup signalling. | |
HAL_StatusTypeDef | USB_DeActivateRemoteWakeup (USB_OTG_GlobalTypeDef *USBx) |
USB_DeActivateRemoteWakeup : de-active remote wakeup signalling. | |
HAL_StatusTypeDef | USB_CoreInit (USB_TypeDef *USBx, USB_CfgTypeDef Init) |
Initializes the USB Core. | |
HAL_StatusTypeDef | USB_DevInit (USB_TypeDef *USBx, USB_CfgTypeDef Init) |
USB_DevInit : Initializes the USB controller registers for device mode. | |
HAL_StatusTypeDef | USB_EnableGlobalInt (USB_TypeDef *USBx) |
USB_EnableGlobalInt Enables the controller's Global Int in the AHB Config reg. | |
HAL_StatusTypeDef | USB_DisableGlobalInt (USB_TypeDef *USBx) |
USB_DisableGlobalInt Disable the controller's Global Int in the AHB Config reg. | |
HAL_StatusTypeDef | USB_SetCurrentMode (USB_TypeDef *USBx, USB_ModeTypeDef mode) |
USB_SetCurrentMode : Set functional mode. | |
HAL_StatusTypeDef | USB_FlushRxFifo (USB_TypeDef *USBx) |
USB_FlushRxFifo : Flush Rx FIFO. | |
HAL_StatusTypeDef | USB_FlushTxFifo (USB_TypeDef *USBx, uint32_t num) |
USB_FlushTxFifo : Flush a Tx FIFO. | |
HAL_StatusTypeDef | USB_ActivateEndpoint (USB_TypeDef *USBx, USB_EPTypeDef *ep) |
Activate and configure an endpoint. | |
HAL_StatusTypeDef | USB_DeactivateEndpoint (USB_TypeDef *USBx, USB_EPTypeDef *ep) |
De-activate and de-initialize an endpoint. | |
HAL_StatusTypeDef | USB_EPStartXfer (USB_TypeDef *USBx, USB_EPTypeDef *ep, uint8_t dma) |
USB_EPStartXfer : setup and starts a transfer over an EP. | |
HAL_StatusTypeDef | USB_WritePacket (USB_TypeDef *USBx, uint8_t *src, uint8_t ch_ep_num, uint16_t len) |
USB_WritePacket : Writes a packet into the Tx FIFO associated with the EP/channel. | |
void * | USB_ReadPacket (USB_TypeDef *USBx, uint8_t *dest, uint16_t len) |
USB_ReadPacket : read a packet from the Tx FIFO associated with the EP/channel. | |
HAL_StatusTypeDef | USB_EPSetStall (USB_TypeDef *USBx, USB_EPTypeDef *ep) |
USB_EPSetStall : set a stall condition over an EP. | |
HAL_StatusTypeDef | USB_EPClearStall (USB_TypeDef *USBx, USB_EPTypeDef *ep) |
USB_EPClearStall : Clear a stall condition over an EP. | |
HAL_StatusTypeDef | USB_SetDevAddress (USB_TypeDef *USBx, uint8_t address) |
USB_SetDevAddress : Stop the usb device mode. | |
HAL_StatusTypeDef | USB_DevConnect (USB_TypeDef *USBx) |
USB_DevConnect : Connect the USB device by enabling the pull-up/pull-down. | |
HAL_StatusTypeDef | USB_DevDisconnect (USB_TypeDef *USBx) |
USB_DevDisconnect : Disconnect the USB device by disabling the pull-up/pull-down. | |
HAL_StatusTypeDef | USB_StopDevice (USB_TypeDef *USBx) |
USB_StopDevice : Stop the usb device mode. | |
HAL_StatusTypeDef | USB_EP0_OutStart (USB_TypeDef *USBx, uint8_t dma, uint8_t *psetup) |
Prepare the EP0 to start the first control setup. | |
uint32_t | USB_ReadInterrupts (USB_TypeDef *USBx) |
USB_ReadInterrupts: return the global USB interrupt status. | |
uint32_t | USB_ReadDevAllOutEpInterrupt (USB_TypeDef *USBx) |
USB_ReadDevAllOutEpInterrupt: return the USB device OUT endpoints interrupt status. | |
uint32_t | USB_ReadDevOutEPInterrupt (USB_TypeDef *USBx, uint8_t epnum) |
Returns Device OUT EP Interrupt register. | |
uint32_t | USB_ReadDevAllInEpInterrupt (USB_TypeDef *USBx) |
USB_ReadDevAllInEpInterrupt: return the USB device IN endpoints interrupt status. | |
uint32_t | USB_ReadDevInEPInterrupt (USB_TypeDef *USBx, uint8_t epnum) |
Returns Device IN EP Interrupt register. | |
void | USB_ClearInterrupts (USB_TypeDef *USBx, uint32_t interrupt) |
USB_ClearInterrupts: clear a USB interrupt. | |
HAL_StatusTypeDef | USB_ActivateRemoteWakeup (USB_TypeDef *USBx) |
USB_ActivateRemoteWakeup : active remote wakeup signalling. | |
HAL_StatusTypeDef | USB_DeActivateRemoteWakeup (USB_TypeDef *USBx) |
USB_DeActivateRemoteWakeup : de-active remote wakeup signalling. | |
void | USB_WritePMA (USB_TypeDef *USBx, uint8_t *pbUsrBuf, uint16_t wPMABufAddr, uint16_t wNBytes) |
Copy a buffer from user memory area to packet memory area (PMA) | |
void | USB_ReadPMA (USB_TypeDef *USBx, uint8_t *pbUsrBuf, uint16_t wPMABufAddr, uint16_t wNBytes) |
Copy a buffer from user memory area to packet memory area (PMA) |
Enumeration Type Documentation
enum USB_ModeTypeDef |
USB Mode definition.
Definition at line 67 of file stm32l4xx_ll_usb.h.
Host channel States definition.
Definition at line 92 of file stm32l4xx_ll_usb.h.
URB States definition.
Definition at line 79 of file stm32l4xx_ll_usb.h.
Function Documentation
HAL_StatusTypeDef USB_ActivateDedicatedEndpoint | ( | USB_OTG_GlobalTypeDef * | USBx, |
USB_OTG_EPTypeDef * | ep | ||
) |
Activate and configure a dedicated endpoint.
- Parameters:
-
USBx,: Selected device ep,: pointer to endpoint structure
- Return values:
-
HAL status
Definition at line 444 of file stm32l4xx_ll_usb.c.
HAL_StatusTypeDef USB_ActivateEndpoint | ( | USB_OTG_GlobalTypeDef * | USBx, |
USB_OTG_EPTypeDef * | ep | ||
) |
Activate and configure an endpoint.
- Parameters:
-
USBx,: Selected device ep,: pointer to endpoint structure
- Return values:
-
HAL status
Definition at line 413 of file stm32l4xx_ll_usb.c.
HAL_StatusTypeDef USB_ActivateEndpoint | ( | USB_TypeDef * | USBx, |
USB_EPTypeDef * | ep | ||
) |
Activate and configure an endpoint.
- Parameters:
-
USBx : Selected device ep,: pointer to endpoint structure
- Return values:
-
HAL status
Definition at line 1752 of file stm32l4xx_ll_usb.c.
HAL_StatusTypeDef USB_ActivateRemoteWakeup | ( | USB_TypeDef * | USBx ) |
USB_ActivateRemoteWakeup : active remote wakeup signalling.
- Parameters:
-
USBx : Selected device
- Return values:
-
HAL status
Definition at line 2262 of file stm32l4xx_ll_usb.c.
HAL_StatusTypeDef USB_ActivateRemoteWakeup | ( | USB_OTG_GlobalTypeDef * | USBx ) |
USB_ActivateRemoteWakeup : active remote wakeup signalling.
- Parameters:
-
USBx : Selected device
- Return values:
-
HAL status
Definition at line 1565 of file stm32l4xx_ll_usb.c.
HAL_StatusTypeDef USB_ActivateSetup | ( | USB_OTG_GlobalTypeDef * | USBx ) |
Activate EP0 for Setup transactions.
- Parameters:
-
USBx,: Selected device
- Return values:
-
HAL status
Definition at line 987 of file stm32l4xx_ll_usb.c.
void USB_ClearInterrupts | ( | USB_OTG_GlobalTypeDef * | USBx, |
uint32_t | interrupt | ||
) |
USB_ClearInterrupts: clear a USB interrupt.
- Parameters:
-
USBx,: Selected device interrupt,: interrupt flag
- Return values:
-
None
Definition at line 963 of file stm32l4xx_ll_usb.c.
void USB_ClearInterrupts | ( | USB_TypeDef * | USBx, |
uint32_t | interrupt | ||
) |
USB_ClearInterrupts: clear a USB interrupt.
- Parameters:
-
USBx : Selected device interrupt : interrupt flag
- Return values:
-
None
Definition at line 2225 of file stm32l4xx_ll_usb.c.
HAL_StatusTypeDef USB_CoreInit | ( | USB_OTG_GlobalTypeDef * | USBx, |
USB_OTG_CfgTypeDef | cfg | ||
) |
Initializes the USB Core.
- Parameters:
-
USBx,: USB Instance cfg,: pointer to a USB_OTG_CfgTypeDef structure that contains the configuration information for the specified USBx peripheral.
- Return values:
-
HAL status
Definition at line 123 of file stm32l4xx_ll_usb.c.
HAL_StatusTypeDef USB_CoreInit | ( | USB_TypeDef * | USBx, |
USB_CfgTypeDef | cfg | ||
) |
Initializes the USB Core.
- Parameters:
-
USBx,: USB Instance cfg : pointer to a USB_CfgTypeDef structure that contains the configuration information for the specified USBx peripheral.
- Return values:
-
HAL status
Definition at line 1601 of file stm32l4xx_ll_usb.c.
HAL_StatusTypeDef USB_DeactivateDedicatedEndpoint | ( | USB_OTG_GlobalTypeDef * | USBx, |
USB_OTG_EPTypeDef * | ep | ||
) |
De-activate and de-initialize a dedicated endpoint.
- Parameters:
-
USBx,: Selected device ep,: pointer to endpoint structure
- Return values:
-
HAL status
Definition at line 511 of file stm32l4xx_ll_usb.c.
HAL_StatusTypeDef USB_DeactivateEndpoint | ( | USB_OTG_GlobalTypeDef * | USBx, |
USB_OTG_EPTypeDef * | ep | ||
) |
De-activate and de-initialize an endpoint.
- Parameters:
-
USBx,: Selected device ep,: pointer to endpoint structure
- Return values:
-
HAL status
Definition at line 487 of file stm32l4xx_ll_usb.c.
HAL_StatusTypeDef USB_DeactivateEndpoint | ( | USB_TypeDef * | USBx, |
USB_EPTypeDef * | ep | ||
) |
De-activate and de-initialize an endpoint.
- Parameters:
-
USBx : Selected device ep,: pointer to endpoint structure
- Return values:
-
HAL status
Definition at line 1837 of file stm32l4xx_ll_usb.c.
HAL_StatusTypeDef USB_DeActivateRemoteWakeup | ( | USB_TypeDef * | USBx ) |
USB_DeActivateRemoteWakeup : de-active remote wakeup signalling.
- Parameters:
-
USBx : Selected device
- Return values:
-
HAL status
Definition at line 2274 of file stm32l4xx_ll_usb.c.
HAL_StatusTypeDef USB_DeActivateRemoteWakeup | ( | USB_OTG_GlobalTypeDef * | USBx ) |
USB_DeActivateRemoteWakeup : de-active remote wakeup signalling.
- Parameters:
-
USBx : Selected device
- Return values:
-
HAL status
Definition at line 1580 of file stm32l4xx_ll_usb.c.
HAL_StatusTypeDef USB_DevConnect | ( | USB_OTG_GlobalTypeDef * | USBx ) |
USB_DevConnect : Connect the USB device by enabling the pull-up/pull-down.
- Parameters:
-
USBx,: Selected device
- Return values:
-
HAL status
Definition at line 863 of file stm32l4xx_ll_usb.c.
HAL_StatusTypeDef USB_DevConnect | ( | USB_TypeDef * | USBx ) |
USB_DevConnect : Connect the USB device by enabling the pull-up/pull-down.
- Parameters:
-
USBx : Selected device
- Return values:
-
HAL status
Definition at line 2107 of file stm32l4xx_ll_usb.c.
HAL_StatusTypeDef USB_DevDisconnect | ( | USB_TypeDef * | USBx ) |
USB_DevDisconnect : Disconnect the USB device by disabling the pull-up/pull-down.
- Parameters:
-
USBx : Selected device
- Return values:
-
HAL status
Definition at line 2120 of file stm32l4xx_ll_usb.c.
HAL_StatusTypeDef USB_DevDisconnect | ( | USB_OTG_GlobalTypeDef * | USBx ) |
USB_DevDisconnect : Disconnect the USB device by disabling the pull-up/pull-down.
- Parameters:
-
USBx,: Selected device
- Return values:
-
HAL status
Definition at line 876 of file stm32l4xx_ll_usb.c.
HAL_StatusTypeDef USB_DevInit | ( | USB_OTG_GlobalTypeDef * | USBx, |
USB_OTG_CfgTypeDef | cfg | ||
) |
USB_DevInit : Initializes the USB_OTG controller registers for device mode.
- Parameters:
-
USBx,: Selected device cfg,: pointer to a USB_OTG_CfgTypeDef structure that contains the configuration information for the specified USBx peripheral.
- Return values:
-
HAL status
Definition at line 200 of file stm32l4xx_ll_usb.c.
HAL_StatusTypeDef USB_DevInit | ( | USB_TypeDef * | USBx, |
USB_CfgTypeDef | cfg | ||
) |
USB_DevInit : Initializes the USB controller registers for device mode.
- Parameters:
-
USBx : Selected device cfg : pointer to a USB_CfgTypeDef structure that contains the configuration information for the specified USBx peripheral.
- Return values:
-
HAL status
Definition at line 1685 of file stm32l4xx_ll_usb.c.
HAL_StatusTypeDef USB_DisableGlobalInt | ( | USB_OTG_GlobalTypeDef * | USBx ) |
USB_DisableGlobalInt Disable the controller's Global Int in the AHB Config reg.
- Parameters:
-
USBx,: Selected device
- Return values:
-
HAL status
Definition at line 159 of file stm32l4xx_ll_usb.c.
HAL_StatusTypeDef USB_DisableGlobalInt | ( | USB_TypeDef * | USBx ) |
USB_DisableGlobalInt Disable the controller's Global Int in the AHB Config reg.
- Parameters:
-
USBx : Selected device
- Return values:
-
HAL status
Definition at line 1641 of file stm32l4xx_ll_usb.c.
HAL_StatusTypeDef USB_DoPing | ( | USB_OTG_GlobalTypeDef * | USBx, |
uint8_t | ch_num | ||
) |
Initiate Do Ping protocol.
- Parameters:
-
USBx,: Selected device hc_num,: Host Channel number This parameter can be a value from 1 to 15
- Return values:
-
HAL state
Definition at line 1489 of file stm32l4xx_ll_usb.c.
HAL_StatusTypeDef USB_DriveVbus | ( | USB_OTG_GlobalTypeDef * | USBx, |
uint8_t | state | ||
) |
USB_DriveVbus : activate or de-activate vbus.
- Parameters:
-
state,: VBUS state This parameter can be one of these values: 0 : VBUS Active 1 : VBUS Inactive
- Return values:
-
HAL status
Definition at line 1148 of file stm32l4xx_ll_usb.c.
HAL_StatusTypeDef USB_EnableGlobalInt | ( | USB_TypeDef * | USBx ) |
USB_EnableGlobalInt Enables the controller's Global Int in the AHB Config reg.
- Parameters:
-
USBx : Selected device
- Return values:
-
HAL status
Definition at line 1621 of file stm32l4xx_ll_usb.c.
HAL_StatusTypeDef USB_EnableGlobalInt | ( | USB_OTG_GlobalTypeDef * | USBx ) |
USB_EnableGlobalInt Enables the controller's Global Int in the AHB Config reg.
- Parameters:
-
USBx,: Selected device
- Return values:
-
HAL status
Definition at line 146 of file stm32l4xx_ll_usb.c.
HAL_StatusTypeDef USB_EP0_OutStart | ( | USB_TypeDef * | USBx, |
uint8_t | dma, | ||
uint8_t * | psetup | ||
) |
Prepare the EP0 to start the first control setup.
- Parameters:
-
USBx : Selected device psetup : pointer to setup packet
- Return values:
-
HAL status
Definition at line 2243 of file stm32l4xx_ll_usb.c.
HAL_StatusTypeDef USB_EP0_OutStart | ( | USB_OTG_GlobalTypeDef * | USBx, |
uint8_t | dma, | ||
uint8_t * | psetup | ||
) |
Prepare the EP0 to start the first control setup.
- Parameters:
-
USBx,: Selected device dma,: USB dma enabled or disabled This parameter can be one of these values: 0 : DMA feature not used 1 : DMA feature used psetup,: pointer to setup packet
- Return values:
-
HAL status
Definition at line 1012 of file stm32l4xx_ll_usb.c.
HAL_StatusTypeDef USB_EP0StartXfer | ( | USB_OTG_GlobalTypeDef * | USBx, |
USB_OTG_EPTypeDef * | ep, | ||
uint8_t | dma | ||
) |
USB_EP0StartXfer : setup and starts a transfer over the EP 0.
- Parameters:
-
USBx,: Selected device ep,: pointer to endpoint structure dma,: USB dma enabled or disabled This parameter can be one of these values: 0 : DMA feature not used 1 : DMA feature used
- Return values:
-
HAL status
Definition at line 646 of file stm32l4xx_ll_usb.c.
HAL_StatusTypeDef USB_EPClearStall | ( | USB_OTG_GlobalTypeDef * | USBx, |
USB_OTG_EPTypeDef * | ep | ||
) |
USB_EPClearStall : Clear a stall condition over an EP.
- Parameters:
-
USBx,: Selected device ep,: pointer to endpoint structure
- Return values:
-
HAL status
Definition at line 793 of file stm32l4xx_ll_usb.c.
HAL_StatusTypeDef USB_EPClearStall | ( | USB_TypeDef * | USBx, |
USB_EPTypeDef * | ep | ||
) |
USB_EPClearStall : Clear a stall condition over an EP.
- Parameters:
-
USBx : Selected device ep,: pointer to endpoint structure
- Return values:
-
HAL status
Definition at line 2050 of file stm32l4xx_ll_usb.c.
HAL_StatusTypeDef USB_EPSetStall | ( | USB_OTG_GlobalTypeDef * | USBx, |
USB_OTG_EPTypeDef * | ep | ||
) |
USB_EPSetStall : set a stall condition over an EP.
- Parameters:
-
USBx,: Selected device ep,: pointer to endpoint structure
- Return values:
-
HAL status
Definition at line 765 of file stm32l4xx_ll_usb.c.
HAL_StatusTypeDef USB_EPSetStall | ( | USB_TypeDef * | USBx, |
USB_EPTypeDef * | ep | ||
) |
USB_EPSetStall : set a stall condition over an EP.
- Parameters:
-
USBx : Selected device ep,: pointer to endpoint structure
- Return values:
-
HAL status
Definition at line 2023 of file stm32l4xx_ll_usb.c.
HAL_StatusTypeDef USB_EPStartXfer | ( | USB_OTG_GlobalTypeDef * | USBx, |
USB_OTG_EPTypeDef * | ep, | ||
uint8_t | dma | ||
) |
USB_EPStartXfer : setup and starts a transfer over an EP.
- Parameters:
-
USBx,: Selected device ep,: pointer to endpoint structure dma,: USB dma enabled or disabled This parameter can be one of these values: 0 : DMA feature not used 1 : DMA feature used
- Return values:
-
HAL status
Definition at line 537 of file stm32l4xx_ll_usb.c.
HAL_StatusTypeDef USB_EPStartXfer | ( | USB_TypeDef * | USBx, |
USB_EPTypeDef * | ep, | ||
uint8_t | dma | ||
) |
USB_EPStartXfer : setup and starts a transfer over an EP.
- Parameters:
-
USBx : Selected device ep,: pointer to endpoint structure
- Return values:
-
HAL status
Definition at line 1890 of file stm32l4xx_ll_usb.c.
HAL_StatusTypeDef USB_FlushRxFifo | ( | USB_TypeDef * | USBx ) |
USB_FlushRxFifo : Flush Rx FIFO.
- Parameters:
-
USBx : Selected device
- Return values:
-
HAL status
Definition at line 1733 of file stm32l4xx_ll_usb.c.
HAL_StatusTypeDef USB_FlushRxFifo | ( | USB_OTG_GlobalTypeDef * | USBx ) |
USB_FlushRxFifo : Flush Rx FIFO.
- Parameters:
-
USBx,: Selected device
- Return values:
-
HAL status
Definition at line 341 of file stm32l4xx_ll_usb.c.
HAL_StatusTypeDef USB_FlushTxFifo | ( | USB_OTG_GlobalTypeDef * | USBx, |
uint32_t | num | ||
) |
USB_OTG_FlushTxFifo : Flush a Tx FIFO.
- Parameters:
-
USBx,: Selected device num,: FIFO number This parameter can be a value from 1 to 15 15 means Flush all Tx FIFOs
- Return values:
-
HAL status
Definition at line 317 of file stm32l4xx_ll_usb.c.
HAL_StatusTypeDef USB_FlushTxFifo | ( | USB_TypeDef * | USBx, |
uint32_t | num | ||
) |
USB_FlushTxFifo : Flush a Tx FIFO.
- Parameters:
-
USBx : Selected device num : FIFO number This parameter can be a value from 1 to 15 15 means Flush all Tx FIFOs
- Return values:
-
HAL status
Definition at line 1714 of file stm32l4xx_ll_usb.c.
uint32_t USB_GetCurrentFrame | ( | USB_OTG_GlobalTypeDef * | USBx ) |
Return Host Current Frame number.
- Parameters:
-
USBx,: Selected device
- Return values:
-
current frame number
Definition at line 1189 of file stm32l4xx_ll_usb.c.
uint8_t USB_GetDevSpeed | ( | USB_OTG_GlobalTypeDef * | USBx ) |
USB_GetDevSpeed :Return the Dev Speed.
- Parameters:
-
USBx,: Selected device
- Return values:
-
speed : device speed This parameter can be one of these values: - USB_OTG_SPEED_HIGH: High speed mode
- USB_OTG_SPEED_FULL: Full speed mode
- USB_OTG_SPEED_LOW: Low speed mode
Definition at line 386 of file stm32l4xx_ll_usb.c.
uint32_t USB_GetHostSpeed | ( | USB_OTG_GlobalTypeDef * | USBx ) |
Return Host Core speed.
- Parameters:
-
USBx,: Selected device
- Return values:
-
speed : Host speed This parameter can be one of these values: - USB_OTG_SPEED_HIGH: High speed mode
- USB_OTG_SPEED_FULL: Full speed mode
- USB_OTG_SPEED_LOW: Low speed mode
Definition at line 1176 of file stm32l4xx_ll_usb.c.
uint32_t USB_GetMode | ( | USB_OTG_GlobalTypeDef * | USBx ) |
Returns USB core mode.
- Parameters:
-
USBx,: Selected device
- Return values:
-
return core mode : Host or Device This parameter can be one of these values: 0 : Host 1 : Device
Definition at line 976 of file stm32l4xx_ll_usb.c.
HAL_StatusTypeDef USB_HC_Halt | ( | USB_OTG_GlobalTypeDef * | USBx, |
uint8_t | hc_num | ||
) |
Halt a host channel.
- Parameters:
-
USBx,: Selected device hc_num,: Host Channel number This parameter can be a value from 1 to 15
- Return values:
-
HAL state
Definition at line 1427 of file stm32l4xx_ll_usb.c.
HAL_StatusTypeDef USB_HC_Init | ( | USB_OTG_GlobalTypeDef * | USBx, |
uint8_t | ch_num, | ||
uint8_t | epnum, | ||
uint8_t | dev_address, | ||
uint8_t | speed, | ||
uint8_t | ep_type, | ||
uint16_t | mps | ||
) |
Initialize a host channel.
- Parameters:
-
USBx,: Selected device ch_num : Channel number This parameter can be a value from 1 to 15 epnum,: Endpoint number This parameter can be a value from 1 to 15 dev_address,: Current device address This parameter can be a value from 0 to 255 speed,: Current device speed This parameter can be one of these values: - USB_OTG_SPEED_HIGH: High speed mode
- USB_OTG_SPEED_FULL: Full speed mode
- USB_OTG_SPEED_LOW: Low speed mode
ep_type,: Endpoint Type This parameter can be one of these values: - EP_TYPE_CTRL: Control type
- EP_TYPE_ISOC: Isochronous type
- EP_TYPE_BULK: Bulk type
- EP_TYPE_INTR: Interrupt type
mps,: Max Packet Size This parameter can be a value from 0 to32K
- Return values:
-
HAL state
Definition at line 1218 of file stm32l4xx_ll_usb.c.
uint32_t USB_HC_ReadInterrupt | ( | USB_OTG_GlobalTypeDef * | USBx ) |
Read all host channel interrupts status.
- Parameters:
-
USBx,: Selected device
- Return values:
-
HAL state
Definition at line 1415 of file stm32l4xx_ll_usb.c.
HAL_StatusTypeDef USB_HC_StartXfer | ( | USB_OTG_GlobalTypeDef * | USBx, |
USB_OTG_HCTypeDef * | hc, | ||
uint8_t | dma | ||
) |
Start a transfer over a host channel.
- Parameters:
-
USBx,: Selected device hc,: pointer to host channel structure dma,: USB dma enabled or disabled This parameter can be one of these values: 0 : DMA feature not used 1 : DMA feature used
- Return values:
-
HAL state
Definition at line 1316 of file stm32l4xx_ll_usb.c.
HAL_StatusTypeDef USB_HostInit | ( | USB_OTG_GlobalTypeDef * | USBx, |
USB_OTG_CfgTypeDef | cfg | ||
) |
USB_HostInit : Initializes the USB OTG controller registers for Host mode.
- Parameters:
-
USBx,: Selected device cfg,: pointer to a USB_OTG_CfgTypeDef structure that contains the configuration information for the specified USBx peripheral.
- Return values:
-
HAL status
Definition at line 1033 of file stm32l4xx_ll_usb.c.
HAL_StatusTypeDef USB_InitFSLSPClkSel | ( | USB_OTG_GlobalTypeDef * | USBx, |
uint8_t | freq | ||
) |
USB_InitFSLSPClkSel : Initializes the FSLSPClkSel field of the HCFG register on the PHY type and set the right frame interval.
- Parameters:
-
USBx,: Selected device freq,: clock frequency This parameter can be one of these values: HCFG_48_MHZ : Full Speed 48 MHz Clock HCFG_6_MHZ : Low Speed 6 MHz Clock
- Return values:
-
HAL status
Definition at line 1102 of file stm32l4xx_ll_usb.c.
uint32_t USB_ReadDevAllInEpInterrupt | ( | USB_TypeDef * | USBx ) |
USB_ReadDevAllInEpInterrupt: return the USB device IN endpoints interrupt status.
- Parameters:
-
USBx : Selected device
- Return values:
-
HAL status
Definition at line 2164 of file stm32l4xx_ll_usb.c.
uint32_t USB_ReadDevAllInEpInterrupt | ( | USB_OTG_GlobalTypeDef * | USBx ) |
USB_ReadDevAllInEpInterrupt: return the USB device IN endpoints interrupt status.
- Parameters:
-
USBx,: Selected device
- Return values:
-
HAL status
Definition at line 916 of file stm32l4xx_ll_usb.c.
uint32_t USB_ReadDevAllOutEpInterrupt | ( | USB_OTG_GlobalTypeDef * | USBx ) |
USB_ReadDevAllOutEpInterrupt: return the USB device OUT endpoints interrupt status.
- Parameters:
-
USBx,: Selected device
- Return values:
-
HAL status
Definition at line 903 of file stm32l4xx_ll_usb.c.
uint32_t USB_ReadDevAllOutEpInterrupt | ( | USB_TypeDef * | USBx ) |
USB_ReadDevAllOutEpInterrupt: return the USB device OUT endpoints interrupt status.
- Parameters:
-
USBx : Selected device
- Return values:
-
HAL status
Definition at line 2146 of file stm32l4xx_ll_usb.c.
uint32_t USB_ReadDevInEPInterrupt | ( | USB_TypeDef * | USBx, |
uint8_t | epnum | ||
) |
Returns Device IN EP Interrupt register.
- Parameters:
-
USBx : Selected device epnum : endpoint number This parameter can be a value from 0 to 15
- Return values:
-
Device IN EP Interrupt register
Definition at line 2205 of file stm32l4xx_ll_usb.c.
uint32_t USB_ReadDevInEPInterrupt | ( | USB_OTG_GlobalTypeDef * | USBx, |
uint8_t | epnum | ||
) |
Returns Device IN EP Interrupt register.
- Parameters:
-
USBx,: Selected device epnum,: endpoint number This parameter can be a value from 0 to 15
- Return values:
-
Device IN EP Interrupt register
Definition at line 946 of file stm32l4xx_ll_usb.c.
uint32_t USB_ReadDevOutEPInterrupt | ( | USB_TypeDef * | USBx, |
uint8_t | epnum | ||
) |
Returns Device OUT EP Interrupt register.
- Parameters:
-
USBx : Selected device epnum : endpoint number This parameter can be a value from 0 to 15
- Return values:
-
Device OUT EP Interrupt register
Definition at line 2184 of file stm32l4xx_ll_usb.c.
uint32_t USB_ReadDevOutEPInterrupt | ( | USB_OTG_GlobalTypeDef * | USBx, |
uint8_t | epnum | ||
) |
Returns Device OUT EP Interrupt register.
- Parameters:
-
USBx,: Selected device epnum,: endpoint number This parameter can be a value from 0 to 15
- Return values:
-
Device OUT EP Interrupt register
Definition at line 931 of file stm32l4xx_ll_usb.c.
uint32_t USB_ReadInterrupts | ( | USB_TypeDef * | USBx ) |
USB_ReadInterrupts: return the global USB interrupt status.
- Parameters:
-
USBx : Selected device
- Return values:
-
HAL status
Definition at line 2133 of file stm32l4xx_ll_usb.c.
uint32_t USB_ReadInterrupts | ( | USB_OTG_GlobalTypeDef * | USBx ) |
USB_ReadInterrupts: return the global USB interrupt status.
- Parameters:
-
USBx,: Selected device
- Return values:
-
HAL status
Definition at line 889 of file stm32l4xx_ll_usb.c.
void* USB_ReadPacket | ( | USB_OTG_GlobalTypeDef * | USBx, |
uint8_t * | dest, | ||
uint16_t | len | ||
) |
USB_ReadPacket : read a packet from the Tx FIFO associated with the EP/channel.
- Parameters:
-
USBx,: Selected device src,: source pointer ch_ep_num,: endpoint or host channel number len,: Number of bytes to read dma,: USB dma enabled or disabled This parameter can be one of these values: 0 : DMA feature not used 1 : DMA feature used
- Return values:
-
pointer to destination buffer
Definition at line 746 of file stm32l4xx_ll_usb.c.
void* USB_ReadPacket | ( | USB_TypeDef * | USBx, |
uint8_t * | dest, | ||
uint16_t | len | ||
) |
USB_ReadPacket : read a packet from the Tx FIFO associated with the EP/channel.
- Parameters:
-
USBx : Selected device dest : destination pointer len : Number of bytes to read
- Return values:
-
pointer to destination buffer
Definition at line 2002 of file stm32l4xx_ll_usb.c.
void USB_ReadPMA | ( | USB_TypeDef * | USBx, |
uint8_t * | pbUsrBuf, | ||
uint16_t | wPMABufAddr, | ||
uint16_t | wNBytes | ||
) |
Copy a buffer from user memory area to packet memory area (PMA)
- Parameters:
-
USBx : pointer to USB register. pbUsrBuf : pointer to user memory area. wPMABufAddr : address into PMA. wNBytes : number of bytes to be copied.
- Return values:
-
None
Definition at line 2314 of file stm32l4xx_ll_usb.c.
HAL_StatusTypeDef USB_ResetPort | ( | USB_OTG_GlobalTypeDef * | USBx ) |
USB_OTG_ResetPort : Reset Host Port.
- Parameters:
-
USBx,: Selected device
- Return values:
-
HAL status
- Note:
- (1)The application must wait at least 10 ms before clearing the reset bit.
Definition at line 1125 of file stm32l4xx_ll_usb.c.
HAL_StatusTypeDef USB_SetCurrentMode | ( | USB_TypeDef * | USBx, |
USB_ModeTypeDef | mode | ||
) |
USB_SetCurrentMode : Set functional mode.
- Parameters:
-
USBx : Selected device mode : current core mode This parameter can be one of the these values: - USB_DEVICE_MODE: Peripheral mode mode
- Return values:
-
HAL status
Definition at line 1663 of file stm32l4xx_ll_usb.c.
HAL_StatusTypeDef USB_SetCurrentMode | ( | USB_OTG_GlobalTypeDef * | USBx, |
USB_ModeTypeDef | mode | ||
) |
USB_SetCurrentMode : Set functional mode.
- Parameters:
-
USBx,: Selected device mode,: current core mode This parameter can be one of these values: - USB_OTG_DEVICE_MODE: Peripheral mode
- USB_OTG_HOST_MODE: Host mode
- USB_OTG_DRD_MODE: Dual Role Device mode
- Return values:
-
HAL status
Definition at line 175 of file stm32l4xx_ll_usb.c.
HAL_StatusTypeDef USB_SetDevAddress | ( | USB_TypeDef * | USBx, |
uint8_t | address | ||
) |
USB_SetDevAddress : Stop the usb device mode.
- Parameters:
-
USBx : Selected device address : new device address to be assigned This parameter can be a value from 0 to 255
- Return values:
-
HAL status
Definition at line 2091 of file stm32l4xx_ll_usb.c.
HAL_StatusTypeDef USB_SetDevAddress | ( | USB_OTG_GlobalTypeDef * | USBx, |
uint8_t | address | ||
) |
USB_SetDevAddress : Stop the USB device mode.
- Parameters:
-
USBx,: Selected device address,: new device address to be assigned This parameter can be a value from 0 to 255
- Return values:
-
HAL status
Definition at line 850 of file stm32l4xx_ll_usb.c.
HAL_StatusTypeDef USB_SetDevSpeed | ( | USB_OTG_GlobalTypeDef * | USBx, |
uint8_t | speed | ||
) |
USB_SetDevSpeed :Initializes the DevSpd field of DCFG register depending the PHY type and the enumeration speed of the device.
- Parameters:
-
USBx,: Selected device speed,: device speed This parameter can be one of these values: - USB_OTG_SPEED_HIGH: High speed mode
- USB_OTG_SPEED_HIGH_IN_FULL: High speed core in Full Speed mode
- USB_OTG_SPEED_FULL: Full speed mode
- USB_OTG_SPEED_LOW: Low speed mode
- Return values:
-
Hal status
Definition at line 371 of file stm32l4xx_ll_usb.c.
HAL_StatusTypeDef USB_StopDevice | ( | USB_OTG_GlobalTypeDef * | USBx ) |
USB_StopDevice : Stop the USB device mode.
- Parameters:
-
USBx,: Selected device
- Return values:
-
HAL status
Definition at line 819 of file stm32l4xx_ll_usb.c.
HAL_StatusTypeDef USB_StopDevice | ( | USB_TypeDef * | USBx ) |
USB_StopDevice : Stop the usb device mode.
- Parameters:
-
USBx : Selected device
- Return values:
-
HAL status
Definition at line 2070 of file stm32l4xx_ll_usb.c.
HAL_StatusTypeDef USB_StopHost | ( | USB_OTG_GlobalTypeDef * | USBx ) |
Stop Host Core.
- Parameters:
-
USBx,: Selected device
- Return values:
-
HAL state
Definition at line 1511 of file stm32l4xx_ll_usb.c.
HAL_StatusTypeDef USB_WritePacket | ( | USB_TypeDef * | USBx, |
uint8_t * | src, | ||
uint8_t | ch_ep_num, | ||
uint16_t | len | ||
) |
USB_WritePacket : Writes a packet into the Tx FIFO associated with the EP/channel.
- Parameters:
-
USBx : Selected device src : pointer to source buffer ch_ep_num : endpoint or host channel number len : Number of bytes to write
- Return values:
-
HAL status
Definition at line 1978 of file stm32l4xx_ll_usb.c.
HAL_StatusTypeDef USB_WritePacket | ( | USB_OTG_GlobalTypeDef * | USBx, |
uint8_t * | src, | ||
uint8_t | ch_ep_num, | ||
uint16_t | len, | ||
uint8_t | dma | ||
) |
USB_WritePacket : Writes a packet into the Tx FIFO associated with the EP/channel.
- Parameters:
-
USBx,: Selected device src,: pointer to source buffer ch_ep_num,: endpoint or host channel number len,: Number of bytes to write dma,: USB dma enabled or disabled This parameter can be one of these values: 0 : DMA feature not used 1 : DMA feature used
- Return values:
-
HAL status
Definition at line 722 of file stm32l4xx_ll_usb.c.
void USB_WritePMA | ( | USB_TypeDef * | USBx, |
uint8_t * | pbUsrBuf, | ||
uint16_t | wPMABufAddr, | ||
uint16_t | wNBytes | ||
) |
Copy a buffer from user memory area to packet memory area (PMA)
- Parameters:
-
USBx : pointer to USB register. pbUsrBuf : pointer to user memory area. wPMABufAddr : address into PMA. wNBytes : number of bytes to be copied.
- Return values:
-
None
Definition at line 2288 of file stm32l4xx_ll_usb.c.
Generated on Tue Jul 12 2022 11:00:18 by
