2 ******************************************************************************
3 * @file stm32f7xx_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 STM32F7xx_HAL_LTDC_H
22 #define STM32F7xx_HAL_LTDC_H
30 /* Includes ------------------------------------------------------------------*/
31 #include "stm32f7xx_hal_def.h"
34 /** @addtogroup STM32F7xx_HAL_Driver
38 /** @defgroup LTDC LTDC
39 * @brief LTDC HAL module driver
43 /* Exported types ------------------------------------------------------------*/
44 /** @defgroup LTDC_Exported_Types LTDC Exported Types
50 * @brief LTDC color structure definition
54 uint8_t Blue
; /*!< Configures the blue value.
55 This parameter must be a number between Min_Data = 0x00 and Max_Data = 0xFF. */
57 uint8_t Green
; /*!< Configures the green value.
58 This parameter must be a number between Min_Data = 0x00 and Max_Data = 0xFF. */
60 uint8_t Red
; /*!< Configures the red value.
61 This parameter must be a number between Min_Data = 0x00 and Max_Data = 0xFF. */
63 uint8_t Reserved
; /*!< Reserved 0xFF */
67 * @brief LTDC Init structure definition
71 uint32_t HSPolarity
; /*!< configures the horizontal synchronization polarity.
72 This parameter can be one value of @ref LTDC_HS_POLARITY */
74 uint32_t VSPolarity
; /*!< configures the vertical synchronization polarity.
75 This parameter can be one value of @ref LTDC_VS_POLARITY */
77 uint32_t DEPolarity
; /*!< configures the data enable polarity.
78 This parameter can be one of value of @ref LTDC_DE_POLARITY */
80 uint32_t PCPolarity
; /*!< configures the pixel clock polarity.
81 This parameter can be one of value of @ref LTDC_PC_POLARITY */
83 uint32_t HorizontalSync
; /*!< configures the number of Horizontal synchronization width.
84 This parameter must be a number between Min_Data = 0x000 and Max_Data = 0xFFF. */
86 uint32_t VerticalSync
; /*!< configures the number of Vertical synchronization height.
87 This parameter must be a number between Min_Data = 0x000 and Max_Data = 0x7FF. */
89 uint32_t AccumulatedHBP
; /*!< configures the accumulated horizontal back porch width.
90 This parameter must be a number between Min_Data = LTDC_HorizontalSync and Max_Data = 0xFFF. */
92 uint32_t AccumulatedVBP
; /*!< configures the accumulated vertical back porch height.
93 This parameter must be a number between Min_Data = LTDC_VerticalSync and Max_Data = 0x7FF. */
95 uint32_t AccumulatedActiveW
; /*!< configures the accumulated active width.
96 This parameter must be a number between Min_Data = LTDC_AccumulatedHBP and Max_Data = 0xFFF. */
98 uint32_t AccumulatedActiveH
; /*!< configures the accumulated active height.
99 This parameter must be a number between Min_Data = LTDC_AccumulatedVBP and Max_Data = 0x7FF. */
101 uint32_t TotalWidth
; /*!< configures the total width.
102 This parameter must be a number between Min_Data = LTDC_AccumulatedActiveW and Max_Data = 0xFFF. */
104 uint32_t TotalHeigh
; /*!< configures the total height.
105 This parameter must be a number between Min_Data = LTDC_AccumulatedActiveH and Max_Data = 0x7FF. */
107 LTDC_ColorTypeDef Backcolor
; /*!< Configures the background color. */
111 * @brief LTDC Layer structure definition
115 uint32_t WindowX0
; /*!< Configures the Window Horizontal Start Position.
116 This parameter must be a number between Min_Data = 0x000 and Max_Data = 0xFFF. */
118 uint32_t WindowX1
; /*!< Configures the Window Horizontal Stop Position.
119 This parameter must be a number between Min_Data = 0x000 and Max_Data = 0xFFF. */
121 uint32_t WindowY0
; /*!< Configures the Window vertical Start Position.
122 This parameter must be a number between Min_Data = 0x000 and Max_Data = 0x7FF. */
124 uint32_t WindowY1
; /*!< Configures the Window vertical Stop Position.
125 This parameter must be a number between Min_Data = 0x0000 and Max_Data = 0x7FF. */
127 uint32_t PixelFormat
; /*!< Specifies the pixel format.
128 This parameter can be one of value of @ref LTDC_Pixelformat */
130 uint32_t Alpha
; /*!< Specifies the constant alpha used for blending.
131 This parameter must be a number between Min_Data = 0x00 and Max_Data = 0xFF. */
133 uint32_t Alpha0
; /*!< Configures the default alpha value.
134 This parameter must be a number between Min_Data = 0x00 and Max_Data = 0xFF. */
136 uint32_t BlendingFactor1
; /*!< Select the blending factor 1.
137 This parameter can be one of value of @ref LTDC_BlendingFactor1 */
139 uint32_t BlendingFactor2
; /*!< Select the blending factor 2.
140 This parameter can be one of value of @ref LTDC_BlendingFactor2 */
142 uint32_t FBStartAdress
; /*!< Configures the color frame buffer address */
144 uint32_t ImageWidth
; /*!< Configures the color frame buffer line length.
145 This parameter must be a number between Min_Data = 0x0000 and Max_Data = 0x1FFF. */
147 uint32_t ImageHeight
; /*!< Specifies the number of line in frame buffer.
148 This parameter must be a number between Min_Data = 0x000 and Max_Data = 0x7FF. */
150 LTDC_ColorTypeDef Backcolor
; /*!< Configures the layer background color. */
151 } LTDC_LayerCfgTypeDef
;
154 * @brief HAL LTDC State structures definition
158 HAL_LTDC_STATE_RESET
= 0x00U
, /*!< LTDC not yet initialized or disabled */
159 HAL_LTDC_STATE_READY
= 0x01U
, /*!< LTDC initialized and ready for use */
160 HAL_LTDC_STATE_BUSY
= 0x02U
, /*!< LTDC internal process is ongoing */
161 HAL_LTDC_STATE_TIMEOUT
= 0x03U
, /*!< LTDC Timeout state */
162 HAL_LTDC_STATE_ERROR
= 0x04U
/*!< LTDC state error */
163 } HAL_LTDC_StateTypeDef
;
166 * @brief LTDC handle Structure definition
168 #if (USE_HAL_LTDC_REGISTER_CALLBACKS == 1)
169 typedef struct __LTDC_HandleTypeDef
172 #endif /* USE_HAL_LTDC_REGISTER_CALLBACKS */
174 LTDC_TypeDef
*Instance
; /*!< LTDC Register base address */
176 LTDC_InitTypeDef Init
; /*!< LTDC parameters */
178 LTDC_LayerCfgTypeDef LayerCfg
[MAX_LAYER
]; /*!< LTDC Layers parameters */
180 HAL_LockTypeDef Lock
; /*!< LTDC Lock */
182 __IO HAL_LTDC_StateTypeDef State
; /*!< LTDC state */
184 __IO
uint32_t ErrorCode
; /*!< LTDC Error code */
186 #if (USE_HAL_LTDC_REGISTER_CALLBACKS == 1)
187 void (* LineEventCallback
)(struct __LTDC_HandleTypeDef
*hltdc
); /*!< LTDC Line Event Callback */
188 void (* ReloadEventCallback
)(struct __LTDC_HandleTypeDef
*hltdc
); /*!< LTDC Reload Event Callback */
189 void (* ErrorCallback
)(struct __LTDC_HandleTypeDef
*hltdc
); /*!< LTDC Error Callback */
191 void (* MspInitCallback
)(struct __LTDC_HandleTypeDef
*hltdc
); /*!< LTDC Msp Init callback */
192 void (* MspDeInitCallback
)(struct __LTDC_HandleTypeDef
*hltdc
); /*!< LTDC Msp DeInit callback */
194 #endif /* USE_HAL_LTDC_REGISTER_CALLBACKS */
197 } LTDC_HandleTypeDef
;
199 #if (USE_HAL_LTDC_REGISTER_CALLBACKS == 1)
201 * @brief HAL LTDC Callback ID enumeration definition
205 HAL_LTDC_MSPINIT_CB_ID
= 0x00U
, /*!< LTDC MspInit callback ID */
206 HAL_LTDC_MSPDEINIT_CB_ID
= 0x01U
, /*!< LTDC MspDeInit callback ID */
208 HAL_LTDC_LINE_EVENT_CB_ID
= 0x02U
, /*!< LTDC Line Event Callback ID */
209 HAL_LTDC_RELOAD_EVENT_CB_ID
= 0x03U
, /*!< LTDC Reload Callback ID */
210 HAL_LTDC_ERROR_CB_ID
= 0x04U
/*!< LTDC Error Callback ID */
212 } HAL_LTDC_CallbackIDTypeDef
;
215 * @brief HAL LTDC Callback pointer definition
217 typedef void (*pLTDC_CallbackTypeDef
)(LTDC_HandleTypeDef
*hltdc
); /*!< pointer to an LTDC callback function */
219 #endif /* USE_HAL_LTDC_REGISTER_CALLBACKS */
225 /* Exported constants --------------------------------------------------------*/
226 /** @defgroup LTDC_Exported_Constants LTDC Exported Constants
230 /** @defgroup LTDC_Error_Code LTDC Error Code
233 #define HAL_LTDC_ERROR_NONE 0x00000000U /*!< LTDC No error */
234 #define HAL_LTDC_ERROR_TE 0x00000001U /*!< LTDC Transfer error */
235 #define HAL_LTDC_ERROR_FU 0x00000002U /*!< LTDC FIFO Underrun */
236 #define HAL_LTDC_ERROR_TIMEOUT 0x00000020U /*!< LTDC Timeout error */
237 #if (USE_HAL_LTDC_REGISTER_CALLBACKS == 1)
238 #define HAL_LTDC_ERROR_INVALID_CALLBACK 0x00000040U /*!< LTDC Invalid Callback error */
239 #endif /* USE_HAL_LTDC_REGISTER_CALLBACKS */
244 /** @defgroup LTDC_Layer LTDC Layer
247 #define LTDC_LAYER_1 0x00000000U /*!< LTDC Layer 1 */
248 #define LTDC_LAYER_2 0x00000001U /*!< LTDC Layer 2 */
253 /** @defgroup LTDC_HS_POLARITY LTDC HS POLARITY
256 #define LTDC_HSPOLARITY_AL 0x00000000U /*!< Horizontal Synchronization is active low. */
257 #define LTDC_HSPOLARITY_AH LTDC_GCR_HSPOL /*!< Horizontal Synchronization is active high. */
262 /** @defgroup LTDC_VS_POLARITY LTDC VS POLARITY
265 #define LTDC_VSPOLARITY_AL 0x00000000U /*!< Vertical Synchronization is active low. */
266 #define LTDC_VSPOLARITY_AH LTDC_GCR_VSPOL /*!< Vertical Synchronization is active high. */
271 /** @defgroup LTDC_DE_POLARITY LTDC DE POLARITY
274 #define LTDC_DEPOLARITY_AL 0x00000000U /*!< Data Enable, is active low. */
275 #define LTDC_DEPOLARITY_AH LTDC_GCR_DEPOL /*!< Data Enable, is active high. */
280 /** @defgroup LTDC_PC_POLARITY LTDC PC POLARITY
283 #define LTDC_PCPOLARITY_IPC 0x00000000U /*!< input pixel clock. */
284 #define LTDC_PCPOLARITY_IIPC LTDC_GCR_PCPOL /*!< inverted input pixel clock. */
289 /** @defgroup LTDC_SYNC LTDC SYNC
292 #define LTDC_HORIZONTALSYNC (LTDC_SSCR_HSW >> 16U) /*!< Horizontal synchronization width. */
293 #define LTDC_VERTICALSYNC LTDC_SSCR_VSH /*!< Vertical synchronization height. */
298 /** @defgroup LTDC_BACK_COLOR LTDC BACK COLOR
301 #define LTDC_COLOR 0x000000FFU /*!< Color mask */
306 /** @defgroup LTDC_BlendingFactor1 LTDC Blending Factor1
309 #define LTDC_BLENDING_FACTOR1_CA 0x00000400U /*!< Blending factor : Cte Alpha */
310 #define LTDC_BLENDING_FACTOR1_PAxCA 0x00000600U /*!< Blending factor : Cte Alpha x Pixel Alpha*/
315 /** @defgroup LTDC_BlendingFactor2 LTDC Blending Factor2
318 #define LTDC_BLENDING_FACTOR2_CA 0x00000005U /*!< Blending factor : Cte Alpha */
319 #define LTDC_BLENDING_FACTOR2_PAxCA 0x00000007U /*!< Blending factor : Cte Alpha x Pixel Alpha*/
324 /** @defgroup LTDC_Pixelformat LTDC Pixel format
327 #define LTDC_PIXEL_FORMAT_ARGB8888 0x00000000U /*!< ARGB8888 LTDC pixel format */
328 #define LTDC_PIXEL_FORMAT_RGB888 0x00000001U /*!< RGB888 LTDC pixel format */
329 #define LTDC_PIXEL_FORMAT_RGB565 0x00000002U /*!< RGB565 LTDC pixel format */
330 #define LTDC_PIXEL_FORMAT_ARGB1555 0x00000003U /*!< ARGB1555 LTDC pixel format */
331 #define LTDC_PIXEL_FORMAT_ARGB4444 0x00000004U /*!< ARGB4444 LTDC pixel format */
332 #define LTDC_PIXEL_FORMAT_L8 0x00000005U /*!< L8 LTDC pixel format */
333 #define LTDC_PIXEL_FORMAT_AL44 0x00000006U /*!< AL44 LTDC pixel format */
334 #define LTDC_PIXEL_FORMAT_AL88 0x00000007U /*!< AL88 LTDC pixel format */
339 /** @defgroup LTDC_Alpha LTDC Alpha
342 #define LTDC_ALPHA LTDC_LxCACR_CONSTA /*!< LTDC Constant Alpha mask */
347 /** @defgroup LTDC_LAYER_Config LTDC LAYER Config
350 #define LTDC_STOPPOSITION (LTDC_LxWHPCR_WHSPPOS >> 16U) /*!< LTDC Layer stop position */
351 #define LTDC_STARTPOSITION LTDC_LxWHPCR_WHSTPOS /*!< LTDC Layer start position */
353 #define LTDC_COLOR_FRAME_BUFFER LTDC_LxCFBLR_CFBLL /*!< LTDC Layer Line length */
354 #define LTDC_LINE_NUMBER LTDC_LxCFBLNR_CFBLNBR /*!< LTDC Layer Line number */
359 /** @defgroup LTDC_Interrupts LTDC Interrupts
362 #define LTDC_IT_LI LTDC_IER_LIE /*!< LTDC Line Interrupt */
363 #define LTDC_IT_FU LTDC_IER_FUIE /*!< LTDC FIFO Underrun Interrupt */
364 #define LTDC_IT_TE LTDC_IER_TERRIE /*!< LTDC Transfer Error Interrupt */
365 #define LTDC_IT_RR LTDC_IER_RRIE /*!< LTDC Register Reload Interrupt */
370 /** @defgroup LTDC_Flags LTDC Flags
373 #define LTDC_FLAG_LI LTDC_ISR_LIF /*!< LTDC Line Interrupt Flag */
374 #define LTDC_FLAG_FU LTDC_ISR_FUIF /*!< LTDC FIFO Underrun interrupt Flag */
375 #define LTDC_FLAG_TE LTDC_ISR_TERRIF /*!< LTDC Transfer Error interrupt Flag */
376 #define LTDC_FLAG_RR LTDC_ISR_RRIF /*!< LTDC Register Reload interrupt Flag */
381 /** @defgroup LTDC_Reload_Type LTDC Reload Type
384 #define LTDC_RELOAD_IMMEDIATE LTDC_SRCR_IMR /*!< Immediate Reload */
385 #define LTDC_RELOAD_VERTICAL_BLANKING LTDC_SRCR_VBR /*!< Vertical Blanking Reload */
394 /* Exported macro ------------------------------------------------------------*/
395 /** @defgroup LTDC_Exported_Macros LTDC Exported Macros
399 /** @brief Reset LTDC handle state.
400 * @param __HANDLE__ LTDC handle
403 #if (USE_HAL_LTDC_REGISTER_CALLBACKS == 1)
404 #define __HAL_LTDC_RESET_HANDLE_STATE(__HANDLE__) do{ \
405 (__HANDLE__)->State = HAL_LTDC_STATE_RESET; \
406 (__HANDLE__)->MspInitCallback = NULL; \
407 (__HANDLE__)->MspDeInitCallback = NULL; \
410 #define __HAL_LTDC_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_LTDC_STATE_RESET)
411 #endif /*USE_HAL_LTDC_REGISTER_CALLBACKS */
414 * @brief Enable the LTDC.
415 * @param __HANDLE__ LTDC handle
418 #define __HAL_LTDC_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->GCR |= LTDC_GCR_LTDCEN)
421 * @brief Disable the LTDC.
422 * @param __HANDLE__ LTDC handle
425 #define __HAL_LTDC_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->GCR &= ~(LTDC_GCR_LTDCEN))
428 * @brief Enable the LTDC Layer.
429 * @param __HANDLE__ LTDC handle
430 * @param __LAYER__ Specify the layer to be enabled.
431 * This parameter can be LTDC_LAYER_1 (0) or LTDC_LAYER_2 (1).
434 #define __HAL_LTDC_LAYER_ENABLE(__HANDLE__, __LAYER__) ((LTDC_LAYER((__HANDLE__), (__LAYER__)))->CR |= (uint32_t)LTDC_LxCR_LEN)
437 * @brief Disable the LTDC Layer.
438 * @param __HANDLE__ LTDC handle
439 * @param __LAYER__ Specify the layer to be disabled.
440 * This parameter can be LTDC_LAYER_1 (0) or LTDC_LAYER_2 (1).
443 #define __HAL_LTDC_LAYER_DISABLE(__HANDLE__, __LAYER__) ((LTDC_LAYER((__HANDLE__), (__LAYER__)))->CR &= ~(uint32_t)LTDC_LxCR_LEN)
446 * @brief Reload immediately all LTDC Layers.
447 * @param __HANDLE__ LTDC handle
450 #define __HAL_LTDC_RELOAD_IMMEDIATE_CONFIG(__HANDLE__) ((__HANDLE__)->Instance->SRCR |= LTDC_SRCR_IMR)
453 * @brief Reload during vertical blanking period all LTDC Layers.
454 * @param __HANDLE__ LTDC handle
457 #define __HAL_LTDC_VERTICAL_BLANKING_RELOAD_CONFIG(__HANDLE__) ((__HANDLE__)->Instance->SRCR |= LTDC_SRCR_VBR)
459 /* Interrupt & Flag management */
461 * @brief Get the LTDC pending flags.
462 * @param __HANDLE__ LTDC handle
463 * @param __FLAG__ Get the specified flag.
464 * This parameter can be any combination of the following values:
465 * @arg LTDC_FLAG_LI: Line Interrupt flag
466 * @arg LTDC_FLAG_FU: FIFO Underrun Interrupt flag
467 * @arg LTDC_FLAG_TE: Transfer Error interrupt flag
468 * @arg LTDC_FLAG_RR: Register Reload Interrupt Flag
469 * @retval The state of FLAG (SET or RESET).
471 #define __HAL_LTDC_GET_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR & (__FLAG__))
474 * @brief Clears the LTDC pending flags.
475 * @param __HANDLE__ LTDC handle
476 * @param __FLAG__ Specify the flag to clear.
477 * This parameter can be any combination of the following values:
478 * @arg LTDC_FLAG_LI: Line Interrupt flag
479 * @arg LTDC_FLAG_FU: FIFO Underrun Interrupt flag
480 * @arg LTDC_FLAG_TE: Transfer Error interrupt flag
481 * @arg LTDC_FLAG_RR: Register Reload Interrupt Flag
484 #define __HAL_LTDC_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ICR = (__FLAG__))
487 * @brief Enables the specified LTDC interrupts.
488 * @param __HANDLE__ LTDC handle
489 * @param __INTERRUPT__ Specify the LTDC interrupt sources to be enabled.
490 * This parameter can be any combination of the following values:
491 * @arg LTDC_IT_LI: Line Interrupt flag
492 * @arg LTDC_IT_FU: FIFO Underrun Interrupt flag
493 * @arg LTDC_IT_TE: Transfer Error interrupt flag
494 * @arg LTDC_IT_RR: Register Reload Interrupt Flag
497 #define __HAL_LTDC_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->IER |= (__INTERRUPT__))
500 * @brief Disables the specified LTDC interrupts.
501 * @param __HANDLE__ LTDC handle
502 * @param __INTERRUPT__ Specify the LTDC interrupt sources to be disabled.
503 * This parameter can be any combination of the following values:
504 * @arg LTDC_IT_LI: Line Interrupt flag
505 * @arg LTDC_IT_FU: FIFO Underrun Interrupt flag
506 * @arg LTDC_IT_TE: Transfer Error interrupt flag
507 * @arg LTDC_IT_RR: Register Reload Interrupt Flag
510 #define __HAL_LTDC_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->IER &= ~(__INTERRUPT__))
513 * @brief Check whether the specified LTDC interrupt has occurred or not.
514 * @param __HANDLE__ LTDC handle
515 * @param __INTERRUPT__ Specify the LTDC interrupt source to check.
516 * This parameter can be one of the following values:
517 * @arg LTDC_IT_LI: Line Interrupt flag
518 * @arg LTDC_IT_FU: FIFO Underrun Interrupt flag
519 * @arg LTDC_IT_TE: Transfer Error interrupt flag
520 * @arg LTDC_IT_RR: Register Reload Interrupt Flag
521 * @retval The state of INTERRUPT (SET or RESET).
523 #define __HAL_LTDC_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->IER & (__INTERRUPT__))
528 /* Include LTDC HAL Extension module */
529 #include "stm32f7xx_hal_ltdc_ex.h"
531 /* Exported functions --------------------------------------------------------*/
532 /** @addtogroup LTDC_Exported_Functions
535 /** @addtogroup LTDC_Exported_Functions_Group1
538 /* Initialization and de-initialization functions *****************************/
539 HAL_StatusTypeDef
HAL_LTDC_Init(LTDC_HandleTypeDef
*hltdc
);
540 HAL_StatusTypeDef
HAL_LTDC_DeInit(LTDC_HandleTypeDef
*hltdc
);
541 void HAL_LTDC_MspInit(LTDC_HandleTypeDef
*hltdc
);
542 void HAL_LTDC_MspDeInit(LTDC_HandleTypeDef
*hltdc
);
543 void HAL_LTDC_ErrorCallback(LTDC_HandleTypeDef
*hltdc
);
544 void HAL_LTDC_LineEventCallback(LTDC_HandleTypeDef
*hltdc
);
545 void HAL_LTDC_ReloadEventCallback(LTDC_HandleTypeDef
*hltdc
);
547 /* Callbacks Register/UnRegister functions ***********************************/
548 #if (USE_HAL_LTDC_REGISTER_CALLBACKS == 1)
549 HAL_StatusTypeDef
HAL_LTDC_RegisterCallback(LTDC_HandleTypeDef
*hltdc
, HAL_LTDC_CallbackIDTypeDef CallbackID
, pLTDC_CallbackTypeDef pCallback
);
550 HAL_StatusTypeDef
HAL_LTDC_UnRegisterCallback(LTDC_HandleTypeDef
*hltdc
, HAL_LTDC_CallbackIDTypeDef CallbackID
);
551 #endif /* USE_HAL_LTDC_REGISTER_CALLBACKS */
557 /** @addtogroup LTDC_Exported_Functions_Group2
560 /* IO operation functions *****************************************************/
561 void HAL_LTDC_IRQHandler(LTDC_HandleTypeDef
*hltdc
);
566 /** @addtogroup LTDC_Exported_Functions_Group3
569 /* Peripheral Control functions ***********************************************/
570 HAL_StatusTypeDef
HAL_LTDC_ConfigLayer(LTDC_HandleTypeDef
*hltdc
, LTDC_LayerCfgTypeDef
*pLayerCfg
, uint32_t LayerIdx
);
571 HAL_StatusTypeDef
HAL_LTDC_SetWindowSize(LTDC_HandleTypeDef
*hltdc
, uint32_t XSize
, uint32_t YSize
, uint32_t LayerIdx
);
572 HAL_StatusTypeDef
HAL_LTDC_SetWindowPosition(LTDC_HandleTypeDef
*hltdc
, uint32_t X0
, uint32_t Y0
, uint32_t LayerIdx
);
573 HAL_StatusTypeDef
HAL_LTDC_SetPixelFormat(LTDC_HandleTypeDef
*hltdc
, uint32_t Pixelformat
, uint32_t LayerIdx
);
574 HAL_StatusTypeDef
HAL_LTDC_SetAlpha(LTDC_HandleTypeDef
*hltdc
, uint32_t Alpha
, uint32_t LayerIdx
);
575 HAL_StatusTypeDef
HAL_LTDC_SetAddress(LTDC_HandleTypeDef
*hltdc
, uint32_t Address
, uint32_t LayerIdx
);
576 HAL_StatusTypeDef
HAL_LTDC_SetPitch(LTDC_HandleTypeDef
*hltdc
, uint32_t LinePitchInPixels
, uint32_t LayerIdx
);
577 HAL_StatusTypeDef
HAL_LTDC_ConfigColorKeying(LTDC_HandleTypeDef
*hltdc
, uint32_t RGBValue
, uint32_t LayerIdx
);
578 HAL_StatusTypeDef
HAL_LTDC_ConfigCLUT(LTDC_HandleTypeDef
*hltdc
, uint32_t *pCLUT
, uint32_t CLUTSize
, uint32_t LayerIdx
);
579 HAL_StatusTypeDef
HAL_LTDC_EnableColorKeying(LTDC_HandleTypeDef
*hltdc
, uint32_t LayerIdx
);
580 HAL_StatusTypeDef
HAL_LTDC_DisableColorKeying(LTDC_HandleTypeDef
*hltdc
, uint32_t LayerIdx
);
581 HAL_StatusTypeDef
HAL_LTDC_EnableCLUT(LTDC_HandleTypeDef
*hltdc
, uint32_t LayerIdx
);
582 HAL_StatusTypeDef
HAL_LTDC_DisableCLUT(LTDC_HandleTypeDef
*hltdc
, uint32_t LayerIdx
);
583 HAL_StatusTypeDef
HAL_LTDC_ProgramLineEvent(LTDC_HandleTypeDef
*hltdc
, uint32_t Line
);
584 HAL_StatusTypeDef
HAL_LTDC_EnableDither(LTDC_HandleTypeDef
*hltdc
);
585 HAL_StatusTypeDef
HAL_LTDC_DisableDither(LTDC_HandleTypeDef
*hltdc
);
586 HAL_StatusTypeDef
HAL_LTDC_Reload(LTDC_HandleTypeDef
*hltdc
, uint32_t ReloadType
);
587 HAL_StatusTypeDef
HAL_LTDC_ConfigLayer_NoReload(LTDC_HandleTypeDef
*hltdc
, LTDC_LayerCfgTypeDef
*pLayerCfg
, uint32_t LayerIdx
);
588 HAL_StatusTypeDef
HAL_LTDC_SetWindowSize_NoReload(LTDC_HandleTypeDef
*hltdc
, uint32_t XSize
, uint32_t YSize
, uint32_t LayerIdx
);
589 HAL_StatusTypeDef
HAL_LTDC_SetWindowPosition_NoReload(LTDC_HandleTypeDef
*hltdc
, uint32_t X0
, uint32_t Y0
, uint32_t LayerIdx
);
590 HAL_StatusTypeDef
HAL_LTDC_SetPixelFormat_NoReload(LTDC_HandleTypeDef
*hltdc
, uint32_t Pixelformat
, uint32_t LayerIdx
);
591 HAL_StatusTypeDef
HAL_LTDC_SetAlpha_NoReload(LTDC_HandleTypeDef
*hltdc
, uint32_t Alpha
, uint32_t LayerIdx
);
592 HAL_StatusTypeDef
HAL_LTDC_SetAddress_NoReload(LTDC_HandleTypeDef
*hltdc
, uint32_t Address
, uint32_t LayerIdx
);
593 HAL_StatusTypeDef
HAL_LTDC_SetPitch_NoReload(LTDC_HandleTypeDef
*hltdc
, uint32_t LinePitchInPixels
, uint32_t LayerIdx
);
594 HAL_StatusTypeDef
HAL_LTDC_ConfigColorKeying_NoReload(LTDC_HandleTypeDef
*hltdc
, uint32_t RGBValue
, uint32_t LayerIdx
);
595 HAL_StatusTypeDef
HAL_LTDC_EnableColorKeying_NoReload(LTDC_HandleTypeDef
*hltdc
, uint32_t LayerIdx
);
596 HAL_StatusTypeDef
HAL_LTDC_DisableColorKeying_NoReload(LTDC_HandleTypeDef
*hltdc
, uint32_t LayerIdx
);
597 HAL_StatusTypeDef
HAL_LTDC_EnableCLUT_NoReload(LTDC_HandleTypeDef
*hltdc
, uint32_t LayerIdx
);
598 HAL_StatusTypeDef
HAL_LTDC_DisableCLUT_NoReload(LTDC_HandleTypeDef
*hltdc
, uint32_t LayerIdx
);
604 /** @addtogroup LTDC_Exported_Functions_Group4
607 /* Peripheral State functions *************************************************/
608 HAL_LTDC_StateTypeDef
HAL_LTDC_GetState(LTDC_HandleTypeDef
*hltdc
);
609 uint32_t HAL_LTDC_GetError(LTDC_HandleTypeDef
*hltdc
);
618 /* Private types -------------------------------------------------------------*/
619 /* Private variables ---------------------------------------------------------*/
620 /* Private constants ---------------------------------------------------------*/
621 /* Private macros ------------------------------------------------------------*/
622 /** @defgroup LTDC_Private_Macros LTDC Private Macros
625 #define LTDC_LAYER(__HANDLE__, __LAYER__) ((LTDC_Layer_TypeDef *)((uint32_t)(((uint32_t)((__HANDLE__)->Instance)) + 0x84U + (0x80U*(__LAYER__)))))
626 #define IS_LTDC_LAYER(__LAYER__) ((__LAYER__) < MAX_LAYER)
627 #define IS_LTDC_HSPOL(__HSPOL__) (((__HSPOL__) == LTDC_HSPOLARITY_AL) || ((__HSPOL__) == LTDC_HSPOLARITY_AH))
628 #define IS_LTDC_VSPOL(__VSPOL__) (((__VSPOL__) == LTDC_VSPOLARITY_AL) || ((__VSPOL__) == LTDC_VSPOLARITY_AH))
629 #define IS_LTDC_DEPOL(__DEPOL__) (((__DEPOL__) == LTDC_DEPOLARITY_AL) || ((__DEPOL__) == LTDC_DEPOLARITY_AH))
630 #define IS_LTDC_PCPOL(__PCPOL__) (((__PCPOL__) == LTDC_PCPOLARITY_IPC) || ((__PCPOL__) == LTDC_PCPOLARITY_IIPC))
631 #define IS_LTDC_HSYNC(__HSYNC__) ((__HSYNC__) <= LTDC_HORIZONTALSYNC)
632 #define IS_LTDC_VSYNC(__VSYNC__) ((__VSYNC__) <= LTDC_VERTICALSYNC)
633 #define IS_LTDC_AHBP(__AHBP__) ((__AHBP__) <= LTDC_HORIZONTALSYNC)
634 #define IS_LTDC_AVBP(__AVBP__) ((__AVBP__) <= LTDC_VERTICALSYNC)
635 #define IS_LTDC_AAW(__AAW__) ((__AAW__) <= LTDC_HORIZONTALSYNC)
636 #define IS_LTDC_AAH(__AAH__) ((__AAH__) <= LTDC_VERTICALSYNC)
637 #define IS_LTDC_TOTALW(__TOTALW__) ((__TOTALW__) <= LTDC_HORIZONTALSYNC)
638 #define IS_LTDC_TOTALH(__TOTALH__) ((__TOTALH__) <= LTDC_VERTICALSYNC)
639 #define IS_LTDC_BLUEVALUE(__BBLUE__) ((__BBLUE__) <= LTDC_COLOR)
640 #define IS_LTDC_GREENVALUE(__BGREEN__) ((__BGREEN__) <= LTDC_COLOR)
641 #define IS_LTDC_REDVALUE(__BRED__) ((__BRED__) <= LTDC_COLOR)
642 #define IS_LTDC_BLENDING_FACTOR1(__BLENDING_FACTOR1__) (((__BLENDING_FACTOR1__) == LTDC_BLENDING_FACTOR1_CA) || \
643 ((__BLENDING_FACTOR1__) == LTDC_BLENDING_FACTOR1_PAxCA))
644 #define IS_LTDC_BLENDING_FACTOR2(__BLENDING_FACTOR1__) (((__BLENDING_FACTOR1__) == LTDC_BLENDING_FACTOR2_CA) || \
645 ((__BLENDING_FACTOR1__) == LTDC_BLENDING_FACTOR2_PAxCA))
646 #define IS_LTDC_PIXEL_FORMAT(__PIXEL_FORMAT__) (((__PIXEL_FORMAT__) == LTDC_PIXEL_FORMAT_ARGB8888) || ((__PIXEL_FORMAT__) == LTDC_PIXEL_FORMAT_RGB888) || \
647 ((__PIXEL_FORMAT__) == LTDC_PIXEL_FORMAT_RGB565) || ((__PIXEL_FORMAT__) == LTDC_PIXEL_FORMAT_ARGB1555) || \
648 ((__PIXEL_FORMAT__) == LTDC_PIXEL_FORMAT_ARGB4444) || ((__PIXEL_FORMAT__) == LTDC_PIXEL_FORMAT_L8) || \
649 ((__PIXEL_FORMAT__) == LTDC_PIXEL_FORMAT_AL44) || ((__PIXEL_FORMAT__) == LTDC_PIXEL_FORMAT_AL88))
650 #define IS_LTDC_ALPHA(__ALPHA__) ((__ALPHA__) <= LTDC_ALPHA)
651 #define IS_LTDC_HCONFIGST(__HCONFIGST__) ((__HCONFIGST__) <= LTDC_STARTPOSITION)
652 #define IS_LTDC_HCONFIGSP(__HCONFIGSP__) ((__HCONFIGSP__) <= LTDC_STOPPOSITION)
653 #define IS_LTDC_VCONFIGST(__VCONFIGST__) ((__VCONFIGST__) <= LTDC_STARTPOSITION)
654 #define IS_LTDC_VCONFIGSP(__VCONFIGSP__) ((__VCONFIGSP__) <= LTDC_STOPPOSITION)
655 #define IS_LTDC_CFBP(__CFBP__) ((__CFBP__) <= LTDC_COLOR_FRAME_BUFFER)
656 #define IS_LTDC_CFBLL(__CFBLL__) ((__CFBLL__) <= LTDC_COLOR_FRAME_BUFFER)
657 #define IS_LTDC_CFBLNBR(__CFBLNBR__) ((__CFBLNBR__) <= LTDC_LINE_NUMBER)
658 #define IS_LTDC_LIPOS(__LIPOS__) ((__LIPOS__) <= 0x7FFU)
659 #define IS_LTDC_RELOAD(__RELOADTYPE__) (((__RELOADTYPE__) == LTDC_RELOAD_IMMEDIATE) || ((__RELOADTYPE__) == LTDC_RELOAD_VERTICAL_BLANKING))
664 /* Private functions ---------------------------------------------------------*/
665 /** @defgroup LTDC_Private_Functions LTDC Private Functions
687 #endif /* STM32F7xx_HAL_LTDC_H */
689 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/