WebRadioApp  0.1
USB_HOST
Collaboration diagram for USB_HOST:

Modules

 USBH_OTG_DRIVER
 
 STM32_USB_HOST_LIBRARY
 

Functions

static void USBH_UserProcess (USBH_HandleTypeDef *phost, uint8_t id)
 
void MX_USB_HOST_Init (void)
 USB Host initialization function. More...
 
void MX_USB_HOST_Process (void)
 
void Error_Handler (void)
 This function is executed in case of error occurrence. More...
 
USBH_StatusTypeDef USBH_Get_USB_Status (HAL_StatusTypeDef hal_status)
 Retuns the USB status depending on the HAL status: More...
 
void HAL_HCD_MspInit (HCD_HandleTypeDef *hcdHandle)
 
void HAL_HCD_MspDeInit (HCD_HandleTypeDef *hcdHandle)
 
void HAL_HCD_SOF_Callback (HCD_HandleTypeDef *hhcd)
 SOF callback. More...
 
void HAL_HCD_Connect_Callback (HCD_HandleTypeDef *hhcd)
 SOF callback. More...
 
void HAL_HCD_Disconnect_Callback (HCD_HandleTypeDef *hhcd)
 SOF callback. More...
 
void HAL_HCD_HC_NotifyURBChange_Callback (HCD_HandleTypeDef *hhcd, uint8_t chnum, HCD_URBStateTypeDef urb_state)
 Notify URB state change callback. More...
 
void HAL_HCD_PortEnabled_Callback (HCD_HandleTypeDef *hhcd)
 Port Port Enabled callback. More...
 
void HAL_HCD_PortDisabled_Callback (HCD_HandleTypeDef *hhcd)
 Port Port Disabled callback. More...
 
USBH_StatusTypeDef USBH_LL_Init (USBH_HandleTypeDef *phost)
 Initialize the low level portion of the host driver. More...
 
USBH_StatusTypeDef USBH_LL_DeInit (USBH_HandleTypeDef *phost)
 De-Initialize the low level portion of the host driver. More...
 
USBH_StatusTypeDef USBH_LL_Start (USBH_HandleTypeDef *phost)
 Start the low level portion of the host driver. More...
 
USBH_StatusTypeDef USBH_LL_Stop (USBH_HandleTypeDef *phost)
 Stop the low level portion of the host driver. More...
 
USBH_SpeedTypeDef USBH_LL_GetSpeed (USBH_HandleTypeDef *phost)
 Return the USB host speed from the low level driver. More...
 
USBH_StatusTypeDef USBH_LL_ResetPort (USBH_HandleTypeDef *phost)
 Reset the Host port of the low level driver. More...
 
uint32_t USBH_LL_GetLastXferSize (USBH_HandleTypeDef *phost, uint8_t pipe)
 Return the last transfered packet size. More...
 
USBH_StatusTypeDef USBH_LL_OpenPipe (USBH_HandleTypeDef *phost, uint8_t pipe_num, uint8_t epnum, uint8_t dev_address, uint8_t speed, uint8_t ep_type, uint16_t mps)
 Open a pipe of the low level driver. More...
 
USBH_StatusTypeDef USBH_LL_ClosePipe (USBH_HandleTypeDef *phost, uint8_t pipe)
 Close a pipe of the low level driver. More...
 
USBH_StatusTypeDef USBH_LL_SubmitURB (USBH_HandleTypeDef *phost, uint8_t pipe, uint8_t direction, uint8_t ep_type, uint8_t token, uint8_t *pbuff, uint16_t length, uint8_t do_ping)
 Submit a new URB to the low level driver. More...
 
USBH_URBStateTypeDef USBH_LL_GetURBState (USBH_HandleTypeDef *phost, uint8_t pipe)
 Get a URB state from the low level driver. More...
 
USBH_StatusTypeDef USBH_LL_DriverVBUS (USBH_HandleTypeDef *phost, uint8_t state)
 Drive VBUS. More...
 
