HAL DSI How to Use ¶
- group DSI_How_To_Use
-
DSI peripheral overview ¶
-The DSI Host integrated inside STM32 microcontrollers provides a high-speed communication interface that allows the microcontroller to communicate with a display using a reduced pin count. This interface is fully configurable, making it easy to connect DSI displays available today on the market.
How to use this driver ¶
The HAL DSI driver can be used as follows: ¶
-
Declare a hal_dsi_handle_t handle structure, for example: hal_dsi_handle_t hdsi;
-
Initialize the DSI low level resources:
-
Enable the DSI interface clock (if not enabled in HAL_DSI_Init() when USE_HAL_DSI_CLK_ENABLE_MODEL set to HAL_CLK_ENABLE_NO)
-
Configure the DSI clock source
-
NVIC configuration if you need to use interrupt process
-
Configure the DSI interrupt priority
-
Enable the NVIC DSI IRQ Channel
-
-
-
Use HAL_DSI_Init() function to initialize the DSI handle and associate the physical instance.
-
Configure the DSI PLL, D_PHY band control, PHY parameters, and DSI clock parameters using the HAL_DSI_SetConfig()
-
Select the needed mode(s) as follows:
-
Configure the video mode using the HAL_DSI_SetConfigVideoMode() function
-
Configure the adapted command mode using the HAL_DSI_SetConfigAdaptedCommandMode() function
-
Configure the low power command using the HAL_DSI_SetConfigLPCommand () function
-
-
Configure the timings in the DSI HOST clock lane timer using the HAL_DSI_SetConfigPhyTimer () function
-
Configure the time-out using the HAL_DSI_SetConfigHostTimeouts() function
-
And finally start the DSI display by calling HAL_DSI_Start() .
Callback registration ¶
When the compilation flag USE_HAL_DSI_REGISTER_CALLBACKS is set to 1, use Functions HAL_DSI_RegisterXxxCallback() to register an interrupt callback.
When the compilation flag is set to 0 or not defined, the callback registration feature is not available and all callbacks are set to the corresponding weak functions.
-