Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
cubexHal.pdf
Скачиваний:
110
Добавлен:
10.02.2016
Размер:
16.16 Mб
Скачать

UM1725

HAL LTDC Generic Driver

__IO HAL_LTDC_StateTypeDef State

__IO uint32_t ErrorCode

Field Documentation

LTDC_TypeDef* LTDC_HandleTypeDef::Instance

LTDC Register base address

LTDC_InitTypeDef LTDC_HandleTypeDef::Init

LTDC parameters

LTDC_LayerCfgTypeDef LTDC_HandleTypeDef::LayerCfg[MAX_LAYER]

LTDC Layers parameters

HAL_LockTypeDef LTDC_HandleTypeDef::Lock

LTDC Lock

__IO HAL_LTDC_StateTypeDef LTDC_HandleTypeDef::State

LTDC state

__IO uint32_t LTDC_HandleTypeDef::ErrorCode

LTDC Error code

36.2LTDC Firmware driver API description

36.2.1How to use this driver

1.Program the required configuration through the following parameters: the LTDC timing, the horizontal and vertical polarity, the pixel clock polarity, Data Enable polarity and the LTDC background color value using HAL_LTDC_Init() function

2.Program the required configuration through the following parameters: the pixel format, the blending factors, input alpha value, the window size and the image size using HAL_LTDC_ConfigLayer() function for foreground or/and background layer.

3.Optionally, configure and enable the CLUT using HAL_LTDC_ConfigCLUT() and HAL_LTDC_EnableCLUT functions.

4.Optionally, enable the Dither using HAL_LTDC_EnableDither().

5.Optionally, configure and enable the Color keying using

HAL_LTDC_ConfigColorKeying() and HAL_LTDC_EnableColorKeying functions.

6.Optionally, configure LineInterrupt using HAL_LTDC_ProgramLineEvent() function

7.If needed, reconfigure and change the pixel format value, the alpha value value, the window size, the window position and the layer start address for foreground or/and background layer using respectively the following functions: HAL_LTDC_SetPixelFormat(), HAL_LTDC_SetAlpha(), HAL_LTDC_SetWindowSize(), HAL_LTDC_SetWindowPosition(), HAL_LTDC_SetAddress.

8.To control LTDC state you can use the following function: HAL_LTDC_GetState()

LTDC HAL driver macros list

Below the list of most used macros in LTDC HAL driver.

__HAL_LTDC_ENABLE: Enable the LTDC.

__HAL_LTDC_DISABLE: Disable the LTDC.

__HAL_LTDC_LAYER_ENABLE: Enable the LTDC Layer.

__HAL_LTDC_LAYER_DISABLE: Disable the LTDC Layer.

__HAL_LTDC_RELOAD_CONFIG: Reload Layer Configuration.

__HAL_LTDC_GET_FLAG: Get the LTDC pending flags.

DOCID025834 Rev 2

461/900

HAL LTDC Generic Driver

UM1725

__HAL_LTDC_CLEAR_FLAG: Clear the LTDC pending flags.

__HAL_LTDC_ENABLE_IT: Enable the specified LTDC interrupts.

__HAL_LTDC_DISABLE_IT: Disable the specified LTDC interrupts.

__HAL_LTDC_GET_IT_SOURCE: Check whether the specified LTDC interrupt has occurred or not.

You can refer to the LTDC HAL driver header file for more useful macros

36.2.2Initialization and Configuration functions

This section provides functions allowing to:

Initialize and configure the LTDC

De-initialize the LTDC

This section contains the following APIs:

HAL_LTDC_Init()

HAL_LTDC_DeInit()

HAL_LTDC_MspInit()

HAL_LTDC_MspDeInit()

HAL_LTDC_ErrorCallback()

HAL_LTDC_LineEvenCallback()

36.2.3IO operation functions

This section provides function allowing to:

Handle LTDC interrupt request This section contains the following APIs:

HAL_LTDC_IRQHandler()

HAL_LTDC_ErrorCallback()

HAL_LTDC_LineEvenCallback()

36.2.4Peripheral Control functions

This section provides functions allowing to:

Configure the LTDC foreground or/and background parameters.

Set the active layer.

Configure the color keying.

Configure the C-LUT.

Enable / Disable the color keying.

Enable / Disable the C-LUT.

Update the layer position.

Update the layer size.

Update pixel format on the fly.

Update transparency on the fly.