USBH_StatusTypeDef USBH_LL_SetToggle (USBH_HandleTypeDef *phost, uint8_t pipe, uint8_t toggle)
 Set toggle for a pipe. More...
 
uint8_t USBH_LL_GetToggle (USBH_HandleTypeDef *phost, uint8_t pipe)
 Return the current toggle of a pipe. More...
 
void USBH_Delay (uint32_t Delay)
 Delay routine for the USB Host Library. More...
 
void MX_DriverVbusHS (uint8_t state)
 Drive VBUS. More...
 

Variables

USBH_HandleTypeDef hUsbHostHS
 
ApplicationTypeDef Appli_state = APPLICATION_IDLE
 
HCD_HandleTypeDef hhcd_USB_OTG_HS
 

Detailed Description

Function Documentation

◆ Error_Handler()

void Error_Handler ( void  )

This function is executed in case of error occurrence.

Return values
None
Here is the caller graph for this function:

◆ HAL_HCD_Connect_Callback()

void HAL_HCD_Connect_Callback ( HCD_HandleTypeDef *  hhcd)

SOF callback.

Parameters
hhcdHCD handle
Return values
None

◆ HAL_HCD_Disconnect_Callback()

void HAL_HCD_Disconnect_Callback ( HCD_HandleTypeDef *  hhcd)

SOF callback.

Parameters
hhcdHCD handle
Return values
None

◆ HAL_HCD_HC_NotifyURBChange_Callback()

void HAL_HCD_HC_NotifyURBChange_Callback ( HCD_HandleTypeDef *  hhcd,
uint8_t  chnum,
HCD_URBStateTypeDef  urb_state 
)

Notify URB state change callback.

Parameters
hhcdHCD handle
chnumchannel number
urb_statestate
Return values
None

◆ HAL_HCD_MspDeInit()

void HAL_HCD_MspDeInit ( HCD_HandleTypeDef *  hcdHandle)

USB_OTG_HS GPIO Configuration PB5 ---—> USB_OTG_HS_ULPI_D7 PI11 ---—> USB_OTG_HS_ULPI_DIR PC0 ---—> USB_OTG_HS_ULPI_STP PH4 ---—> USB_OTG_HS_ULPI_NXT PB10 ---—> USB_OTG_HS_ULPI_D3 PB11 ---—> USB_OTG_HS_ULPI_D4 PA5 ---—> USB_OTG_HS_ULPI_CK PB1 ---—> USB_OTG_HS_ULPI_D2 PB12 ---—> USB_OTG_HS_ULPI_D5 PA3 ---—> USB_OTG_HS_ULPI_D0 PB0 ---—> USB_OTG_HS_ULPI_D1 PB13 ---—> USB_OTG_HS_ULPI_D6

◆ HAL_HCD_MspInit()

void HAL_HCD_MspInit ( HCD_HandleTypeDef *  hcdHandle)

USB_OTG_HS GPIO Configuration PB5 ---—> USB_OTG_HS_ULPI_D7 PI11 ---—> USB_OTG_HS_ULPI_DIR PC0 ---—> USB_OTG_HS_ULPI_STP PH4 ---—> USB_OTG_HS_ULPI_NXT PB10 ---—> USB_OTG_HS_ULPI_D3 PB11 ---—> USB_OTG_HS_ULPI_D4 PA5 ---—> USB_OTG_HS_ULPI_CK PB1 ---—> USB_OTG_HS_ULPI_D2 PB12 ---—> USB_OTG_HS_ULPI_D5 PA3 ---—> USB_OTG_HS_ULPI_D0 PB0 ---—> USB_OTG_HS_ULPI_D1 PB13 ---—> USB_OTG_HS_ULPI_D6

◆ HAL_HCD_PortDisabled_Callback()

void HAL_HCD_PortDisabled_Callback ( HCD_HandleTypeDef *  hhcd)

Port Port Disabled callback.

Parameters
hhcdHCD handle
Return values
None

◆ HAL_HCD_PortEnabled_Callback()

void HAL_HCD_PortEnabled_Callback ( HCD_HandleTypeDef *  hhcd)

