STM32L4xx_HAL_Driver  1.14.0
stm32l4xx_ll_usb.c File Reference

USB Low Layer HAL module driver. More...

Go to the source code of this file.

Functions

static HAL_StatusTypeDef USB_CoreReset (USB_OTG_GlobalTypeDef *USBx)
 Reset the USB Core (needed after USB clock settings change) More...
 
HAL_StatusTypeDef USB_CoreInit (USB_OTG_GlobalTypeDef *USBx, USB_OTG_CfgTypeDef cfg)
 Initializes the USB Core. More...
 
HAL_StatusTypeDef USB_SetTurnaroundTime (USB_OTG_GlobalTypeDef *USBx, uint32_t hclk, uint8_t speed)
 Set the USB turnaround time. More...
 
HAL_StatusTypeDef USB_EnableGlobalInt (USB_OTG_GlobalTypeDef *USBx)
 USB_EnableGlobalInt Enables the controller's Global Int in the AHB Config reg. More...
 
HAL_StatusTypeDef USB_DisableGlobalInt (USB_OTG_GlobalTypeDef *USBx)
 USB_DisableGlobalInt Disable the controller's Global Int in the AHB Config reg. More...
 
HAL_StatusTypeDef USB_SetCurrentMode (USB_OTG_GlobalTypeDef *USBx, USB_ModeTypeDef mode)
 USB_SetCurrentMode : Set functional mode. More...
 
HAL_StatusTypeDef USB_DevInit (USB_OTG_GlobalTypeDef *USBx, USB_OTG_CfgTypeDef cfg)
 USB_DevInit : Initializes the USB_OTG controller registers for device mode. More...
 
HAL_StatusTypeDef USB_FlushTxFifo (USB_OTG_GlobalTypeDef *USBx, uint32_t num)
 USB_OTG_FlushTxFifo : Flush a Tx FIFO. More...
 
HAL_StatusTypeDef USB_FlushRxFifo (USB_OTG_GlobalTypeDef *USBx)
 USB_FlushRxFifo : Flush Rx FIFO. More...
 
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. More...
 
uint8_t USB_GetDevSpeed (USB_OTG_GlobalTypeDef *USBx)
 USB_GetDevSpeed Return the Dev Speed. More...
 
HAL_StatusTypeDef USB_ActivateEndpoint (USB_OTG_GlobalTypeDef *USBx, USB_OTG_EPTypeDef *ep)
 Activate and configure an endpoint. More...
 
HAL_StatusTypeDef USB_ActivateDedicatedEndpoint (USB_OTG_GlobalTypeDef *USBx, USB_OTG_EPTypeDef *ep)
 Activate and configure a dedicated endpoint. More...
 
HAL_StatusTypeDef USB_DeactivateEndpoint (USB_OTG_GlobalTypeDef *USBx, USB_OTG_EPTypeDef *ep)
 De-activate and de-initialize an endpoint. More...
 
HAL_StatusTypeDef USB_DeactivateDedicatedEndpoint (USB_OTG_GlobalTypeDef *USBx, USB_OTG_EPTypeDef *ep)
 De-activate and de-initialize a dedicated endpoint. More...
 
HAL_StatusTypeDef USB_EPStartXfer (USB_OTG_GlobalTypeDef *USBx, USB_OTG_EPTypeDef *ep)
 USB_EPStartXfer : setup and starts a transfer over an EP. More...
 
HAL_StatusTypeDef USB_EP0StartXfer (USB_OTG_GlobalTypeDef *USBx, USB_OTG_EPTypeDef *ep)
 USB_EP0StartXfer : setup and starts a transfer over the EP 0. More...
 