Update address on the fly.

This section contains the following APIs:

HAL_LTDC_ConfigLayer()

HAL_LTDC_ConfigColorKeying()

462/900

DOCID025834 Rev 2

UM1725

HAL LTDC Generic Driver

HAL_LTDC_ConfigCLUT()

HAL_LTDC_EnableColorKeying()

HAL_LTDC_DisableColorKeying()

HAL_LTDC_EnableCLUT()

HAL_LTDC_DisableCLUT()

HAL_LTDC_EnableDither()

HAL_LTDC_DisableDither()

HAL_LTDC_SetWindowSize()

HAL_LTDC_SetWindowPosition()

HAL_LTDC_SetPixelFormat()

HAL_LTDC_SetAlpha()

HAL_LTDC_SetAddress()

HAL_LTDC_ProgramLineEvent()

36.2.5Peripheral State and Errors functions

This subsection provides functions allowing to

Check the LTDC state.

Get error code.

This section contains the following APIs:

HAL_LTDC_GetState()

HAL_LTDC_GetError()

36.2.6HAL_LTDC_Init

Function Name

HAL_StatusTypeDef HAL_LTDC_Init (LTDC_HandleTypeDef *

 

hltdc)

Function Description

Initializes the LTDC according to the specified parameters in the

 

LTDC_InitTypeDef and create the associated handle.

Parameters

 

hltdc: pointer to a LTDC_HandleTypeDef structure that

 

 

contains the configuration information for the LTDC.

Return values

 

HAL status

36.2.7HAL_LTDC_DeInit

Function Name

HAL_StatusTypeDef HAL_LTDC_DeInit (LTDC_HandleTypeDef

 

* hltdc)

Function Description

Deinitializes the LTDC peripheral registers to their default reset

 

values.

Parameters

 

hltdc: pointer to a LTDC_HandleTypeDef structure that

 

 

contains the configuration information for the LTDC.

Return values

 

None

36.2.8HAL_LTDC_MspInit

Function Name

void HAL_LTDC_MspInit (LTDC_HandleTypeDef * hltdc)

Function Description

Initializes the LTDC MSP.

 

Parameters

hltdc: : pointer to a LTDC_HandleTypeDef structure that

 

contains the configuration information for the LTDC.

 

 

DOCID025834 Rev 2

463/900

HAL LTDC Generic Driver

UM1725

Return values

None

36.2.9HAL_LTDC_MspDeInit

Function Name

void HAL_LTDC_MspDeInit (LTDC_HandleTypeDef * hltdc)

Function Description

DeInitializes the LTDC MSP.

Parameters

 

hltdc: : pointer to a LTDC_HandleTypeDef structure that

 

 

contains the configuration information for the LTDC.

Return values

 

None

36.2.10HAL_LTDC_ErrorCallback

Function Name

void HAL_LTDC_ErrorCallback (LTDC_HandleTypeDef * hltdc)

Function Description

Error LTDC callback.

Parameters

 

hltdc: pointer to a LTDC_HandleTypeDef structure that

 

 

contains the configuration information for the LTDC.

Return values

 

None

36.2.11HAL_LTDC_LineEvenCallback

Function Name

void HAL_LTDC_LineEvenCallback (LTDC_HandleTypeDef *

 

hltdc)

Function Description

Line Event callback.

Parameters

 

hltdc: pointer to a LTDC_HandleTypeDef structure that

 

 

contains the configuration information for the LTDC.

Return values

 

None

36.2.12HAL_LTDC_IRQHandler

Function Name

void HAL_LTDC_IRQHandler (LTDC_HandleTypeDef * hltdc)

Function Description

Handles LTDC interrupt request.

Parameters

 

hltdc: pointer to a LTDC_HandleTypeDef structure that

 

 

contains the configuration information for the LTDC.

Return values

 

HAL status

36.2.13HAL_LTDC_ErrorCallback

Function Name

void HAL_LTDC_ErrorCallback (LTDC_HandleTypeDef * hltdc)

Function Description

Error LTDC callback.

Parameters

 

hltdc: pointer to a LTDC_HandleTypeDef structure that

 

 

contains the configuration information for the LTDC.

Return values

 

None

36.2.14HAL_LTDC_LineEvenCallback

Function Name

void HAL_LTDC_LineEvenCallback (LTDC_HandleTypeDef *

464/900

DOCID025834 Rev 2

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]