Port Port Enabled callback.

Parameters
hhcdHCD handle
Return values
None

◆ HAL_HCD_SOF_Callback()

void HAL_HCD_SOF_Callback ( HCD_HandleTypeDef *  hhcd)

SOF callback.

Parameters
hhcdHCD handle
Return values
None

◆ MX_DriverVbusHS()

void MX_DriverVbusHS ( uint8_t  state)

Drive VBUS.

Parameters
state: VBUS state This parameter can be one of the these values:
  • 1 : VBUS Active
  • 0 : VBUS Inactive

References data.

Here is the caller graph for this function:

◆ MX_USB_HOST_Init()

void MX_USB_HOST_Init ( void  )

USB Host initialization function.

Init USB host library, add supported class and start the library

Return values
None

References Error_Handler(), HOST_HS, hUsbHostHS, and USBH_UserProcess().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MX_USB_HOST_Process()

void MX_USB_HOST_Process ( void  )

References hUsbHostHS.

Here is the caller graph for this function:

◆ USBH_Delay()

void USBH_Delay ( uint32_t  Delay)

Delay routine for the USB Host Library.

Parameters
DelayDelay in ms
Return values
None

◆ USBH_Get_USB_Status()

USBH_StatusTypeDef USBH_Get_USB_Status ( HAL_StatusTypeDef  hal_status)

Retuns the USB status depending on the HAL status:

Parameters
hal_statusHAL status
Return values
USBstatus
Here is the caller graph for this function:

◆ USBH_LL_ClosePipe()

USBH_StatusTypeDef USBH_LL_ClosePipe ( USBH_HandleTypeDef *  phost,
uint8_t  pipe 
)

Close a pipe of the low level driver.

Parameters
phostHost handle
pipePipe index
Return values
USBHstatus

References USBH_Get_USB_Status().

Here is the call graph for this function:

◆ USBH_LL_DeInit()

USBH_StatusTypeDef USBH_LL_DeInit ( USBH_HandleTypeDef *  phost)

De-Initialize the low level portion of the host driver.

Parameters
phostHost handle
Return values
USBHstatus

References USBH_Get_USB_Status().

Here is the call graph for this function:

◆ USBH_LL_DriverVBUS()

USBH_StatusTypeDef USBH_LL_DriverVBUS ( USBH_HandleTypeDef *  phost,
uint8_t  state 
)

Drive VBUS.

Parameters
phostHost handle
state: VBUS state This parameter can be one of the these values: 0 : VBUS Inactive 1 : VBUS Active
Return values
Status

References HOST_HS, and MX_DriverVbusHS().

Here is the call graph for this function:

◆ USBH_LL_GetLastXferSize()

uint32_t USBH_LL_GetLastXferSize ( USBH_HandleTypeDef *  phost,
uint8_t  pipe 
)

Return the last transfered packet size.

Parameters
phostHost handle
pipePipe index
Return values
Packetsize

◆ USBH_LL_GetSpeed()

USBH_SpeedTypeDef USBH_LL_GetSpeed ( USBH_HandleTypeDef *  phost)

Return the USB host speed from the low level driver.

Parameters
phostHost handle
Return values
USBHspeeds

◆ USBH_LL_GetToggle()

uint8_t USBH_LL_GetToggle ( USBH_HandleTypeDef *  phost,
uint8_t  pipe 
)

Return the current toggle of a pipe.

Parameters
phostHost handle
pipePipe index
Return values
toggle(0/1)

◆ USBH_LL_GetURBState()

USBH_URBStateTypeDef USBH_LL_GetURBState ( USBH_HandleTypeDef *  phost,
uint8_t  pipe 
)

Get a URB state from the low level driver.

Parameters
phostHost handle
pipePipe index This parameter can be a value from 1 to 15
Return values
URBstate This parameter can be one of the these values:
  • URB_IDLE
  • URB_DONE
  • URB_NOTREADY
  • URB_NYET
  • URB_ERROR
  • URB_STALL

