STM32L486xx HAL User Manual
Functions
Input and Output operation functions
HCD Exported Functions

HCD IO operation functions. More...

Functions

HAL_StatusTypeDef HAL_HCD_HC_SubmitRequest (HCD_HandleTypeDef *hhcd, uint8_t ch_num, uint8_t direction, uint8_t ep_type, uint8_t token, uint8_t *pbuff, uint16_t length, uint8_t do_ping)
 Submit a new URB for processing.
void HAL_HCD_IRQHandler (HCD_HandleTypeDef *hhcd)
 Handle HCD interrupt request.
__weak void HAL_HCD_SOF_Callback (HCD_HandleTypeDef *hhcd)
 SOF callback.
__weak void HAL_HCD_Connect_Callback (HCD_HandleTypeDef *hhcd)
 Connection Event callback.
__weak void HAL_HCD_Disconnect_Callback (HCD_HandleTypeDef *hhcd)
 Disconnection Event callback.
__weak void HAL_HCD_PortEnabled_Callback (HCD_HandleTypeDef *hhcd)
 Port Enabled Event callback.
__weak void HAL_HCD_PortDisabled_Callback (HCD_HandleTypeDef *hhcd)
 Port Disabled Event callback.
__weak void HAL_HCD_HC_NotifyURBChange_Callback (HCD_HandleTypeDef *hhcd, uint8_t chnum, HCD_URBStateTypeDef urb_state)
 Notify URB state change callback.
HAL_StatusTypeDef HAL_HCD_RegisterCallback (HCD_HandleTypeDef *hhcd, HAL_HCD_CallbackIDTypeDef CallbackID, pHCD_CallbackTypeDef pCallback)
 Register a User USB HCD Callback To be used instead of the weak predefined callback.
HAL_StatusTypeDef HAL_HCD_UnRegisterCallback (HCD_HandleTypeDef *hhcd, HAL_HCD_CallbackIDTypeDef CallbackID)
 Unregister an USB HCD Callback USB HCD callabck is redirected to the weak predefined callback.
HAL_StatusTypeDef HAL_HCD_RegisterHC_NotifyURBChangeCallback (HCD_HandleTypeDef *hhcd, pHCD_HC_NotifyURBChangeCallbackTypeDef pCallback)
 Register USB HCD Host Channel Notify URB Change Callback To be used instead of the weak HAL_HCD_HC_NotifyURBChange_Callback() predefined callback.
HAL_StatusTypeDef HAL_HCD_UnRegisterHC_NotifyURBChangeCallback (HCD_HandleTypeDef *hhcd)
 UnRegister the USB HCD Host Channel Notify URB Change Callback USB HCD Host Channel Notify URB Change Callback is redirected to the weak HAL_HCD_HC_NotifyURBChange_Callback() predefined callback.

Detailed Description

HCD IO operation functions.

 ===============================================================================
                      ##### IO operation functions #####
 ===============================================================================
 [..] This subsection provides a set of functions allowing to manage the USB Host Data
    Transfer


Function Documentation

Connection Event callback.

Parameters:
hhcdHCD handle
Return values:
None

Definition at line 627 of file stm32l4xx_hal_hcd.c.

Referenced by HAL_HCD_Init(), HAL_HCD_UnRegisterCallback(), and HCD_Port_IRQHandler().

Disconnection Event callback.

Parameters:
hhcdHCD handle
Return values:
None

Definition at line 642 of file stm32l4xx_hal_hcd.c.

Referenced by HAL_HCD_Init(), HAL_HCD_IRQHandler(), and HAL_HCD_UnRegisterCallback().

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. This parameter can be a value from 1 to 15
urb_state,:This parameter can be one of these values: URB_IDLE/ URB_DONE/ URB_NOTREADY/ URB_NYET/ URB_ERROR/ URB_STALL/
Return values:
None

Definition at line 697 of file stm32l4xx_hal_hcd.c.

Referenced by HAL_HCD_Init(), HAL_HCD_UnRegisterHC_NotifyURBChangeCallback(), HCD_HC_IN_IRQHandler(), and HCD_HC_OUT_IRQHandler().

HAL_StatusTypeDef HAL_HCD_HC_SubmitRequest ( HCD_HandleTypeDef hhcd,
uint8_t  ch_num,
uint8_t  direction,
uint8_t  ep_type,
uint8_t  token,
uint8_t *  pbuff,
uint16_t  length,
uint8_t  do_ping 
)

Submit a new URB for processing.

