2 ******************************************************************************
3 * @file stm32h7xx_hal_ltdc.h
4 * @author MCD Application Team
5 * @brief Header file of LTDC HAL module.
6 ******************************************************************************
9 * <h2><center>© Copyright (c) 2017 STMicroelectronics.
10 * All rights reserved.</center></h2>
12 * This software component is licensed by ST under BSD 3-Clause license,
13 * the "License"; You may not use this file except in compliance with the
14 * License. You may obtain a copy of the License at:
15 * opensource.org/licenses/BSD-3-Clause
17 ******************************************************************************
20 /* Define to prevent recursive inclusion -------------------------------------*/
21 #ifndef STM32H7xx_HAL_LTDC_H
22 #define STM32H7xx_HAL_LTDC_H
28 /* Includes ------------------------------------------------------------------*/
29 #include "stm32h7xx_hal_def.h"
33 /** @addtogroup STM32H7xx_HAL_Driver
37 /** @defgroup LTDC LTDC
38 * @brief LTDC HAL module driver
42 /* Exported types ------------------------------------------------------------*/
43 /** @defgroup LTDC_Exported_Types LTDC Exported Types
49 * @brief LTDC color structure definition
53 uint8_t Blue
; /*!< Configures the blue value.
54 This parameter must be a number between Min_Data = 0x00 and Max_Data = 0xFF. */
56 uint8_t Green
; /*!< Configures the green value.
57 This parameter must be a number between Min_Data = 0x00 and Max_Data = 0xFF. */
59 uint8_t Red
; /*!< Configures the red value.
60 This parameter must be a number between Min_Data = 0x00 and Max_Data = 0xFF. */
62 uint8_t Reserved
; /*!< Reserved 0xFF */
66 * @brief LTDC Init structure definition
70 uint32_t HSPolarity
; /*!< configures the horizontal synchronization polarity.
71 This parameter can be one value of @ref LTDC_HS_POLARITY */
73 uint32_t VSPolarity
; /*!< configures the vertical synchronization polarity.
74 This parameter can be one value of @ref LTDC_VS_POLARITY */
76 uint32_t DEPolarity
; /*!< configures the data enable polarity.
77 This parameter can be one of value of @ref LTDC_DE_POLARITY */
79 uint32_t PCPolarity
; /*!< configures the pixel clock polarity.
80 This parameter can be one of value of @ref LTDC_PC_POLARITY */
82 uint32_t HorizontalSync
; /*!< configures the number of Horizontal synchronization width.
83 This parameter must be a number between Min_Data = 0x000 and Max_Data = 0xFFF. */
85 uint32_t VerticalSync
; /*!< configures the number of Vertical synchronization height.
86 This parameter must be a number between Min_Data = 0x000 and Max_Data = 0x7FF. */
88 uint32_t AccumulatedHBP
; /*!< configures the accumulated horizontal back porch width.
89 This parameter must be a number between Min_Data = LTDC_HorizontalSync and Max_Data = 0xFFF. */
91 uint32_t AccumulatedVBP
; /*!< configures the accumulated vertical back porch height.
92 This parameter must be a number between Min_Data = LTDC_VerticalSync and Max_Data = 0x7FF. */
94 uint32_t AccumulatedActiveW
; /*!< configures the accumulated active width.
95 This parameter must be a number between Min_Data = LTDC_AccumulatedHBP and Max_Data = 0xFFF. */
97 uint32_t AccumulatedActiveH
; /*!< configures the accumulated active height.
98 This parameter must be a number between Min_Data = LTDC_AccumulatedVBP and Max_Data = 0x7FF. */
100 uint32_t TotalWidth
; /*!< configures the total width.
101 This parameter must be a number between Min_Data = LTDC_AccumulatedActiveW and Max_Data = 0xFFF. */
103 uint32_t TotalHeigh
; /*!< configures the total height.
104 This parameter must be a number between Min_Data = LTDC_AccumulatedActiveH and Max_Data = 0x7FF. */
106 LTDC_ColorTypeDef Backcolor
; /*!< Configures the background color. */
110 * @brief LTDC Layer structure definition
114 uint32_t WindowX0
; /*!< Configures the Window Horizontal Start Position.
115 This parameter must be a number between Min_Data = 0x000 and Max_Data = 0xFFF. */
117 uint32_t WindowX1
; /*!< Configures the Window Horizontal Stop Position.
118 This parameter must be a number between Min_Data = 0x000 and Max_Data = 0xFFF. */
120 uint32_t WindowY0
; /*!< Configures the Window vertical Start Position.
121 This parameter must be a number between Min_Data = 0x000 and Max_Data = 0x7FF. */
123 uint32_t WindowY1
; /*!< Configures the Window vertical Stop Position.
124 This parameter must be a number between Min_Data = 0x0000 and Max_Data = 0x7FF. */
126 uint32_t PixelFormat
; /*!< Specifies the pixel format.
127 This parameter can be one of value of @ref LTDC_Pixelformat */
129 uint32_t Alpha
; /*!< Specifies the constant alpha used for blending.
130 This parameter must be a number between Min_Data = 0x00 and Max_Data = 0xFF. */
132 uint32_t Alpha0
; /*!< Configures the default alpha value.
133 This parameter must be a number between Min_Data = 0x00 and Max_Data = 0xFF. */
135 uint32_t BlendingFactor1
; /*!< Select the blending factor 1.
136 This parameter can be one of value of @ref LTDC_BlendingFactor1 */
138 uint32_t BlendingFactor2
; /*!< Select the blending factor 2.
139 This parameter can be one of value of @ref LTDC_BlendingFactor2 */
141 uint32_t FBStartAdress
; /*!< Configures the color frame buffer address */
143 uint32_t ImageWidth
; /*!< Configures the color frame buffer line length.
144 This parameter must be a number between Min_Data = 0x0000 and Max_Data = 0x1FFF. */
146 uint32_t ImageHeight
; /*!< Specifies the number of line in frame buffer.
147 This parameter must be a number between Min_Data = 0x000 and Max_Data = 0x7FF. */
149 LTDC_ColorTypeDef Backcolor
; /*!< Configures the layer background color. */
150 } LTDC_LayerCfgTypeDef
;
153 * @brief HAL LTDC State structures definition
157 HAL_LTDC_STATE_RESET
= 0x00U
, /*!< LTDC not yet initialized or disabled */
158 HAL_LTDC_STATE_READY
= 0x01U
, /*!< LTDC initialized and ready for use */
159 HAL_LTDC_STATE_BUSY
= 0x02U
, /*!< LTDC internal process is ongoing */
160 HAL_LTDC_STATE_TIMEOUT
= 0x03U
, /*!< LTDC Timeout state */
161 HAL_LTDC_STATE_ERROR
= 0x04U
/*!< LTDC state error */
162 } HAL_LTDC_StateTypeDef
;
165 * @brief LTDC handle Structure definition
167 #if (USE_HAL_LTDC_REGISTER_CALLBACKS == 1)
168 typedef struct __LTDC_HandleTypeDef
171 #endif /* USE_HAL_LTDC_REGISTER_CALLBACKS */
173 LTDC_TypeDef
*Instance
; /*!< LTDC Register base address */
175 LTDC_InitTypeDef Init
; /*!< LTDC parameters */
177 LTDC_LayerCfgTypeDef LayerCfg
[MAX_LAYER
]; /*!< LTDC Layers parameters */
179 HAL_LockTypeDef Lock
; /*!< LTDC Lock */
181 __IO HAL_LTDC_StateTypeDef State
; /*!< LTDC state */
183 __IO
uint32_t ErrorCode
; /*!< LTDC Error code */
185 #if (USE_HAL_LTDC_REGISTER_CALLBACKS == 1)
186 void (* LineEventCallback
)(struct __LTDC_HandleTypeDef
*hltdc
); /*!< LTDC Line Event Callback */
187 void (* ReloadEventCallback
)(struct __LTDC_HandleTypeDef
*hltdc
); /*!< LTDC Reload Event Callback */
188 void (* ErrorCallback
)(struct __LTDC_HandleTypeDef
*hltdc
); /*!< LTDC Error Callback */
190 void (* MspInitCallback
)(struct __LTDC_HandleTypeDef
*hltdc
); /*!< LTDC Msp Init callback */
191 void (* MspDeInitCallback
)(struct __LTDC_HandleTypeDef
*hltdc
); /*!< LTDC Msp DeInit callback */
193 #endif /* USE_HAL_LTDC_REGISTER_CALLBACKS */
196 } LTDC_HandleTypeDef
;
198 #if (USE_HAL_LTDC_REGISTER_CALLBACKS == 1)
200 * @brief HAL LTDC Callback ID enumeration definition
204 HAL_LTDC_MSPINIT_CB_ID
= 0x00U
, /*!< LTDC MspInit callback ID */
205 HAL_LTDC_MSPDEINIT_CB_ID
= 0x01U
, /*!< LTDC MspDeInit callback ID */
207 HAL_LTDC_LINE_EVENT_CB_ID
= 0x02U
, /*!< LTDC Line Event Callback ID */
208 HAL_LTDC_RELOAD_EVENT_CB_ID
= 0x03U
, /*!< LTDC Reload Callback ID */
209 HAL_LTDC_ERROR_CB_ID
= 0x04U
/*!< LTDC Error Callback ID */
211 } HAL_LTDC_CallbackIDTypeDef
;
214 * @brief HAL LTDC Callback pointer definition
216 typedef void (*pLTDC_CallbackTypeDef
)(LTDC_HandleTypeDef
*hltdc
); /*!< pointer to an LTDC callback function */
218 #endif /* USE_HAL_LTDC_REGISTER_CALLBACKS */
224 /* Exported constants --------------------------------------------------------*/
225 /** @defgroup LTDC_Exported_Constants LTDC Exported Constants
229 /** @defgroup LTDC_Error_Code LTDC Error Code
232 #define HAL_LTDC_ERROR_NONE 0x00000000U /*!< LTDC No error */
233 #define HAL_LTDC_ERROR_TE 0x00000001U /*!< LTDC Transfer error */
234 #define HAL_LTDC_ERROR_FU 0x00000002U /*!< LTDC FIFO Underrun */
235 #define HAL_LTDC_ERROR_TIMEOUT 0x00000020U /*!< LTDC Timeout error */
236 #if (USE_HAL_LTDC_REGISTER_CALLBACKS == 1)
237 #define HAL_LTDC_ERROR_INVALID_CALLBACK 0x00000040U /*!< LTDC Invalid Callback error */
238 #endif /* USE_HAL_LTDC_REGISTER_CALLBACKS */
243 /** @defgroup LTDC_Layer LTDC Layer
246 #define LTDC_LAYER_1 0x00000000U /*!< LTDC Layer 1 */
247 #define LTDC_LAYER_2 0x00000001U /*!< LTDC Layer 2 */
252 /** @defgroup LTDC_HS_POLARITY LTDC HS POLARITY
255 #define LTDC_HSPOLARITY_AL 0x00000000U /*!< Horizontal Synchronization is active low. */
256 #define LTDC_HSPOLARITY_AH LTDC_GCR_HSPOL /*!< Horizontal Synchronization is active high. */
261 /** @defgroup LTDC_VS_POLARITY LTDC VS POLARITY
264 #define LTDC_VSPOLARITY_AL 0x00000000U /*!< Vertical Synchronization is active low. */
265 #define LTDC_VSPOLARITY_AH LTDC_GCR_VSPOL /*!< Vertical Synchronization is active high. */
270 /** @defgroup LTDC_DE_POLARITY LTDC DE POLARITY
273 #define LTDC_DEPOLARITY_AL 0x00000000U /*!< Data Enable, is active low. */
274 #define LTDC_DEPOLARITY_AH LTDC_GCR_DEPOL /*!< Data Enable, is active high. */
279 /** @defgroup LTDC_PC_POLARITY LTDC PC POLARITY
282 #define LTDC_PCPOLARITY_IPC 0x00000000U /*!< input pixel clock. */
283 #define LTDC_PCPOLARITY_IIPC LTDC_GCR_PCPOL /*!< inverted input pixel clock. */
288 /** @defgroup LTDC_SYNC LTDC SYNC
291 #define LTDC_HORIZONTALSYNC (LTDC_SSCR_HSW >> 16U) /*!< Horizontal synchronization width. */
292 #define LTDC_VERTICALSYNC LTDC_SSCR_VSH /*!< Vertical synchronization height. */
297 /** @defgroup LTDC_BACK_COLOR LTDC BACK COLOR
300 #define LTDC_COLOR 0x000000FFU /*!< Color mask */
305 /** @defgroup LTDC_BlendingFactor1 LTDC Blending Factor1
308 #define LTDC_BLENDING_FACTOR1_CA 0x00000400U /*!< Blending factor : Cte Alpha */
309 #define LTDC_BLENDING_FACTOR1_PAxCA 0x00000600U /*!< Blending factor : Cte Alpha x Pixel Alpha*/
314 /** @defgroup LTDC_BlendingFactor2 LTDC Blending Factor2
317 #define LTDC_BLENDING_FACTOR2_CA 0x00000005U /*!< Blending factor : Cte Alpha */
318 #define LTDC_BLENDING_FACTOR2_PAxCA 0x00000007U /*!< Blending factor : Cte Alpha x Pixel Alpha*/
323 /** @defgroup LTDC_Pixelformat LTDC Pixel format
326 #define LTDC_PIXEL_FORMAT_ARGB8888 0x00000000U /*!< ARGB8888 LTDC pixel format */
327 #define LTDC_PIXEL_FORMAT_RGB888 0x00000001U /*!< RGB888 LTDC pixel format */
328 #define LTDC_PIXEL_FORMAT_RGB565 0x00000002U /*!< RGB565 LTDC pixel format */
329 #define LTDC_PIXEL_FORMAT_ARGB1555 0x00000003U /*!< ARGB1555 LTDC pixel format */
330 #define LTDC_PIXEL_FORMAT_ARGB4444 0x00000004U /*!< ARGB4444 LTDC pixel format */
331 #define LTDC_PIXEL_FORMAT_L8 0x00000005U /*!< L8 LTDC pixel format */
332 #define LTDC_PIXEL_FORMAT_AL44 0x00000006U /*!< AL44 LTDC pixel format */
333 #define LTDC_PIXEL_FORMAT_AL88 0x00000007U /*!< AL88 LTDC pixel format */
338 /** @defgroup LTDC_Alpha LTDC Alpha
341 #define LTDC_ALPHA LTDC_LxCACR_CONSTA /*!< LTDC Constant Alpha mask */
346 /** @defgroup LTDC_LAYER_Config LTDC LAYER Config
349 #define LTDC_STOPPOSITION (LTDC_LxWHPCR_WHSPPOS >> 16U) /*!< LTDC Layer stop position */
350 #define LTDC_STARTPOSITION LTDC_LxWHPCR_WHSTPOS /*!< LTDC Layer start position */
352 #define LTDC_COLOR_FRAME_BUFFER LTDC_LxCFBLR_CFBLL /*!< LTDC Layer Line length */
353 #define LTDC_LINE_NUMBER LTDC_LxCFBLNR_CFBLNBR /*!< LTDC Layer Line number */
358 /** @defgroup LTDC_Interrupts LTDC Interrupts
361 #define LTDC_IT_LI LTDC_IER_LIE /*!< LTDC Line Interrupt */
362 #define LTDC_IT_FU LTDC_IER_FUIE /*!< LTDC FIFO Underrun Interrupt */
363 #define LTDC_IT_TE LTDC_IER_TERRIE /*!< LTDC Transfer Error Interrupt */
364 #define LTDC_IT_RR LTDC_IER_RRIE /*!< LTDC Register Reload Interrupt */
369 /** @defgroup LTDC_Flags LTDC Flags
372 #define LTDC_FLAG_LI LTDC_ISR_LIF /*!< LTDC Line Interrupt Flag */
373 #define LTDC_FLAG_FU LTDC_ISR_FUIF /*!< LTDC FIFO Underrun interrupt Flag */
374 #define LTDC_FLAG_TE LTDC_ISR_TERRIF /*!< LTDC Transfer Error interrupt Flag */
375 #define LTDC_FLAG_RR LTDC_ISR_RRIF /*!< LTDC Register Reload interrupt Flag */
380 /** @defgroup LTDC_Reload_Type LTDC Reload Type
383 #define LTDC_RELOAD_IMMEDIATE LTDC_SRCR_IMR /*!< Immediate Reload */
384 #define LTDC_RELOAD_VERTICAL_BLANKING LTDC_SRCR_VBR /*!< Vertical Blanking Reload */
393 /* Exported macro ------------------------------------------------------------*/
394 /** @defgroup LTDC_Exported_Macros LTDC Exported Macros
398 /** @brief Reset LTDC handle state.
399 * @param __HANDLE__ LTDC handle
402 #if (USE_HAL_LTDC_REGISTER_CALLBACKS == 1)
403 #define __HAL_LTDC_RESET_HANDLE_STATE(__HANDLE__) do{ \
404 (__HANDLE__)->State = HAL_LTDC_STATE_RESET; \
405 (__HANDLE__)->MspInitCallback = NULL; \
406 (__HANDLE__)->MspDeInitCallback = NULL; \
409 #define __HAL_LTDC_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_LTDC_STATE_RESET)
410 #endif /*USE_HAL_LTDC_REGISTER_CALLBACKS */
413 * @brief Enable the LTDC.
414 * @param __HANDLE__ LTDC handle
417 #define __HAL_LTDC_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->GCR |= LTDC_GCR_LTDCEN)
420 * @brief Disable the LTDC.
421 * @param __HANDLE__ LTDC handle
424 #define __HAL_LTDC_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->GCR &= ~(LTDC_GCR_LTDCEN))
427 * @brief Enable the LTDC Layer.
428 * @param __HANDLE__ LTDC handle
429 * @param __LAYER__ Specify the layer to be enabled.
430 * This parameter can be LTDC_LAYER_1 (0) or LTDC_LAYER_2 (1).
433 #define __HAL_LTDC_LAYER_ENABLE(__HANDLE__, __LAYER__) ((LTDC_LAYER((__HANDLE__), (__LAYER__)))->CR |= (uint32_t)LTDC_LxCR_LEN)
436 * @brief Disable the LTDC Layer.
437 * @param __HANDLE__ LTDC handle
438 * @param __LAYER__ Specify the layer to be disabled.
439 * This parameter can be LTDC_LAYER_1 (0) or LTDC_LAYER_2 (1).
442 #define __HAL_LTDC_LAYER_DISABLE(__HANDLE__, __LAYER__) ((LTDC_LAYER((__HANDLE__), (__LAYER__)))->CR &= ~(uint32_t)LTDC_LxCR_LEN)
445 * @brief Reload immediately all LTDC Layers.
446 * @param __HANDLE__ LTDC handle
449 #define __HAL_LTDC_RELOAD_IMMEDIATE_CONFIG(__HANDLE__) ((__HANDLE__)->Instance->SRCR |= LTDC_SRCR_IMR)
452 * @brief Reload during vertical blanking period all LTDC Layers.
453 * @param __HANDLE__ LTDC handle
456 #define __HAL_LTDC_VERTICAL_BLANKING_RELOAD_CONFIG(__HANDLE__) ((__HANDLE__)->Instance->SRCR |= LTDC_SRCR_VBR)
458 /* Interrupt & Flag management */
460 * @brief Get the LTDC pending flags.
461 * @param __HANDLE__ LTDC handle
462 * @param __FLAG__ Get the specified flag.
463 * This parameter can be any combination of the following values:
464 * @arg LTDC_FLAG_LI: Line Interrupt flag
465 * @arg LTDC_FLAG_FU: FIFO Underrun Interrupt flag
466 * @arg LTDC_FLAG_TE: Transfer Error interrupt flag
467 * @arg LTDC_FLAG_RR: Register Reload Interrupt Flag
468 * @retval The state of FLAG (SET or RESET).
470 #define __HAL_LTDC_GET_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR & (__FLAG__))
473 * @brief Clears the LTDC pending flags.
474 * @param __HANDLE__ LTDC handle
475 * @param __FLAG__ Specify the flag to clear.
476 * This parameter can be any combination of the following values:
477 * @arg LTDC_FLAG_LI: Line Interrupt flag
478 * @arg LTDC_FLAG_FU: FIFO Underrun Interrupt flag
479 * @arg LTDC_FLAG_TE: Transfer Error interrupt flag
480 * @arg LTDC_FLAG_RR: Register Reload Interrupt Flag
483 #define __HAL_LTDC_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ICR = (__FLAG__))
486 * @brief Enables the specified LTDC interrupts.
487 * @param __HANDLE__ LTDC handle
488 * @param __INTERRUPT__ Specify the LTDC interrupt sources to be enabled.
489 * This parameter can be any combination of the following values:
490 * @arg LTDC_IT_LI: Line Interrupt flag
491 * @arg LTDC_IT_FU: FIFO Underrun Interrupt flag
492 * @arg LTDC_IT_TE: Transfer Error interrupt flag
493 * @arg LTDC_IT_RR: Register Reload Interrupt Flag
496 #define __HAL_LTDC_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->IER |= (__INTERRUPT__))
499 * @brief Disables the specified LTDC interrupts.
500 * @param __HANDLE__ LTDC handle
501 * @param __INTERRUPT__ Specify the LTDC interrupt sources to be disabled.
502 * This parameter can be any combination of the following values:
503 * @arg LTDC_IT_LI: Line Interrupt flag
504 * @arg LTDC_IT_FU: FIFO Underrun Interrupt flag
505 * @arg LTDC_IT_TE: Transfer Error interrupt flag
506 * @arg LTDC_IT_RR: Register Reload Interrupt Flag
509 #define __HAL_LTDC_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->IER &= ~(__INTERRUPT__))
512 * @brief Check whether the specified LTDC interrupt has occurred or not.
513 * @param __HANDLE__ LTDC handle
514 * @param __INTERRUPT__ Specify the LTDC interrupt source to check.
515 * This parameter can be one of the following values:
516 * @arg LTDC_IT_LI: Line Interrupt flag
517 * @arg LTDC_IT_FU: FIFO Underrun Interrupt flag
518 * @arg LTDC_IT_TE: Transfer Error interrupt flag
519 * @arg LTDC_IT_RR: Register Reload Interrupt Flag
520 * @retval The state of INTERRUPT (SET or RESET).
522 #define __HAL_LTDC_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->IER & (__INTERRUPT__))
527 /* Include LTDC HAL Extension module */
528 #include "stm32h7xx_hal_ltdc_ex.h"
530 /* Exported functions --------------------------------------------------------*/
531 /** @addtogroup LTDC_Exported_Functions
534 /** @addtogroup LTDC_Exported_Functions_Group1
537 /* Initialization and de-initialization functions *****************************/
538 HAL_StatusTypeDef
HAL_LTDC_Init(LTDC_HandleTypeDef
*hltdc
);
539 HAL_StatusTypeDef
HAL_LTDC_DeInit(LTDC_HandleTypeDef
*hltdc
);
540 void HAL_LTDC_MspInit(LTDC_HandleTypeDef
*hltdc
);
541 void HAL_LTDC_MspDeInit(LTDC_HandleTypeDef
*hltdc
);
542 void HAL_LTDC_ErrorCallback(LTDC_HandleTypeDef
*hltdc
);
543 void HAL_LTDC_LineEventCallback(LTDC_HandleTypeDef
*hltdc
);
544 void HAL_LTDC_ReloadEventCallback(LTDC_HandleTypeDef
*hltdc
);
546 /* Callbacks Register/UnRegister functions ***********************************/
547 #if (USE_HAL_LTDC_REGISTER_CALLBACKS == 1)
548 HAL_StatusTypeDef
HAL_LTDC_RegisterCallback(LTDC_HandleTypeDef
*hltdc
, HAL_LTDC_CallbackIDTypeDef CallbackID
, pLTDC_CallbackTypeDef pCallback
);
549 HAL_StatusTypeDef
HAL_LTDC_UnRegisterCallback(LTDC_HandleTypeDef
*hltdc
, HAL_LTDC_CallbackIDTypeDef CallbackID
);
550 #endif /* USE_HAL_LTDC_REGISTER_CALLBACKS */
556 /** @addtogroup LTDC_Exported_Functions_Group2
559 /* IO operation functions *****************************************************/
560 void HAL_LTDC_IRQHandler(LTDC_HandleTypeDef
*hltdc
);
565 /** @addtogroup LTDC_Exported_Functions_Group3
568 /* Peripheral Control functions ***********************************************/
569 HAL_StatusTypeDef
HAL_LTDC_ConfigLayer(LTDC_HandleTypeDef
*hltdc
, LTDC_LayerCfgTypeDef
*pLayerCfg
, uint32_t LayerIdx
);
570 HAL_StatusTypeDef
HAL_LTDC_SetWindowSize(LTDC_HandleTypeDef
*hltdc
, uint32_t XSize
, uint32_t YSize
, uint32_t LayerIdx
);
571 HAL_StatusTypeDef
HAL_LTDC_SetWindowPosition(LTDC_HandleTypeDef
*hltdc
, uint32_t X0
, uint32_t Y0
, uint32_t LayerIdx
);
572 HAL_StatusTypeDef
HAL_LTDC_SetPixelFormat(LTDC_HandleTypeDef
*hltdc
, uint32_t Pixelformat
, uint32_t LayerIdx
);
573 HAL_StatusTypeDef
HAL_LTDC_SetAlpha(LTDC_HandleTypeDef
*hltdc
, uint32_t Alpha
, uint32_t LayerIdx
);
574 HAL_StatusTypeDef
HAL_LTDC_SetAddress(LTDC_HandleTypeDef
*hltdc
, uint32_t Address
, uint32_t LayerIdx
);
575 HAL_StatusTypeDef
HAL_LTDC_SetPitch(LTDC_HandleTypeDef
*hltdc
, uint32_t LinePitchInPixels
, uint32_t LayerIdx
);
576 HAL_StatusTypeDef
HAL_LTDC_ConfigColorKeying(LTDC_HandleTypeDef
*hltdc
, uint32_t RGBValue
, uint32_t LayerIdx
);
577 HAL_StatusTypeDef
HAL_LTDC_ConfigCLUT(LTDC_HandleTypeDef
*hltdc
, uint32_t *pCLUT
, uint32_t CLUTSize
, uint32_t LayerIdx
);
578 HAL_StatusTypeDef
HAL_LTDC_EnableColorKeying(LTDC_HandleTypeDef
*hltdc
, uint32_t LayerIdx
);
579 HAL_StatusTypeDef
HAL_LTDC_DisableColorKeying(LTDC_HandleTypeDef
*hltdc
, uint32_t LayerIdx
);
580 HAL_StatusTypeDef
HAL_LTDC_EnableCLUT(LTDC_HandleTypeDef
*hltdc
, uint32_t LayerIdx
);
581 HAL_StatusTypeDef
HAL_LTDC_DisableCLUT(LTDC_HandleTypeDef
*hltdc
, uint32_t LayerIdx
);
582 HAL_StatusTypeDef
HAL_LTDC_ProgramLineEvent(LTDC_HandleTypeDef
*hltdc
, uint32_t Line
);
583 HAL_StatusTypeDef
HAL_LTDC_EnableDither(LTDC_HandleTypeDef
*hltdc
);
584 HAL_StatusTypeDef
HAL_LTDC_DisableDither(LTDC_HandleTypeDef
*hltdc
);
585 HAL_StatusTypeDef
HAL_LTDC_Reload(LTDC_HandleTypeDef
*hltdc
, uint32_t ReloadType
);
586 HAL_StatusTypeDef
HAL_LTDC_ConfigLayer_NoReload(LTDC_HandleTypeDef
*hltdc
, LTDC_LayerCfgTypeDef
*pLayerCfg
, uint32_t LayerIdx
);
587 HAL_StatusTypeDef
HAL_LTDC_SetWindowSize_NoReload(LTDC_HandleTypeDef
*hltdc
, uint32_t XSize
, uint32_t YSize
, uint32_t LayerIdx
);
588 HAL_StatusTypeDef
HAL_LTDC_SetWindowPosition_NoReload(LTDC_HandleTypeDef
*hltdc
, uint32_t X0
, uint32_t Y0
, uint32_t LayerIdx
);
589 HAL_StatusTypeDef
HAL_LTDC_SetPixelFormat_NoReload(LTDC_HandleTypeDef
*hltdc
, uint32_t Pixelformat
, uint32_t LayerIdx
);
590 HAL_StatusTypeDef
HAL_LTDC_SetAlpha_NoReload(LTDC_HandleTypeDef
*hltdc
, uint32_t Alpha
, uint32_t LayerIdx
);
591 HAL_StatusTypeDef
HAL_LTDC_SetAddress_NoReload(LTDC_HandleTypeDef
*hltdc
, uint32_t Address
, uint32_t LayerIdx
);
592 HAL_StatusTypeDef
HAL_LTDC_SetPitch_NoReload(LTDC_HandleTypeDef
*hltdc
, uint32_t LinePitchInPixels
, uint32_t LayerIdx
);
593 HAL_StatusTypeDef
HAL_LTDC_ConfigColorKeying_NoReload(LTDC_HandleTypeDef
*hltdc
, uint32_t RGBValue
, uint32_t LayerIdx
);
594 HAL_StatusTypeDef
HAL_LTDC_EnableColorKeying_NoReload(LTDC_HandleTypeDef
*hltdc
, uint32_t LayerIdx
);
595 HAL_StatusTypeDef
HAL_LTDC_DisableColorKeying_NoReload(LTDC_HandleTypeDef
*hltdc
, uint32_t LayerIdx
);
596 HAL_StatusTypeDef
HAL_LTDC_EnableCLUT_NoReload(LTDC_HandleTypeDef
*hltdc
, uint32_t LayerIdx
);
597 HAL_StatusTypeDef
HAL_LTDC_DisableCLUT_NoReload(LTDC_HandleTypeDef
*hltdc
, uint32_t LayerIdx
);
603 /** @addtogroup LTDC_Exported_Functions_Group4
606 /* Peripheral State functions *************************************************/
607 HAL_LTDC_StateTypeDef
HAL_LTDC_GetState(LTDC_HandleTypeDef
*hltdc
);
608 uint32_t HAL_LTDC_GetError(LTDC_HandleTypeDef
*hltdc
);
617 /* Private types -------------------------------------------------------------*/
618 /* Private variables ---------------------------------------------------------*/
619 /* Private constants ---------------------------------------------------------*/
620 /* Private macros ------------------------------------------------------------*/
621 /** @defgroup LTDC_Private_Macros LTDC Private Macros
624 #define LTDC_LAYER(__HANDLE__, __LAYER__) ((LTDC_Layer_TypeDef *)((uint32_t)(((uint32_t)((__HANDLE__)->Instance)) + 0x84U + (0x80U*(__LAYER__)))))
625 #define IS_LTDC_LAYER(__LAYER__) ((__LAYER__) < MAX_LAYER)
626 #define IS_LTDC_HSPOL(__HSPOL__) (((__HSPOL__) == LTDC_HSPOLARITY_AL) || ((__HSPOL__) == LTDC_HSPOLARITY_AH))
627 #define IS_LTDC_VSPOL(__VSPOL__) (((__VSPOL__) == LTDC_VSPOLARITY_AL) || ((__VSPOL__) == LTDC_VSPOLARITY_AH))
628 #define IS_LTDC_DEPOL(__DEPOL__) (((__DEPOL__) == LTDC_DEPOLARITY_AL) || ((__DEPOL__) == LTDC_DEPOLARITY_AH))
629 #define IS_LTDC_PCPOL(__PCPOL__) (((__PCPOL__) == LTDC_PCPOLARITY_IPC) || ((__PCPOL__) == LTDC_PCPOLARITY_IIPC))
630 #define IS_LTDC_HSYNC(__HSYNC__) ((__HSYNC__) <= LTDC_HORIZONTALSYNC)
631 #define IS_LTDC_VSYNC(__VSYNC__) ((__VSYNC__) <= LTDC_VERTICALSYNC)
632 #define IS_LTDC_AHBP(__AHBP__) ((__AHBP__) <= LTDC_HORIZONTALSYNC)
633 #define IS_LTDC_AVBP(__AVBP__) ((__AVBP__) <= LTDC_VERTICALSYNC)
634 #define IS_LTDC_AAW(__AAW__) ((__AAW__) <= LTDC_HORIZONTALSYNC)
635 #define IS_LTDC_AAH(__AAH__) ((__AAH__) <= LTDC_VERTICALSYNC)
636 #define IS_LTDC_TOTALW(__TOTALW__) ((__TOTALW__) <= LTDC_HORIZONTALSYNC)
637 #define IS_LTDC_TOTALH(__TOTALH__) ((__TOTALH__) <= LTDC_VERTICALSYNC)
638 #define IS_LTDC_BLUEVALUE(__BBLUE__) ((__BBLUE__) <= LTDC_COLOR)
639 #define IS_LTDC_GREENVALUE(__BGREEN__) ((__BGREEN__) <= LTDC_COLOR)
640 #define IS_LTDC_REDVALUE(__BRED__) ((__BRED__) <= LTDC_COLOR)
641 #define IS_LTDC_BLENDING_FACTOR1(__BLENDING_FACTOR1__) (((__BLENDING_FACTOR1__) == LTDC_BLENDING_FACTOR1_CA) || \
642 ((__BLENDING_FACTOR1__) == LTDC_BLENDING_FACTOR1_PAxCA))
643 #define IS_LTDC_BLENDING_FACTOR2(__BLENDING_FACTOR1__) (((__BLENDING_FACTOR1__) == LTDC_BLENDING_FACTOR2_CA) || \
644 ((__BLENDING_FACTOR1__) == LTDC_BLENDING_FACTOR2_PAxCA))
645 #define IS_LTDC_PIXEL_FORMAT(__PIXEL_FORMAT__) (((__PIXEL_FORMAT__) == LTDC_PIXEL_FORMAT_ARGB8888) || ((__PIXEL_FORMAT__) == LTDC_PIXEL_FORMAT_RGB888) || \
646 ((__PIXEL_FORMAT__) == LTDC_PIXEL_FORMAT_RGB565) || ((__PIXEL_FORMAT__) == LTDC_PIXEL_FORMAT_ARGB1555) || \
647 ((__PIXEL_FORMAT__) == LTDC_PIXEL_FORMAT_ARGB4444) || ((__PIXEL_FORMAT__) == LTDC_PIXEL_FORMAT_L8) || \
648 ((__PIXEL_FORMAT__) == LTDC_PIXEL_FORMAT_AL44) || ((__PIXEL_FORMAT__) == LTDC_PIXEL_FORMAT_AL88))
649 #define IS_LTDC_ALPHA(__ALPHA__) ((__ALPHA__) <= LTDC_ALPHA)
650 #define IS_LTDC_HCONFIGST(__HCONFIGST__) ((__HCONFIGST__) <= LTDC_STARTPOSITION)
651 #define IS_LTDC_HCONFIGSP(__HCONFIGSP__) ((__HCONFIGSP__) <= LTDC_STOPPOSITION)
652 #define IS_LTDC_VCONFIGST(__VCONFIGST__) ((__VCONFIGST__) <= LTDC_STARTPOSITION)
653 #define IS_LTDC_VCONFIGSP(__VCONFIGSP__) ((__VCONFIGSP__) <= LTDC_STOPPOSITION)
654 #define IS_LTDC_CFBP(__CFBP__) ((__CFBP__) <= LTDC_COLOR_FRAME_BUFFER)
655 #define IS_LTDC_CFBLL(__CFBLL__) ((__CFBLL__) <= LTDC_COLOR_FRAME_BUFFER)
656 #define IS_LTDC_CFBLNBR(__CFBLNBR__) ((__CFBLNBR__) <= LTDC_LINE_NUMBER)
657 #define IS_LTDC_LIPOS(__LIPOS__) ((__LIPOS__) <= 0x7FFU)
658 #define IS_LTDC_RELOAD(__RELOADTYPE__) (((__RELOADTYPE__) == LTDC_RELOAD_IMMEDIATE) || ((__RELOADTYPE__) == LTDC_RELOAD_VERTICAL_BLANKING))
663 /* Private functions ---------------------------------------------------------*/
664 /** @defgroup LTDC_Private_Functions LTDC Private Functions
686 #endif /* STM32H7xx_HAL_LTDC_H */
688 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/