◆ USBH_LL_Init()

USBH_StatusTypeDef USBH_LL_Init ( USBH_HandleTypeDef *  phost)

Initialize the low level portion of the host driver.

Parameters
phostHost handle
Return values
USBHstatus

References Error_Handler(), hhcd_USB_OTG_HS, and HOST_HS.

Here is the call graph for this function:

◆ USBH_LL_OpenPipe()

USBH_StatusTypeDef USBH_LL_OpenPipe ( USBH_HandleTypeDef *  phost,
uint8_t  pipe_num,
uint8_t  epnum,
uint8_t  dev_address,
uint8_t  speed,
uint8_t  ep_type,
uint16_t  mps 
)

Open a pipe of the low level driver.

Parameters
phostHost handle
pipe_numPipe index
epnumEndpoint number
dev_addressDevice USB address
speedDevice Speed
ep_typeEndpoint type
mpsEndpoint max packet size
Return values
USBHstatus

References USBH_Get_USB_Status().

Here is the call graph for this function:

◆ USBH_LL_ResetPort()

USBH_StatusTypeDef USBH_LL_ResetPort ( USBH_HandleTypeDef *  phost)

Reset the Host port of the low level driver.

Parameters
phostHost handle
Return values
USBHstatus

References USBH_Get_USB_Status().

Here is the call graph for this function:

◆ USBH_LL_SetToggle()

USBH_StatusTypeDef USBH_LL_SetToggle ( USBH_HandleTypeDef *  phost,
uint8_t  pipe,
uint8_t  toggle 
)

Set toggle for a pipe.

Parameters
phostHost handle
pipePipe index
toggletoggle (0/1)
Return values
Status

◆ USBH_LL_Start()

USBH_StatusTypeDef USBH_LL_Start ( USBH_HandleTypeDef *  phost)

Start the low level portion of the host driver.

Parameters
phostHost handle
Return values
USBHstatus

References USBH_Get_USB_Status().

Here is the call graph for this function:

◆ USBH_LL_Stop()

USBH_StatusTypeDef USBH_LL_Stop ( USBH_HandleTypeDef *  phost)

Stop the low level portion of the host driver.

Parameters
phostHost handle
Return values
USBHstatus

References USBH_Get_USB_Status().

Here is the call graph for this function:

◆ USBH_LL_SubmitURB()

USBH_StatusTypeDef USBH_LL_SubmitURB ( USBH_HandleTypeDef *  phost,
uint8_t  pipe,
uint8_t  direction,
uint8_t  ep_type,
uint8_t  token,
uint8_t *  pbuff,
uint16_t  length,
uint8_t  do_ping 
)

Submit a new URB to the low level driver.

Parameters
phostHost handle
pipePipe index This parameter can be a value from 1 to 15
direction: Channel number This parameter can be one of the these values: 0 : Output 1 : Input
ep_type: Endpoint Type This parameter can be one of the these values:
  • EP_TYPE_CTRL: Control type
  • EP_TYPE_ISOC: Isochrounous type
  • EP_TYPE_BULK: Bulk type
  • EP_TYPE_INTR: Interrupt type
token: Endpoint Type This parameter can be one of the these values:
  • 0: PID_SETUP
  • 1: PID_DATA
pbuff: pointer to URB data
length: Length of URB data
do_ping: activate do ping protocol (for high speed only) This parameter can be one of the these values: 0 : do ping inactive 1 : do ping active
Return values
Status

References USBH_Get_USB_Status().

Here is the call graph for this function:

◆ USBH_UserProcess()

static void USBH_UserProcess ( USBH_HandleTypeDef *  phost,
uint8_t  id 
)
static

References Appli_state, APPLICATION_DISCONNECT, APPLICATION_READY, and APPLICATION_START.

Here is the caller graph for this function:

Variable Documentation

◆ Appli_state

◆ hhcd_USB_OTG_HS

HCD_HandleTypeDef hhcd_USB_OTG_HS

◆ hUsbHostHS

USBH_HandleTypeDef hUsbHostHS