STM32L4xx_HAL_Driver  1.14.0

Modules

 PCD Exported Constants
 
 USB Low Layer Exported Macros
 
 USB Low Layer Exported Functions
 

Data Structures

struct  USB_OTG_CfgTypeDef
 USB OTG Initialization Structure definition. More...
 
struct  USB_OTG_EPTypeDef
 
struct  USB_OTG_HCTypeDef
 
struct  USB_CfgTypeDef
 USB Initialization Structure definition. More...
 
struct  USB_EPTypeDef
 

Enumerations

enum  USB_ModeTypeDef { USB_DEVICE_MODE = 0, USB_HOST_MODE = 1, USB_DRD_MODE = 2, USB_DEVICE_MODE = 0 }
 USB Mode definition. More...
 
enum  USB_OTG_URBStateTypeDef {
  URB_IDLE = 0, URB_DONE, URB_NOTREADY, URB_NYET,
  URB_ERROR, URB_STALL
}
 URB States definition. More...
 
enum  USB_OTG_HCStateTypeDef {
  HC_IDLE = 0, HC_XFRC, HC_HALTED, HC_NAK,
  HC_NYET, HC_STALL, HC_XACTERR, HC_BBLERR,
  HC_DATATGLERR
}
 Host channel States definition. More...
 
enum  USB_ModeTypeDef { USB_DEVICE_MODE = 0, USB_HOST_MODE = 1, USB_DRD_MODE = 2, USB_DEVICE_MODE = 0 }
 

Detailed Description


Data Structure Documentation

◆ USB_OTG_CfgTypeDef

struct USB_OTG_CfgTypeDef

USB OTG Initialization Structure definition.

Definition at line 86 of file stm32l4xx_ll_usb.h.

Data Fields
uint32_t battery_charging_enable

Enable or disable Battery charging.

uint32_t dev_endpoints

Device Endpoints number. This parameter depends on the used USB core. This parameter must be a number between Min_Data = 1 and Max_Data = 15

uint32_t dma_enable

Enable or disable of the USB embedded DMA used only for OTG HS.

uint32_t ep0_mps

Set the Endpoint 0 Max Packet size.

uint32_t Host_channels

Host Channels number. This parameter Depends on the used USB core. This parameter must be a number between Min_Data = 1 and Max_Data = 15

uint32_t low_power_enable

Enable or disable the low power mode.

uint32_t lpm_enable

Enable or disable Link Power Management.

uint32_t phy_itface

Select the used PHY interface. This parameter can be any value of USB_Core_PHY_

uint32_t Sof_enable

Enable or disable the output of the SOF signal.

uint32_t speed

USB Core speed. This parameter can be any value of USB_Core_Speed_

uint32_t use_dedicated_ep1

Enable or disable the use of the dedicated EP1 interrupt.

uint32_t use_external_vbus

Enable or disable the use of the external VBUS.

uint32_t vbus_sensing_enable

Enable or disable the VBUS Sensing feature.

◆ USB_OTG_EPTypeDef

struct USB_OTG_EPTypeDef

Definition at line 121 of file stm32l4xx_ll_usb.h.

Data Fields
uint8_t data_pid_start

Initial data PID This parameter must be a number between Min_Data = 0 and Max_Data = 1

uint32_t dma_addr

32 bits aligned transfer buffer address

uint8_t even_odd_frame

IFrame parity This parameter must be a number between Min_Data = 0 and Max_Data = 1

uint8_t is_in

Endpoint direction This parameter must be a number between Min_Data = 0 and Max_Data = 1

uint8_t is_stall

Endpoint stall condition This parameter must be a number between Min_Data = 0 and Max_Data = 1

uint32_t maxpacket

Endpoint Max packet size This parameter must be a number between Min_Data = 0 and Max_Data = 64KB

uint8_t num

Endpoint number This parameter must be a number between Min_Data = 1 and Max_Data = 15

uint16_t tx_fifo_num

Transmission FIFO number This parameter must be a number between Min_Data = 1 and Max_Data = 15

uint8_t type

Endpoint type This parameter can be any value of USB_EP_Type_

uint8_t * xfer_buff

Pointer to transfer buffer

uint32_t xfer_count

Partial transfer length in case of multi packet transfer

uint32_t xfer_len

Current transfer length

◆ USB_OTG_HCTypeDef

struct USB_OTG_HCTypeDef

Definition at line 156 of file stm32l4xx_ll_usb.h.

Data Fields
uint8_t ch_num

Host channel number. This parameter must be a number between Min_Data = 1 and Max_Data = 15

uint8_t data_pid

Initial data PID. This parameter must be a number between Min_Data = 0 and Max_Data = 1

uint8_t dev_addr

USB device address. This parameter must be a number between Min_Data = 1 and Max_Data = 255

uint32_t dma_addr

32 bits aligned transfer buffer address.

uint8_t do_ping

Enable or disable the use of the PING protocol for HS mode.

uint8_t ep_is_in

Endpoint direction This parameter must be a number between Min_Data = 0 and Max_Data = 1

uint8_t ep_num

Endpoint number. This parameter must be a number between Min_Data = 1 and Max_Data = 15

