L4 HAL Drivers

Embed: (wiki syntax)

« Back to documentation index

USB_Core

Data Structures

struct  USB_OTG_CfgTypeDef
 PCD Initialization Structure definition. More...

Modules

 PCD Exported Constants

Enumerations

enum  USB_OTG_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_OTG_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.

Enumeration Type Documentation

Host channel States definition.

Definition at line 88 of file stm32l4xx_ll_usb.h.

USB Mode definition.

Definition at line 64 of file stm32l4xx_ll_usb.h.

URB States definition.

Definition at line 75 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:
HALstatus

Definition at line 424 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:
HALstatus

Definition at line 393 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:
HALstatus

Definition at line 997 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 973 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:
HALstatus

Definition at line 103 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:
HALstatus

Definition at line 491 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:
HALstatus

Definition at line 467 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:
HALstatus

Definition at line 873 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:
HALstatus

Definition at line 886 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:
HALstatus

Definition at line 180 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:
HALstatus

Definition at line 139 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:
HALstate

Definition at line 1541 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:
HALstatus

Definition at line 1202 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:
HALstatus

Definition at line 126 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:
HALstatus

Definition at line 1022 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:
HALstatus

Definition at line 639 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:
HALstatus

Definition at line 803 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:
HALstatus

Definition at line 775 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:
HALstatus

Definition at line 517 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:
HALstatus

Definition at line 321 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:
HALstatus

Definition at line 297 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:
currentframe number

Definition at line 1243 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 366 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 1230 of file stm32l4xx_ll_usb.c.

uint32_t USB_GetMode ( USB_OTG_GlobalTypeDef *  USBx )

Returns USB core mode.

Parameters:
USBx,:Selected device
Return values:
returncore mode : Host or Device This parameter can be one of these values: 0 : Host 1 : Device

Definition at line 986 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:
HALstate

Definition at line 1479 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:
HALstate

Definition at line 1272 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:
HALstate

Definition at line 1467 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:
HALstate

Definition at line 1370 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:
HALstatus

Definition at line 1084 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:
HALstatus

Definition at line 1156 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:
HALstatus

Definition at line 926 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:
HALstatus

Definition at line 913 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:
DeviceIN EP Interrupt register

Definition at line 956 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:
DeviceOUT EP Interrupt register

Definition at line 941 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:
HALstatus

Definition at line 899 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:
pointerto destination buffer

Definition at line 756 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:
HALstatus
Note:
(1)The application must wait at least 10 ms before clearing the reset bit.

Definition at line 1179 of file stm32l4xx_ll_usb.c.

HAL_StatusTypeDef USB_SetCurrentMode ( USB_OTG_GlobalTypeDef *  USBx,
USB_OTG_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:
HALstatus

Definition at line 155 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:
HALstatus

Definition at line 860 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:
Halstatus

Definition at line 351 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:
HALstatus

Definition at line 829 of file stm32l4xx_ll_usb.c.

HAL_StatusTypeDef USB_StopHost ( USB_OTG_GlobalTypeDef *  USBx )

Stop Host Core.

Parameters:
USBx,:Selected device
Return values:
HALstate

Definition at line 1563 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:
HALstatus

Definition at line 728 of file stm32l4xx_ll_usb.c.