HAL USB HCD Overview ¶
Introducing USB HCD ¶
- group HCD_Introduction
-
USB Host Controller Driver (HCD) hardware abstraction layer provides all required APIs to interface with the USB peripheral in host mode. It simplifies the initialization, configuration, and management of the USB depending on the user’s required host function.
This abstraction layer ensures portability and ease of use across different STM32 series. The HCD HAL abstracts different USB hardware instances that can be present (depending on the STM32 MCU): USB OTG FS (On-The-GO Full Speed) USB OTG HS (On-The-GO High Speed) USB DRD FS (Dual Role Device Full Speed)
Module and files ¶
The following diagram illustrates the HAL USB HCD module and its associated files.
Component diagram ¶
The following diagram illustrates the software components involved in the HAL USB HCD module. It shows the interactions between the user application, HAL drivers, low-level drivers, and the hardware components.
Configuration table ¶
The following table lists the configuration defines for the HAL USB HCD module, specifying their locations, default values, and descriptions:
- group HCD_Configuration_Table
-
¶
Configuration inside the USB HCD driver: ¶
Config defines
Description
Default value
Note
USE_ASSERT_DBG_PARAM
from IDE
NA
Enable the parameter assert.
USE_ASSERT_DBG_STATE
from IDE
NA
Enable the state assert.
USE_HAL_HCD_MODULE
from hal_conf.h
1
Enable the HAL USB HCD module.
USE_HAL_HCD_REGISTER_CALLBACKS
from hal_conf.h
0
Enable the register callbacks.
USE_HAL_HCD_MAX_CHANNEL_NB
from hal_conf.h
16
Maximum number of USB HCD channels.
USE_HAL_HCD_USB_EP_TYPE_ISOC
from hal_conf.h
1
Enable support for isochronous endpoints.
USE_HAL_HCD_USB_DOUBLE_BUFFER
from hal_conf.h
1
Enable double-buffering for USB transfers.
USE_HAL_HCD_USER_DATA
from hal_conf.h
0
Add user data to the HAL USB HCD handle.
USE_HAL_HCD_GET_LAST_ERRORS
from hal_conf.h
0
Add an error value to the HAL USB HCD handle.
USE_HAL_CHECK_PARAM
from hal_conf.h
0
Enable checking of HCD API parameters at runtime.