HAL_StatusTypeDef USB_WritePacket (USB_OTG_GlobalTypeDef *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. More...
 
void * USB_ReadPacket (USB_OTG_GlobalTypeDef *USBx, uint8_t *dest, uint16_t len)
 USB_ReadPacket : read a packet from the RX FIFO. More...
 
HAL_StatusTypeDef USB_EPSetStall (USB_OTG_GlobalTypeDef *USBx, USB_OTG_EPTypeDef *ep)
 USB_EPSetStall : set a stall condition over an EP. More...
 
HAL_StatusTypeDef USB_EPClearStall (USB_OTG_GlobalTypeDef *USBx, USB_OTG_EPTypeDef *ep)
 USB_EPClearStall : Clear a stall condition over an EP. More...
 
HAL_StatusTypeDef USB_StopDevice (USB_OTG_GlobalTypeDef *USBx)
 USB_StopDevice : Stop the usb device mode. More...
 
HAL_StatusTypeDef USB_SetDevAddress (USB_OTG_GlobalTypeDef *USBx, uint8_t address)
 USB_SetDevAddress : Stop the usb device mode. More...
 
HAL_StatusTypeDef USB_DevConnect (USB_OTG_GlobalTypeDef *USBx)
 USB_DevConnect : Connect the USB device by enabling the pull-up/pull-down. More...
 
HAL_StatusTypeDef USB_DevDisconnect (USB_OTG_GlobalTypeDef *USBx)
 USB_DevDisconnect : Disconnect the USB device by disabling the pull-up/pull-down. More...
 
uint32_t USB_ReadInterrupts (USB_OTG_GlobalTypeDef *USBx)
 USB_ReadInterrupts: return the global USB interrupt status. More...
 
uint32_t USB_ReadDevAllOutEpInterrupt (USB_OTG_GlobalTypeDef *USBx)
 USB_ReadDevAllOutEpInterrupt: return the USB device OUT endpoints interrupt status. More...
 
uint32_t USB_ReadDevAllInEpInterrupt (USB_OTG_GlobalTypeDef *USBx)
 USB_ReadDevAllInEpInterrupt: return the USB device IN endpoints interrupt status. More...
 
uint32_t USB_ReadDevOutEPInterrupt (USB_OTG_GlobalTypeDef *USBx, uint8_t epnum)
 Returns Device OUT EP Interrupt register. More...
 
uint32_t USB_ReadDevInEPInterrupt (USB_OTG_GlobalTypeDef *USBx, uint8_t epnum)
 Returns Device IN EP Interrupt register. More...
 
void USB_ClearInterrupts (USB_OTG_GlobalTypeDef *USBx, uint32_t interrupt)
 USB_ClearInterrupts: clear a USB interrupt. More...
 
uint32_t USB_GetMode (USB_OTG_GlobalTypeDef *USBx)
 Returns USB core mode. More...
 
HAL_StatusTypeDef USB_ActivateSetup (USB_OTG_GlobalTypeDef *USBx)
 Activate EP0 for Setup transactions. More...
 
HAL_StatusTypeDef USB_EP0_OutStart (USB_OTG_GlobalTypeDef *USBx, uint8_t *psetup)
 Prepare the EP0 to start the first control setup. More...
 
HAL_StatusTypeDef USB_HostInit (USB_OTG_GlobalTypeDef *USBx, USB_OTG_CfgTypeDef cfg)
 USB_HostInit : Initializes the USB OTG controller registers for Host mode. More...
 
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. More...
 
HAL_StatusTypeDef USB_ResetPort (USB_OTG_GlobalTypeDef *USBx)
 USB_OTG_ResetPort : Reset Host Port. More...
 
HAL_StatusTypeDef USB_DriveVbus (USB_OTG_GlobalTypeDef *USBx, uint8_t state)
 USB_DriveVbus : activate or de-activate vbus. More...
 
uint32_t USB_GetHostSpeed (USB_OTG_GlobalTypeDef *USBx)
 Return Host Core speed. More...
 
uint32_t USB_GetCurrentFrame (USB_OTG_GlobalTypeDef *USBx)
 Return Host Current Frame number. More...
 
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. More...
 
HAL_StatusTypeDef USB_HC_StartXfer (USB_OTG_GlobalTypeDef *USBx, USB_OTG_HCTypeDef *hc)
 Start a transfer over a host channel. More...
 
uint32_t USB_HC_ReadInterrupt (USB_OTG_GlobalTypeDef *USBx)
 Read all host channel interrupts status. More...
 
HAL_StatusTypeDef USB_HC_Halt (USB_OTG_GlobalTypeDef *USBx, uint8_t hc_num)
 Halt a host channel. More...
 
HAL_StatusTypeDef USB_DoPing (USB_OTG_GlobalTypeDef *USBx, uint8_t ch_num)
 Initiate Do Ping protocol. More...
 
HAL_StatusTypeDef USB_StopHost (USB_OTG_GlobalTypeDef *USBx)
 Stop Host Core. More...
 
HAL_StatusTypeDef USB_ActivateRemoteWakeup (USB_OTG_GlobalTypeDef *USBx)
 USB_ActivateRemoteWakeup active remote wakeup signalling. More...
 
HAL_StatusTypeDef USB_DeActivateRemoteWakeup (USB_OTG_GlobalTypeDef *USBx)
 USB_DeActivateRemoteWakeup de-active remote wakeup signalling. More...
 
HAL_StatusTypeDef USB_CoreInit (USB_TypeDef *USBx, USB_CfgTypeDef cfg)
 Initializes the USB Core. More...
 
HAL_StatusTypeDef USB_EnableGlobalInt (USB_TypeDef *USBx)
 USB_EnableGlobalInt Enables the controller's Global Int in the AHB Config reg. More...
 
HAL_StatusTypeDef USB_DisableGlobalInt (USB_TypeDef *USBx)
 USB_DisableGlobalInt Disable the controller's Global Int in the AHB Config reg. More...
 
HAL_StatusTypeDef USB_SetCurrentMode (USB_TypeDef *USBx, USB_ModeTypeDef mode)
 USB_SetCurrentMode : Set functional mode. More...
 
HAL_StatusTypeDef USB_DevInit (USB_TypeDef *USBx, USB_CfgTypeDef cfg)
 USB_DevInit : Initializes the USB controller registers for device mode. More...
 
HAL_StatusTypeDef USB_SetDevSpeed (USB_TypeDef *USBx, uint8_t speed)
 USB_SetDevSpeed :Initializes the device speed depending on the PHY type and the enumeration speed of the device. More...
 
HAL_StatusTypeDef USB_FlushTxFifo (USB_TypeDef *USBx, uint32_t num)
 USB_FlushTxFifo : Flush a Tx FIFO. More...
 
HAL_StatusTypeDef USB_FlushRxFifo (USB_TypeDef *USBx)
 USB_FlushRxFifo : Flush Rx FIFO. More...
 
HAL_StatusTypeDef USB_ActivateEndpoint (USB_TypeDef *USBx, USB_EPTypeDef *ep)
 Activate and configure an endpoint. More...
 
HAL_StatusTypeDef USB_DeactivateEndpoint (USB_TypeDef *USBx, USB_EPTypeDef *ep)
 De-activate and de-initialize an endpoint. More...
 
HAL_StatusTypeDef USB_EPStartXfer (USB_TypeDef *USBx, USB_EPTypeDef *ep)
 USB_EPStartXfer : setup and starts a transfer over an EP. More...
 
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. More...
 
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. More...
 
HAL_StatusTypeDef USB_EPSetStall (USB_TypeDef *USBx, USB_EPTypeDef *ep)
 USB_EPSetStall : set a stall condition over an EP. More...
 
HAL_StatusTypeDef USB_EPClearStall (USB_TypeDef *USBx, USB_EPTypeDef *ep)
 USB_EPClearStall : Clear a stall condition over an EP. More...
 
HAL_StatusTypeDef USB_StopDevice (USB_TypeDef *USBx)
 USB_StopDevice : Stop the usb device mode. More...
 
HAL_StatusTypeDef USB_SetDevAddress (USB_TypeDef *USBx, uint8_t address)
 USB_SetDevAddress : Stop the usb device mode. More...
 
HAL_StatusTypeDef USB_DevConnect (USB_TypeDef *USBx)
 USB_DevConnect : Connect the USB device by enabling the pull-up/pull-down. More...
 
HAL_StatusTypeDef USB_DevDisconnect (USB_TypeDef *USBx)
 USB_DevDisconnect : Disconnect the USB device by disabling the pull-up/pull-down. More...
 
uint32_t USB_ReadInterrupts (USB_TypeDef *USBx)
 USB_ReadInterrupts: return the global USB interrupt status. More...
 
uint32_t USB_ReadDevAllOutEpInterrupt (USB_TypeDef *USBx)
 USB_ReadDevAllOutEpInterrupt: return the USB device OUT endpoints interrupt status. More...
 
uint32_t USB_ReadDevAllInEpInterrupt (USB_TypeDef *USBx)
 USB_ReadDevAllInEpInterrupt: return the USB device IN endpoints interrupt status. More...
 
uint32_t USB_ReadDevOutEPInterrupt (USB_TypeDef *USBx, uint8_t epnum)
 Returns Device OUT EP Interrupt register. More...
 
uint32_t USB_ReadDevInEPInterrupt (USB_TypeDef *USBx, uint8_t epnum)
 Returns Device IN EP Interrupt register. More...
 
void USB_ClearInterrupts (USB_TypeDef *USBx, uint32_t interrupt)
 USB_ClearInterrupts: clear a USB interrupt. More...
 
HAL_StatusTypeDef USB_EP0_OutStart (USB_TypeDef *USBx, uint8_t *psetup)
 Prepare the EP0 to start the first control setup. More...
 
HAL_StatusTypeDef USB_ActivateRemoteWakeup (USB_TypeDef *USBx)
 USB_ActivateRemoteWakeup : active remote wakeup signalling. More...
 
HAL_StatusTypeDef USB_DeActivateRemoteWakeup (USB_TypeDef *USBx)
 USB_DeActivateRemoteWakeup : de-active remote wakeup signalling. More...
 
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) More...
 
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) More...
 

Detailed Description

USB Low Layer HAL module driver.

Author
MCD Application Team This file provides firmware functions to manage the following functionalities of the USB Peripheral Controller:
  • Initialization/de-initialization functions
  • I/O operation functions
  • Peripheral Control functions
  • Peripheral State functions
==============================================================================
                  ##### How to use this driver #####
==============================================================================
  [..]
    (#) Fill parameters of Init structure in USB_OTG_CfgTypeDef structure.

    (#) Call USB_CoreInit() API to initialize the USB Core peripheral.

    (#) The upper HAL HCD/PCD driver will call the right routines for its internal processes.
Attention

© Copyright (c) 2017 STMicroelectronics. All rights reserved.

This software component is licensed by ST under BSD 3-Clause license, the "License"; You may not use this file except in compliance with the License. You may obtain a copy of the License at: opensource.org/licenses/BSD-3-Clause

Definition in file stm32l4xx_ll_usb.c.