HAL LTDC How to Use

group LTDC_How_To_Use

How to use the LTDC HAL module driver

The LTDC HAL driver can be used as follows:

  • Declare a hal_ltdc_handle_t handle structure, for example: hal_ltdc_handle_t hltdc;

  • Initialize the LTDC low level resources :

    • Enable the LTDC interface clock (if not enabled in HAL_LTDC_Init() when USE_HAL_LTDC_CLK_ENABLE_MODEL set to HAL_CLK_ENABLE_NO)

    • Configure the LTDC clock source

    • NVIC configuration if you need to use interrupt process

      • Configure the LTDC interrupt priority

      • Enable the NVIC LTDC IRQ Channel

  • Use HAL_LTDC_Init() function to initialize the LTDC handle and associate the physical instance.

  • Configure the LTDC output timing synchronization using HAL_LTDC_SetConfig() function.

  • Configure the needed layer(s) using HAL_LTDC_SetConfigLayer() .

  • And finally start the LTDC display by calling HAL_LTDC_Start() .

Callback registration

When the compilation flag USE_HAL_LTDC_REGISTER_CALLBACKS is set to 1, use Functions HAL_LTDC_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.