uint8_t ep_type

Endpoint Type. This parameter can be any value of USB_EP_Type_

uint32_t ErrCnt

Host channel error count.

uint16_t max_packet

Endpoint Max packet size. This parameter must be a number between Min_Data = 0 and Max_Data = 64KB

uint8_t process_ping

Execute the PING protocol for HS mode.

uint8_t speed

USB Host speed. This parameter can be any value of USB_Core_Speed_

USB_OTG_HCStateTypeDef state

Host Channel state. This parameter can be any value of USB_OTG_HCStateTypeDef

uint8_t toggle_in

IN transfer current toggle flag. This parameter must be a number between Min_Data = 0 and Max_Data = 1

uint8_t toggle_out

OUT transfer current toggle flag This parameter must be a number between Min_Data = 0 and Max_Data = 1

USB_OTG_URBStateTypeDef urb_state

URB state. This parameter can be any value of USB_OTG_URBStateTypeDef

uint8_t * xfer_buff

Pointer to transfer buffer.

uint32_t xfer_count

Partial transfer length in case of multi packet transfer.

uint32_t xfer_len

Current transfer length.

◆ USB_CfgTypeDef

struct USB_CfgTypeDef

USB Initialization Structure definition.

Definition at line 220 of file stm32l4xx_ll_usb.h.

Data Fields
uint32_t battery_charging_enable

Enable or disable Battery charging.

uint32_t dev_endpoints

Device Endpoints number. This parameter depends on the used USB core. This parameter must be a number between Min_Data = 1 and Max_Data = 15

uint32_t ep0_mps

Set the Endpoint 0 Max Packet size.

uint32_t low_power_enable

Enable or disable Low Power mode

uint32_t lpm_enable

Enable or disable Battery charging.

uint32_t phy_itface

Select the used PHY interface. This parameter can be any value of USB_Core_PHY

uint32_t Sof_enable

Enable or disable the output of the SOF signal.

uint32_t speed

USB Core speed. This parameter can be any value of USB_Core_Speed

◆ USB_EPTypeDef

struct USB_EPTypeDef

Definition at line 243 of file stm32l4xx_ll_usb.h.

Data Fields
uint8_t data_pid_start

Initial data PID This parameter must be a number between Min_Data = 0 and Max_Data = 1

uint8_t doublebuffer

Double buffer enable This parameter can be 0 or 1

uint8_t is_in

Endpoint direction This parameter must be a number between Min_Data = 0 and Max_Data = 1

uint8_t is_stall

Endpoint stall condition This parameter must be a number between Min_Data = 0 and Max_Data = 1

uint32_t maxpacket

Endpoint Max packet size This parameter must be a number between Min_Data = 0 and Max_Data = 64KB

uint8_t num

Endpoint number This parameter must be a number between Min_Data = 1 and Max_Data = 15

uint16_t pmaaddr0

PMA Address0 This parameter can be any value between Min_addr = 0 and Max_addr = 1K

uint16_t pmaaddr1

PMA Address1 This parameter can be any value between Min_addr = 0 and Max_addr = 1K

uint16_t pmaadress

PMA Address This parameter can be any value between Min_addr = 0 and Max_addr = 1K

uint16_t tx_fifo_num

This parameter is not required by USB Device FS peripheral, it is used only by USB OTG FS peripheral This parameter is added to ensure compatibility across USB peripherals

uint8_t type

Endpoint type This parameter can be any value of USB_EP_Type

uint8_t * xfer_buff

Pointer to transfer buffer

uint32_t xfer_count

Partial transfer length in case of multi packet transfer

uint32_t xfer_len

Current transfer length

Enumeration Type Documentation

◆ USB_ModeTypeDef [1/2]

USB Mode definition.

Enumerator
USB_DEVICE_MODE 
USB_HOST_MODE 
USB_DRD_MODE 
USB_DEVICE_MODE 

Definition at line 47 of file stm32l4xx_ll_usb.h.

48 {
49  USB_DEVICE_MODE = 0,
50  USB_HOST_MODE = 1,
51  USB_DRD_MODE = 2
USB_ModeTypeDef
USB Mode definition.

◆ USB_ModeTypeDef [2/2]

Enumerator
USB_DEVICE_MODE 
USB_HOST_MODE 
USB_DRD_MODE 
USB_DEVICE_MODE 

Definition at line 212 of file stm32l4xx_ll_usb.h.

213 {
214  USB_DEVICE_MODE = 0
USB_ModeTypeDef
USB Mode definition.

◆ USB_OTG_HCStateTypeDef

Host channel States definition.

Enumerator
HC_IDLE 
HC_XFRC 
HC_HALTED 
HC_NAK 
HC_NYET 
HC_STALL 
HC_XACTERR 
HC_BBLERR 
HC_DATATGLERR 

Definition at line 70 of file stm32l4xx_ll_usb.h.

◆ USB_OTG_URBStateTypeDef

URB States definition.

Enumerator
URB_IDLE 
URB_DONE 
URB_NOTREADY 
URB_NYET 
URB_ERROR 
URB_STALL 

Definition at line 57 of file stm32l4xx_ll_usb.h.