Parameters:
hhcdHCD handle
ch_numChannel number. This parameter can be a value from 1 to 15
directionChannel number. This parameter can be one of these values: 0 : Output / 1 : Input
ep_typeEndpoint 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/
tokenEndpoint Type. This parameter can be one of these values: 0: HC_PID_SETUP / 1: HC_PID_DATA1
pbuffpointer to URB data
lengthLength of URB data
do_pingactivate do ping protocol (for high speed only). This parameter can be one of these values: 0 : do ping inactive / 1 : do ping active
Return values:
HALstatus

Definition at line 370 of file stm32l4xx_hal_hcd.c.

References __HCD_HandleTypeDef::hc, and __HCD_HandleTypeDef::Instance.

Port Disabled Event callback.

Parameters:
hhcdHCD handle
Return values:
None

Definition at line 672 of file stm32l4xx_hal_hcd.c.

Referenced by HAL_HCD_Init(), HAL_HCD_UnRegisterCallback(), and HCD_Port_IRQHandler().

Port Enabled Event callback.

Parameters:
hhcdHCD handle
Return values:
None

Definition at line 657 of file stm32l4xx_hal_hcd.c.

Referenced by HAL_HCD_Init(), HAL_HCD_UnRegisterCallback(), and HCD_Port_IRQHandler().

HAL_StatusTypeDef HAL_HCD_RegisterCallback ( HCD_HandleTypeDef hhcd,
HAL_HCD_CallbackIDTypeDef  CallbackID,
pHCD_CallbackTypeDef  pCallback 
)

Register a User USB HCD Callback To be used instead of the weak predefined callback.

Parameters:
hhcdUSB HCD handle
CallbackIDID of the callback to be registered This parameter can be one of the following values:
pCallbackpointer to the Callback function
Return values:
HALstatus

Definition at line 726 of file stm32l4xx_hal_hcd.c.

References __HCD_HandleTypeDef::ConnectCallback, __HCD_HandleTypeDef::DisconnectCallback, __HCD_HandleTypeDef::ErrorCode, HAL_HCD_CONNECT_CB_ID, HAL_HCD_DISCONNECT_CB_ID, HAL_HCD_ERROR_INVALID_CALLBACK, HAL_HCD_MSPDEINIT_CB_ID, HAL_HCD_MSPINIT_CB_ID, HAL_HCD_PORT_DISABLED_CB_ID, HAL_HCD_PORT_ENABLED_CB_ID, HAL_HCD_SOF_CB_ID, HAL_HCD_STATE_READY, HAL_HCD_STATE_RESET, __HCD_HandleTypeDef::MspDeInitCallback, __HCD_HandleTypeDef::MspInitCallback, __HCD_HandleTypeDef::PortDisabledCallback, __HCD_HandleTypeDef::PortEnabledCallback, __HCD_HandleTypeDef::SOFCallback, and __HCD_HandleTypeDef::State.

Register USB HCD Host Channel Notify URB Change Callback To be used instead of the weak HAL_HCD_HC_NotifyURBChange_Callback() predefined callback.

Parameters:
hhcdHCD handle
pCallbackpointer to the USB HCD Host Channel Notify URB Change Callback function
Return values:
HALstatus

Definition at line 918 of file stm32l4xx_hal_hcd.c.

References __HCD_HandleTypeDef::ErrorCode, HAL_HCD_ERROR_INVALID_CALLBACK, HAL_HCD_STATE_READY, __HCD_HandleTypeDef::HC_NotifyURBChangeCallback, and __HCD_HandleTypeDef::State.

SOF callback.

Parameters:
hhcdHCD handle
Return values:
None

Definition at line 612 of file stm32l4xx_hal_hcd.c.

Referenced by HAL_HCD_Init(), HAL_HCD_IRQHandler(), and HAL_HCD_UnRegisterCallback().

HAL_StatusTypeDef HAL_HCD_UnRegisterCallback ( HCD_HandleTypeDef hhcd,
HAL_HCD_CallbackIDTypeDef  CallbackID 
)

UnRegister the USB HCD Host Channel Notify URB Change Callback USB HCD Host Channel Notify URB Change Callback is redirected to the weak HAL_HCD_HC_NotifyURBChange_Callback() predefined callback.

Parameters:
hhcdHCD handle
Return values:
HALstatus

Definition at line 958 of file stm32l4xx_hal_hcd.c.

References __HCD_HandleTypeDef::ErrorCode, HAL_HCD_ERROR_INVALID_CALLBACK, HAL_HCD_HC_NotifyURBChange_Callback(), HAL_HCD_STATE_READY, __HCD_HandleTypeDef::HC_NotifyURBChangeCallback, and __HCD_HandleTypeDef::State.