001

Committer:
ganlikun
Date:
Sun Jun 12 14:02:44 2022 +0000
Revision:
0:13413ea9a877
00

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ganlikun 0:13413ea9a877 1 /**
ganlikun 0:13413ea9a877 2 ******************************************************************************
ganlikun 0:13413ea9a877 3 * @file stm32f4xx_hal_ltdc.h
ganlikun 0:13413ea9a877 4 * @author MCD Application Team
ganlikun 0:13413ea9a877 5 * @version V1.7.1
ganlikun 0:13413ea9a877 6 * @date 14-April-2017
ganlikun 0:13413ea9a877 7 * @brief Header file of LTDC HAL module.
ganlikun 0:13413ea9a877 8 ******************************************************************************
ganlikun 0:13413ea9a877 9 * @attention
ganlikun 0:13413ea9a877 10 *
ganlikun 0:13413ea9a877 11 * <h2><center>&copy; COPYRIGHT(c) 2017 STMicroelectronics</center></h2>
ganlikun 0:13413ea9a877 12 *
ganlikun 0:13413ea9a877 13 * Redistribution and use in source and binary forms, with or without modification,
ganlikun 0:13413ea9a877 14 * are permitted provided that the following conditions are met:
ganlikun 0:13413ea9a877 15 * 1. Redistributions of source code must retain the above copyright notice,
ganlikun 0:13413ea9a877 16 * this list of conditions and the following disclaimer.
ganlikun 0:13413ea9a877 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
ganlikun 0:13413ea9a877 18 * this list of conditions and the following disclaimer in the documentation
ganlikun 0:13413ea9a877 19 * and/or other materials provided with the distribution.
ganlikun 0:13413ea9a877 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
ganlikun 0:13413ea9a877 21 * may be used to endorse or promote products derived from this software
ganlikun 0:13413ea9a877 22 * without specific prior written permission.
ganlikun 0:13413ea9a877 23 *
ganlikun 0:13413ea9a877 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
ganlikun 0:13413ea9a877 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
ganlikun 0:13413ea9a877 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
ganlikun 0:13413ea9a877 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
ganlikun 0:13413ea9a877 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
ganlikun 0:13413ea9a877 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
ganlikun 0:13413ea9a877 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
ganlikun 0:13413ea9a877 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
ganlikun 0:13413ea9a877 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
ganlikun 0:13413ea9a877 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
ganlikun 0:13413ea9a877 34 *
ganlikun 0:13413ea9a877 35 ******************************************************************************
ganlikun 0:13413ea9a877 36 */
ganlikun 0:13413ea9a877 37
ganlikun 0:13413ea9a877 38 /* Define to prevent recursive inclusion -------------------------------------*/
ganlikun 0:13413ea9a877 39 #ifndef __STM32F4xx_HAL_LTDC_H
ganlikun 0:13413ea9a877 40 #define __STM32F4xx_HAL_LTDC_H
ganlikun 0:13413ea9a877 41
ganlikun 0:13413ea9a877 42 #ifdef __cplusplus
ganlikun 0:13413ea9a877 43 extern "C" {
ganlikun 0:13413ea9a877 44 #endif
ganlikun 0:13413ea9a877 45
ganlikun 0:13413ea9a877 46 #if defined(STM32F429xx) || defined(STM32F439xx) || defined(STM32F469xx) || defined(STM32F479xx)
ganlikun 0:13413ea9a877 47 /* Includes ------------------------------------------------------------------*/
ganlikun 0:13413ea9a877 48 #include "stm32f4xx_hal_def.h"
ganlikun 0:13413ea9a877 49
ganlikun 0:13413ea9a877 50 /** @addtogroup STM32F4xx_HAL_Driver
ganlikun 0:13413ea9a877 51 * @{
ganlikun 0:13413ea9a877 52 */
ganlikun 0:13413ea9a877 53
ganlikun 0:13413ea9a877 54 /** @defgroup LTDC LTDC
ganlikun 0:13413ea9a877 55 * @brief LTDC HAL module driver
ganlikun 0:13413ea9a877 56 * @{
ganlikun 0:13413ea9a877 57 */
ganlikun 0:13413ea9a877 58
ganlikun 0:13413ea9a877 59 /* Exported types ------------------------------------------------------------*/
ganlikun 0:13413ea9a877 60 /** @defgroup LTDC_Exported_Types LTDC Exported Types
ganlikun 0:13413ea9a877 61 * @{
ganlikun 0:13413ea9a877 62 */
ganlikun 0:13413ea9a877 63 #define MAX_LAYER 2U
ganlikun 0:13413ea9a877 64
ganlikun 0:13413ea9a877 65 /**
ganlikun 0:13413ea9a877 66 * @brief LTDC color structure definition
ganlikun 0:13413ea9a877 67 */
ganlikun 0:13413ea9a877 68 typedef struct
ganlikun 0:13413ea9a877 69 {
ganlikun 0:13413ea9a877 70 uint8_t Blue; /*!< Configures the blue value.
ganlikun 0:13413ea9a877 71 This parameter must be a number between Min_Data = 0x00 and Max_Data = 0xFF. */
ganlikun 0:13413ea9a877 72
ganlikun 0:13413ea9a877 73 uint8_t Green; /*!< Configures the green value.
ganlikun 0:13413ea9a877 74 This parameter must be a number between Min_Data = 0x00 and Max_Data = 0xFF. */
ganlikun 0:13413ea9a877 75
ganlikun 0:13413ea9a877 76 uint8_t Red; /*!< Configures the red value.
ganlikun 0:13413ea9a877 77 This parameter must be a number between Min_Data = 0x00 and Max_Data = 0xFF. */
ganlikun 0:13413ea9a877 78
ganlikun 0:13413ea9a877 79 uint8_t Reserved; /*!< Reserved 0xFF */
ganlikun 0:13413ea9a877 80 } LTDC_ColorTypeDef;
ganlikun 0:13413ea9a877 81
ganlikun 0:13413ea9a877 82 /**
ganlikun 0:13413ea9a877 83 * @brief LTDC Init structure definition
ganlikun 0:13413ea9a877 84 */
ganlikun 0:13413ea9a877 85 typedef struct
ganlikun 0:13413ea9a877 86 {
ganlikun 0:13413ea9a877 87 uint32_t HSPolarity; /*!< configures the horizontal synchronization polarity.
ganlikun 0:13413ea9a877 88 This parameter can be one value of @ref LTDC_HS_POLARITY */
ganlikun 0:13413ea9a877 89
ganlikun 0:13413ea9a877 90 uint32_t VSPolarity; /*!< configures the vertical synchronization polarity.
ganlikun 0:13413ea9a877 91 This parameter can be one value of @ref LTDC_VS_POLARITY */
ganlikun 0:13413ea9a877 92
ganlikun 0:13413ea9a877 93 uint32_t DEPolarity; /*!< configures the data enable polarity.
ganlikun 0:13413ea9a877 94 This parameter can be one of value of @ref LTDC_DE_POLARITY */
ganlikun 0:13413ea9a877 95
ganlikun 0:13413ea9a877 96 uint32_t PCPolarity; /*!< configures the pixel clock polarity.
ganlikun 0:13413ea9a877 97 This parameter can be one of value of @ref LTDC_PC_POLARITY */
ganlikun 0:13413ea9a877 98
ganlikun 0:13413ea9a877 99 uint32_t HorizontalSync; /*!< configures the number of Horizontal synchronization width.
ganlikun 0:13413ea9a877 100 This parameter must be a number between Min_Data = 0x000 and Max_Data = 0xFFF. */
ganlikun 0:13413ea9a877 101
ganlikun 0:13413ea9a877 102 uint32_t VerticalSync; /*!< configures the number of Vertical synchronization height.
ganlikun 0:13413ea9a877 103 This parameter must be a number between Min_Data = 0x000 and Max_Data = 0x7FF. */
ganlikun 0:13413ea9a877 104
ganlikun 0:13413ea9a877 105 uint32_t AccumulatedHBP; /*!< configures the accumulated horizontal back porch width.
ganlikun 0:13413ea9a877 106 This parameter must be a number between Min_Data = LTDC_HorizontalSync and Max_Data = 0xFFF. */
ganlikun 0:13413ea9a877 107
ganlikun 0:13413ea9a877 108 uint32_t AccumulatedVBP; /*!< configures the accumulated vertical back porch height.
ganlikun 0:13413ea9a877 109 This parameter must be a number between Min_Data = LTDC_VerticalSync and Max_Data = 0x7FF. */
ganlikun 0:13413ea9a877 110
ganlikun 0:13413ea9a877 111 uint32_t AccumulatedActiveW; /*!< configures the accumulated active width.
ganlikun 0:13413ea9a877 112 This parameter must be a number between Min_Data = LTDC_AccumulatedHBP and Max_Data = 0xFFF. */
ganlikun 0:13413ea9a877 113
ganlikun 0:13413ea9a877 114 uint32_t AccumulatedActiveH; /*!< configures the accumulated active height.
ganlikun 0:13413ea9a877 115 This parameter must be a number between Min_Data = LTDC_AccumulatedVBP and Max_Data = 0x7FF. */
ganlikun 0:13413ea9a877 116
ganlikun 0:13413ea9a877 117 uint32_t TotalWidth; /*!< configures the total width.
ganlikun 0:13413ea9a877 118 This parameter must be a number between Min_Data = LTDC_AccumulatedActiveW and Max_Data = 0xFFF. */
ganlikun 0:13413ea9a877 119
ganlikun 0:13413ea9a877 120 uint32_t TotalHeigh; /*!< configures the total height.
ganlikun 0:13413ea9a877 121 This parameter must be a number between Min_Data = LTDC_AccumulatedActiveH and Max_Data = 0x7FF. */
ganlikun 0:13413ea9a877 122
ganlikun 0:13413ea9a877 123 LTDC_ColorTypeDef Backcolor; /*!< Configures the background color. */
ganlikun 0:13413ea9a877 124 } LTDC_InitTypeDef;
ganlikun 0:13413ea9a877 125
ganlikun 0:13413ea9a877 126 /**
ganlikun 0:13413ea9a877 127 * @brief LTDC Layer structure definition
ganlikun 0:13413ea9a877 128 */
ganlikun 0:13413ea9a877 129 typedef struct
ganlikun 0:13413ea9a877 130 {
ganlikun 0:13413ea9a877 131 uint32_t WindowX0; /*!< Configures the Window Horizontal Start Position.
ganlikun 0:13413ea9a877 132 This parameter must be a number between Min_Data = 0x000 and Max_Data = 0xFFF. */
ganlikun 0:13413ea9a877 133
ganlikun 0:13413ea9a877 134 uint32_t WindowX1; /*!< Configures the Window Horizontal Stop Position.
ganlikun 0:13413ea9a877 135 This parameter must be a number between Min_Data = 0x000 and Max_Data = 0xFFF. */
ganlikun 0:13413ea9a877 136
ganlikun 0:13413ea9a877 137 uint32_t WindowY0; /*!< Configures the Window vertical Start Position.
ganlikun 0:13413ea9a877 138 This parameter must be a number between Min_Data = 0x000 and Max_Data = 0x7FF. */
ganlikun 0:13413ea9a877 139
ganlikun 0:13413ea9a877 140 uint32_t WindowY1; /*!< Configures the Window vertical Stop Position.
ganlikun 0:13413ea9a877 141 This parameter must be a number between Min_Data = 0x0000 and Max_Data = 0x7FF. */
ganlikun 0:13413ea9a877 142
ganlikun 0:13413ea9a877 143 uint32_t PixelFormat; /*!< Specifies the pixel format.
ganlikun 0:13413ea9a877 144 This parameter can be one of value of @ref LTDC_Pixelformat */
ganlikun 0:13413ea9a877 145
ganlikun 0:13413ea9a877 146 uint32_t Alpha; /*!< Specifies the constant alpha used for blending.
ganlikun 0:13413ea9a877 147 This parameter must be a number between Min_Data = 0x00 and Max_Data = 0xFF. */
ganlikun 0:13413ea9a877 148
ganlikun 0:13413ea9a877 149 uint32_t Alpha0; /*!< Configures the default alpha value.
ganlikun 0:13413ea9a877 150 This parameter must be a number between Min_Data = 0x00 and Max_Data = 0xFF. */
ganlikun 0:13413ea9a877 151
ganlikun 0:13413ea9a877 152 uint32_t BlendingFactor1; /*!< Select the blending factor 1.
ganlikun 0:13413ea9a877 153 This parameter can be one of value of @ref LTDC_BlendingFactor1 */
ganlikun 0:13413ea9a877 154
ganlikun 0:13413ea9a877 155 uint32_t BlendingFactor2; /*!< Select the blending factor 2.
ganlikun 0:13413ea9a877 156 This parameter can be one of value of @ref LTDC_BlendingFactor2 */
ganlikun 0:13413ea9a877 157
ganlikun 0:13413ea9a877 158 uint32_t FBStartAdress; /*!< Configures the color frame buffer address */
ganlikun 0:13413ea9a877 159
ganlikun 0:13413ea9a877 160 uint32_t ImageWidth; /*!< Configures the color frame buffer line length.
ganlikun 0:13413ea9a877 161 This parameter must be a number between Min_Data = 0x0000 and Max_Data = 0x1FFF. */
ganlikun 0:13413ea9a877 162
ganlikun 0:13413ea9a877 163 uint32_t ImageHeight; /*!< Specifies the number of line in frame buffer.
ganlikun 0:13413ea9a877 164 This parameter must be a number between Min_Data = 0x000 and Max_Data = 0x7FF. */
ganlikun 0:13413ea9a877 165
ganlikun 0:13413ea9a877 166 LTDC_ColorTypeDef Backcolor; /*!< Configures the layer background color. */
ganlikun 0:13413ea9a877 167 } LTDC_LayerCfgTypeDef;
ganlikun 0:13413ea9a877 168
ganlikun 0:13413ea9a877 169 /**
ganlikun 0:13413ea9a877 170 * @brief HAL LTDC State structures definition
ganlikun 0:13413ea9a877 171 */
ganlikun 0:13413ea9a877 172 typedef enum
ganlikun 0:13413ea9a877 173 {
ganlikun 0:13413ea9a877 174 HAL_LTDC_STATE_RESET = 0x00U, /*!< LTDC not yet initialized or disabled */
ganlikun 0:13413ea9a877 175 HAL_LTDC_STATE_READY = 0x01U, /*!< LTDC initialized and ready for use */
ganlikun 0:13413ea9a877 176 HAL_LTDC_STATE_BUSY = 0x02U, /*!< LTDC internal process is ongoing */
ganlikun 0:13413ea9a877 177 HAL_LTDC_STATE_TIMEOUT = 0x03U, /*!< LTDC Timeout state */
ganlikun 0:13413ea9a877 178 HAL_LTDC_STATE_ERROR = 0x04U /*!< LTDC state error */
ganlikun 0:13413ea9a877 179 }HAL_LTDC_StateTypeDef;
ganlikun 0:13413ea9a877 180
ganlikun 0:13413ea9a877 181 /**
ganlikun 0:13413ea9a877 182 * @brief LTDC handle Structure definition
ganlikun 0:13413ea9a877 183 */
ganlikun 0:13413ea9a877 184 typedef struct
ganlikun 0:13413ea9a877 185 {
ganlikun 0:13413ea9a877 186 LTDC_TypeDef *Instance; /*!< LTDC Register base address */
ganlikun 0:13413ea9a877 187
ganlikun 0:13413ea9a877 188 LTDC_InitTypeDef Init; /*!< LTDC parameters */
ganlikun 0:13413ea9a877 189
ganlikun 0:13413ea9a877 190 LTDC_LayerCfgTypeDef LayerCfg[MAX_LAYER]; /*!< LTDC Layers parameters */
ganlikun 0:13413ea9a877 191
ganlikun 0:13413ea9a877 192 HAL_LockTypeDef Lock; /*!< LTDC Lock */
ganlikun 0:13413ea9a877 193
ganlikun 0:13413ea9a877 194 __IO HAL_LTDC_StateTypeDef State; /*!< LTDC state */
ganlikun 0:13413ea9a877 195
ganlikun 0:13413ea9a877 196 __IO uint32_t ErrorCode; /*!< LTDC Error code */
ganlikun 0:13413ea9a877 197
ganlikun 0:13413ea9a877 198 } LTDC_HandleTypeDef;
ganlikun 0:13413ea9a877 199 /**
ganlikun 0:13413ea9a877 200 * @}
ganlikun 0:13413ea9a877 201 */
ganlikun 0:13413ea9a877 202
ganlikun 0:13413ea9a877 203 /* Exported constants --------------------------------------------------------*/
ganlikun 0:13413ea9a877 204 /** @defgroup LTDC_Exported_Constants LTDC Exported Constants
ganlikun 0:13413ea9a877 205 * @{
ganlikun 0:13413ea9a877 206 */
ganlikun 0:13413ea9a877 207
ganlikun 0:13413ea9a877 208 /** @defgroup LTDC_Error_Code LTDC Error Code
ganlikun 0:13413ea9a877 209 * @{
ganlikun 0:13413ea9a877 210 */
ganlikun 0:13413ea9a877 211 #define HAL_LTDC_ERROR_NONE 0x00000000U /*!< LTDC No error */
ganlikun 0:13413ea9a877 212 #define HAL_LTDC_ERROR_TE 0x00000001U /*!< LTDC Transfer error */
ganlikun 0:13413ea9a877 213 #define HAL_LTDC_ERROR_FU 0x00000002U /*!< LTDC FIFO Underrun */
ganlikun 0:13413ea9a877 214 #define HAL_LTDC_ERROR_TIMEOUT 0x00000020U /*!< LTDC Timeout error */
ganlikun 0:13413ea9a877 215 /**
ganlikun 0:13413ea9a877 216 * @}
ganlikun 0:13413ea9a877 217 */
ganlikun 0:13413ea9a877 218
ganlikun 0:13413ea9a877 219 /** @defgroup LTDC_Layer LTDC Layer
ganlikun 0:13413ea9a877 220 * @{
ganlikun 0:13413ea9a877 221 */
ganlikun 0:13413ea9a877 222 #define LTDC_LAYER_1 0x00000000U /*!< LTDC Layer 1 */
ganlikun 0:13413ea9a877 223 #define LTDC_LAYER_2 0x00000001U /*!< LTDC Layer 2 */
ganlikun 0:13413ea9a877 224 /**
ganlikun 0:13413ea9a877 225 * @}
ganlikun 0:13413ea9a877 226 */
ganlikun 0:13413ea9a877 227
ganlikun 0:13413ea9a877 228 /** @defgroup LTDC_HS_POLARITY LTDC HS POLARITY
ganlikun 0:13413ea9a877 229 * @{
ganlikun 0:13413ea9a877 230 */
ganlikun 0:13413ea9a877 231 #define LTDC_HSPOLARITY_AL 0x00000000U /*!< Horizontal Synchronization is active low. */
ganlikun 0:13413ea9a877 232 #define LTDC_HSPOLARITY_AH LTDC_GCR_HSPOL /*!< Horizontal Synchronization is active high. */
ganlikun 0:13413ea9a877 233 /**
ganlikun 0:13413ea9a877 234 * @}
ganlikun 0:13413ea9a877 235 */
ganlikun 0:13413ea9a877 236
ganlikun 0:13413ea9a877 237 /** @defgroup LTDC_VS_POLARITY LTDC VS POLARITY
ganlikun 0:13413ea9a877 238 * @{
ganlikun 0:13413ea9a877 239 */
ganlikun 0:13413ea9a877 240 #define LTDC_VSPOLARITY_AL 0x00000000U /*!< Vertical Synchronization is active low. */
ganlikun 0:13413ea9a877 241 #define LTDC_VSPOLARITY_AH LTDC_GCR_VSPOL /*!< Vertical Synchronization is active high. */
ganlikun 0:13413ea9a877 242 /**
ganlikun 0:13413ea9a877 243 * @}
ganlikun 0:13413ea9a877 244 */
ganlikun 0:13413ea9a877 245
ganlikun 0:13413ea9a877 246 /** @defgroup LTDC_DE_POLARITY LTDC DE POLARITY
ganlikun 0:13413ea9a877 247 * @{
ganlikun 0:13413ea9a877 248 */
ganlikun 0:13413ea9a877 249 #define LTDC_DEPOLARITY_AL 0x00000000U /*!< Data Enable, is active low. */
ganlikun 0:13413ea9a877 250 #define LTDC_DEPOLARITY_AH LTDC_GCR_DEPOL /*!< Data Enable, is active high. */
ganlikun 0:13413ea9a877 251 /**
ganlikun 0:13413ea9a877 252 * @}
ganlikun 0:13413ea9a877 253 */
ganlikun 0:13413ea9a877 254
ganlikun 0:13413ea9a877 255 /** @defgroup LTDC_PC_POLARITY LTDC PC POLARITY
ganlikun 0:13413ea9a877 256 * @{
ganlikun 0:13413ea9a877 257 */
ganlikun 0:13413ea9a877 258 #define LTDC_PCPOLARITY_IPC 0x00000000U /*!< input pixel clock. */
ganlikun 0:13413ea9a877 259 #define LTDC_PCPOLARITY_IIPC LTDC_GCR_PCPOL /*!< inverted input pixel clock. */
ganlikun 0:13413ea9a877 260 /**
ganlikun 0:13413ea9a877 261 * @}
ganlikun 0:13413ea9a877 262 */
ganlikun 0:13413ea9a877 263
ganlikun 0:13413ea9a877 264 /** @defgroup LTDC_SYNC LTDC SYNC
ganlikun 0:13413ea9a877 265 * @{
ganlikun 0:13413ea9a877 266 */
ganlikun 0:13413ea9a877 267 #define LTDC_HORIZONTALSYNC (LTDC_SSCR_HSW >> 16U) /*!< Horizontal synchronization width. */
ganlikun 0:13413ea9a877 268 #define LTDC_VERTICALSYNC LTDC_SSCR_VSH /*!< Vertical synchronization height. */
ganlikun 0:13413ea9a877 269 /**
ganlikun 0:13413ea9a877 270 * @}
ganlikun 0:13413ea9a877 271 */
ganlikun 0:13413ea9a877 272
ganlikun 0:13413ea9a877 273 /** @defgroup LTDC_BACK_COLOR LTDC BACK COLOR
ganlikun 0:13413ea9a877 274 * @{
ganlikun 0:13413ea9a877 275 */
ganlikun 0:13413ea9a877 276 #define LTDC_COLOR 0x000000FFU /*!< Color mask */
ganlikun 0:13413ea9a877 277 /**
ganlikun 0:13413ea9a877 278 * @}
ganlikun 0:13413ea9a877 279 */
ganlikun 0:13413ea9a877 280
ganlikun 0:13413ea9a877 281 /** @defgroup LTDC_BlendingFactor1 LTDC Blending Factor1
ganlikun 0:13413ea9a877 282 * @{
ganlikun 0:13413ea9a877 283 */
ganlikun 0:13413ea9a877 284 #define LTDC_BLENDING_FACTOR1_CA 0x00000400U /*!< Blending factor : Cte Alpha */
ganlikun 0:13413ea9a877 285 #define LTDC_BLENDING_FACTOR1_PAxCA 0x00000600U /*!< Blending factor : Cte Alpha x Pixel Alpha*/
ganlikun 0:13413ea9a877 286 /**
ganlikun 0:13413ea9a877 287 * @}
ganlikun 0:13413ea9a877 288 */
ganlikun 0:13413ea9a877 289
ganlikun 0:13413ea9a877 290 /** @defgroup LTDC_BlendingFactor2 LTDC Blending Factor2
ganlikun 0:13413ea9a877 291 * @{
ganlikun 0:13413ea9a877 292 */
ganlikun 0:13413ea9a877 293 #define LTDC_BLENDING_FACTOR2_CA 0x00000005U /*!< Blending factor : Cte Alpha */
ganlikun 0:13413ea9a877 294 #define LTDC_BLENDING_FACTOR2_PAxCA 0x00000007U /*!< Blending factor : Cte Alpha x Pixel Alpha*/
ganlikun 0:13413ea9a877 295 /**
ganlikun 0:13413ea9a877 296 * @}
ganlikun 0:13413ea9a877 297 */
ganlikun 0:13413ea9a877 298
ganlikun 0:13413ea9a877 299 /** @defgroup LTDC_Pixelformat LTDC Pixel format
ganlikun 0:13413ea9a877 300 * @{
ganlikun 0:13413ea9a877 301 */
ganlikun 0:13413ea9a877 302 #define LTDC_PIXEL_FORMAT_ARGB8888 0x00000000U /*!< ARGB8888 LTDC pixel format */
ganlikun 0:13413ea9a877 303 #define LTDC_PIXEL_FORMAT_RGB888 0x00000001U /*!< RGB888 LTDC pixel format */
ganlikun 0:13413ea9a877 304 #define LTDC_PIXEL_FORMAT_RGB565 0x00000002U /*!< RGB565 LTDC pixel format */
ganlikun 0:13413ea9a877 305 #define LTDC_PIXEL_FORMAT_ARGB1555 0x00000003U /*!< ARGB1555 LTDC pixel format */
ganlikun 0:13413ea9a877 306 #define LTDC_PIXEL_FORMAT_ARGB4444 0x00000004U /*!< ARGB4444 LTDC pixel format */
ganlikun 0:13413ea9a877 307 #define LTDC_PIXEL_FORMAT_L8 0x00000005U /*!< L8 LTDC pixel format */
ganlikun 0:13413ea9a877 308 #define LTDC_PIXEL_FORMAT_AL44 0x00000006U /*!< AL44 LTDC pixel format */
ganlikun 0:13413ea9a877 309 #define LTDC_PIXEL_FORMAT_AL88 0x00000007U /*!< AL88 LTDC pixel format */
ganlikun 0:13413ea9a877 310 /**
ganlikun 0:13413ea9a877 311 * @}
ganlikun 0:13413ea9a877 312 */
ganlikun 0:13413ea9a877 313
ganlikun 0:13413ea9a877 314 /** @defgroup LTDC_Alpha LTDC Alpha
ganlikun 0:13413ea9a877 315 * @{
ganlikun 0:13413ea9a877 316 */
ganlikun 0:13413ea9a877 317 #define LTDC_ALPHA LTDC_LxCACR_CONSTA /*!< LTDC Constant Alpha mask */
ganlikun 0:13413ea9a877 318 /**
ganlikun 0:13413ea9a877 319 * @}
ganlikun 0:13413ea9a877 320 */
ganlikun 0:13413ea9a877 321
ganlikun 0:13413ea9a877 322 /** @defgroup LTDC_LAYER_Config LTDC LAYER Config
ganlikun 0:13413ea9a877 323 * @{
ganlikun 0:13413ea9a877 324 */
ganlikun 0:13413ea9a877 325 #define LTDC_STOPPOSITION (LTDC_LxWHPCR_WHSPPOS >> 16U) /*!< LTDC Layer stop position */
ganlikun 0:13413ea9a877 326 #define LTDC_STARTPOSITION LTDC_LxWHPCR_WHSTPOS /*!< LTDC Layer start position */
ganlikun 0:13413ea9a877 327
ganlikun 0:13413ea9a877 328 #define LTDC_COLOR_FRAME_BUFFER LTDC_LxCFBLR_CFBLL /*!< LTDC Layer Line length */
ganlikun 0:13413ea9a877 329 #define LTDC_LINE_NUMBER LTDC_LxCFBLNR_CFBLNBR /*!< LTDC Layer Line number */
ganlikun 0:13413ea9a877 330 /**
ganlikun 0:13413ea9a877 331 * @}
ganlikun 0:13413ea9a877 332 */
ganlikun 0:13413ea9a877 333
ganlikun 0:13413ea9a877 334 /** @defgroup LTDC_Interrupts LTDC Interrupts
ganlikun 0:13413ea9a877 335 * @{
ganlikun 0:13413ea9a877 336 */
ganlikun 0:13413ea9a877 337 #define LTDC_IT_LI LTDC_IER_LIE /*!< LTDC Line Interrupt */
ganlikun 0:13413ea9a877 338 #define LTDC_IT_FU LTDC_IER_FUIE /*!< LTDC FIFO Underrun Interrupt */
ganlikun 0:13413ea9a877 339 #define LTDC_IT_TE LTDC_IER_TERRIE /*!< LTDC Transfer Error Interrupt */
ganlikun 0:13413ea9a877 340 #define LTDC_IT_RR LTDC_IER_RRIE /*!< LTDC Register Reload Interrupt */
ganlikun 0:13413ea9a877 341 /**
ganlikun 0:13413ea9a877 342 * @}
ganlikun 0:13413ea9a877 343 */
ganlikun 0:13413ea9a877 344
ganlikun 0:13413ea9a877 345 /** @defgroup LTDC_Flags LTDC Flags
ganlikun 0:13413ea9a877 346 * @{
ganlikun 0:13413ea9a877 347 */
ganlikun 0:13413ea9a877 348 #define LTDC_FLAG_LI LTDC_ISR_LIF /*!< LTDC Line Interrupt Flag */
ganlikun 0:13413ea9a877 349 #define LTDC_FLAG_FU LTDC_ISR_FUIF /*!< LTDC FIFO Underrun interrupt Flag */
ganlikun 0:13413ea9a877 350 #define LTDC_FLAG_TE LTDC_ISR_TERRIF /*!< LTDC Transfer Error interrupt Flag */
ganlikun 0:13413ea9a877 351 #define LTDC_FLAG_RR LTDC_ISR_RRIF /*!< LTDC Register Reload interrupt Flag */
ganlikun 0:13413ea9a877 352 /**
ganlikun 0:13413ea9a877 353 * @}
ganlikun 0:13413ea9a877 354 */
ganlikun 0:13413ea9a877 355
ganlikun 0:13413ea9a877 356 /** @defgroup LTDC_Reload_Type LTDC Reload Type
ganlikun 0:13413ea9a877 357 * @{
ganlikun 0:13413ea9a877 358 */
ganlikun 0:13413ea9a877 359 #define LTDC_RELOAD_IMMEDIATE LTDC_SRCR_IMR /*!< Immediate Reload */
ganlikun 0:13413ea9a877 360 #define LTDC_RELOAD_VERTICAL_BLANKING LTDC_SRCR_VBR /*!< Vertical Blanking Reload */
ganlikun 0:13413ea9a877 361 /**
ganlikun 0:13413ea9a877 362 * @}
ganlikun 0:13413ea9a877 363 */
ganlikun 0:13413ea9a877 364
ganlikun 0:13413ea9a877 365 /**
ganlikun 0:13413ea9a877 366 * @}
ganlikun 0:13413ea9a877 367 */
ganlikun 0:13413ea9a877 368
ganlikun 0:13413ea9a877 369 /* Exported macro ------------------------------------------------------------*/
ganlikun 0:13413ea9a877 370 /** @defgroup LTDC_Exported_Macros LTDC Exported Macros
ganlikun 0:13413ea9a877 371 * @{
ganlikun 0:13413ea9a877 372 */
ganlikun 0:13413ea9a877 373
ganlikun 0:13413ea9a877 374 /** @brief Reset LTDC handle state.
ganlikun 0:13413ea9a877 375 * @param __HANDLE__ LTDC handle
ganlikun 0:13413ea9a877 376 * @retval None
ganlikun 0:13413ea9a877 377 */
ganlikun 0:13413ea9a877 378 #define __HAL_LTDC_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_LTDC_STATE_RESET)
ganlikun 0:13413ea9a877 379
ganlikun 0:13413ea9a877 380 /**
ganlikun 0:13413ea9a877 381 * @brief Enable the LTDC.
ganlikun 0:13413ea9a877 382 * @param __HANDLE__ LTDC handle
ganlikun 0:13413ea9a877 383 * @retval None.
ganlikun 0:13413ea9a877 384 */
ganlikun 0:13413ea9a877 385 #define __HAL_LTDC_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->GCR |= LTDC_GCR_LTDCEN)
ganlikun 0:13413ea9a877 386
ganlikun 0:13413ea9a877 387 /**
ganlikun 0:13413ea9a877 388 * @brief Disable the LTDC.
ganlikun 0:13413ea9a877 389 * @param __HANDLE__ LTDC handle
ganlikun 0:13413ea9a877 390 * @retval None.
ganlikun 0:13413ea9a877 391 */
ganlikun 0:13413ea9a877 392 #define __HAL_LTDC_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->GCR &= ~(LTDC_GCR_LTDCEN))
ganlikun 0:13413ea9a877 393
ganlikun 0:13413ea9a877 394 /**
ganlikun 0:13413ea9a877 395 * @brief Enable the LTDC Layer.
ganlikun 0:13413ea9a877 396 * @param __HANDLE__ LTDC handle
ganlikun 0:13413ea9a877 397 * @param __LAYER__ Specify the layer to be enabled.
ganlikun 0:13413ea9a877 398 * This parameter can be LTDC_LAYER_1 (0) or LTDC_LAYER_2 (1).
ganlikun 0:13413ea9a877 399 * @retval None.
ganlikun 0:13413ea9a877 400 */
ganlikun 0:13413ea9a877 401 #define __HAL_LTDC_LAYER_ENABLE(__HANDLE__, __LAYER__) ((LTDC_LAYER((__HANDLE__), (__LAYER__)))->CR |= (uint32_t)LTDC_LxCR_LEN)
ganlikun 0:13413ea9a877 402
ganlikun 0:13413ea9a877 403 /**
ganlikun 0:13413ea9a877 404 * @brief Disable the LTDC Layer.
ganlikun 0:13413ea9a877 405 * @param __HANDLE__ LTDC handle
ganlikun 0:13413ea9a877 406 * @param __LAYER__ Specify the layer to be disabled.
ganlikun 0:13413ea9a877 407 * This parameter can be LTDC_LAYER_1 (0) or LTDC_LAYER_2 (1).
ganlikun 0:13413ea9a877 408 * @retval None.
ganlikun 0:13413ea9a877 409 */
ganlikun 0:13413ea9a877 410 #define __HAL_LTDC_LAYER_DISABLE(__HANDLE__, __LAYER__) ((LTDC_LAYER((__HANDLE__), (__LAYER__)))->CR &= ~(uint32_t)LTDC_LxCR_LEN)
ganlikun 0:13413ea9a877 411
ganlikun 0:13413ea9a877 412 /**
ganlikun 0:13413ea9a877 413 * @brief Reload immediately all LTDC Layers.
ganlikun 0:13413ea9a877 414 * @param __HANDLE__ LTDC handle
ganlikun 0:13413ea9a877 415 * @retval None.
ganlikun 0:13413ea9a877 416 */
ganlikun 0:13413ea9a877 417 #define __HAL_LTDC_RELOAD_IMMEDIATE_CONFIG(__HANDLE__) ((__HANDLE__)->Instance->SRCR |= LTDC_SRCR_IMR)
ganlikun 0:13413ea9a877 418
ganlikun 0:13413ea9a877 419 /**
ganlikun 0:13413ea9a877 420 * @brief Reload during vertical blanking period all LTDC Layers.
ganlikun 0:13413ea9a877 421 * @param __HANDLE__ LTDC handle
ganlikun 0:13413ea9a877 422 * @retval None.
ganlikun 0:13413ea9a877 423 */
ganlikun 0:13413ea9a877 424 #define __HAL_LTDC_VERTICAL_BLANKING_RELOAD_CONFIG(__HANDLE__) ((__HANDLE__)->Instance->SRCR |= LTDC_SRCR_VBR)
ganlikun 0:13413ea9a877 425
ganlikun 0:13413ea9a877 426 /* Interrupt & Flag management */
ganlikun 0:13413ea9a877 427 /**
ganlikun 0:13413ea9a877 428 * @brief Get the LTDC pending flags.
ganlikun 0:13413ea9a877 429 * @param __HANDLE__ LTDC handle
ganlikun 0:13413ea9a877 430 * @param __FLAG__ Get the specified flag.
ganlikun 0:13413ea9a877 431 * This parameter can be any combination of the following values:
ganlikun 0:13413ea9a877 432 * @arg LTDC_FLAG_LI: Line Interrupt flag
ganlikun 0:13413ea9a877 433 * @arg LTDC_FLAG_FU: FIFO Underrun Interrupt flag
ganlikun 0:13413ea9a877 434 * @arg LTDC_FLAG_TE: Transfer Error interrupt flag
ganlikun 0:13413ea9a877 435 * @arg LTDC_FLAG_RR: Register Reload Interrupt Flag
ganlikun 0:13413ea9a877 436 * @retval The state of FLAG (SET or RESET).
ganlikun 0:13413ea9a877 437 */
ganlikun 0:13413ea9a877 438 #define __HAL_LTDC_GET_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR & (__FLAG__))
ganlikun 0:13413ea9a877 439
ganlikun 0:13413ea9a877 440 /**
ganlikun 0:13413ea9a877 441 * @brief Clears the LTDC pending flags.
ganlikun 0:13413ea9a877 442 * @param __HANDLE__ LTDC handle
ganlikun 0:13413ea9a877 443 * @param __FLAG__ Specify the flag to clear.
ganlikun 0:13413ea9a877 444 * This parameter can be any combination of the following values:
ganlikun 0:13413ea9a877 445 * @arg LTDC_FLAG_LI: Line Interrupt flag
ganlikun 0:13413ea9a877 446 * @arg LTDC_FLAG_FU: FIFO Underrun Interrupt flag
ganlikun 0:13413ea9a877 447 * @arg LTDC_FLAG_TE: Transfer Error interrupt flag
ganlikun 0:13413ea9a877 448 * @arg LTDC_FLAG_RR: Register Reload Interrupt Flag
ganlikun 0:13413ea9a877 449 * @retval None
ganlikun 0:13413ea9a877 450 */
ganlikun 0:13413ea9a877 451 #define __HAL_LTDC_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ICR = (__FLAG__))
ganlikun 0:13413ea9a877 452
ganlikun 0:13413ea9a877 453 /**
ganlikun 0:13413ea9a877 454 * @brief Enables the specified LTDC interrupts.
ganlikun 0:13413ea9a877 455 * @param __HANDLE__ LTDC handle
ganlikun 0:13413ea9a877 456 * @param __INTERRUPT__ Specify the LTDC interrupt sources to be enabled.
ganlikun 0:13413ea9a877 457 * This parameter can be any combination of the following values:
ganlikun 0:13413ea9a877 458 * @arg LTDC_IT_LI: Line Interrupt flag
ganlikun 0:13413ea9a877 459 * @arg LTDC_IT_FU: FIFO Underrun Interrupt flag
ganlikun 0:13413ea9a877 460 * @arg LTDC_IT_TE: Transfer Error interrupt flag
ganlikun 0:13413ea9a877 461 * @arg LTDC_IT_RR: Register Reload Interrupt Flag
ganlikun 0:13413ea9a877 462 * @retval None
ganlikun 0:13413ea9a877 463 */
ganlikun 0:13413ea9a877 464 #define __HAL_LTDC_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->IER |= (__INTERRUPT__))
ganlikun 0:13413ea9a877 465
ganlikun 0:13413ea9a877 466 /**
ganlikun 0:13413ea9a877 467 * @brief Disables the specified LTDC interrupts.
ganlikun 0:13413ea9a877 468 * @param __HANDLE__ LTDC handle
ganlikun 0:13413ea9a877 469 * @param __INTERRUPT__ Specify the LTDC interrupt sources to be disabled.
ganlikun 0:13413ea9a877 470 * This parameter can be any combination of the following values:
ganlikun 0:13413ea9a877 471 * @arg LTDC_IT_LI: Line Interrupt flag
ganlikun 0:13413ea9a877 472 * @arg LTDC_IT_FU: FIFO Underrun Interrupt flag
ganlikun 0:13413ea9a877 473 * @arg LTDC_IT_TE: Transfer Error interrupt flag
ganlikun 0:13413ea9a877 474 * @arg LTDC_IT_RR: Register Reload Interrupt Flag
ganlikun 0:13413ea9a877 475 * @retval None
ganlikun 0:13413ea9a877 476 */
ganlikun 0:13413ea9a877 477 #define __HAL_LTDC_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->IER &= ~(__INTERRUPT__))
ganlikun 0:13413ea9a877 478
ganlikun 0:13413ea9a877 479 /**
ganlikun 0:13413ea9a877 480 * @brief Check whether the specified LTDC interrupt has occurred or not.
ganlikun 0:13413ea9a877 481 * @param __HANDLE__ LTDC handle
ganlikun 0:13413ea9a877 482 * @param __INTERRUPT__ Specify the LTDC interrupt source to check.
ganlikun 0:13413ea9a877 483 * This parameter can be one of the following values:
ganlikun 0:13413ea9a877 484 * @arg LTDC_IT_LI: Line Interrupt flag
ganlikun 0:13413ea9a877 485 * @arg LTDC_IT_FU: FIFO Underrun Interrupt flag
ganlikun 0:13413ea9a877 486 * @arg LTDC_IT_TE: Transfer Error interrupt flag
ganlikun 0:13413ea9a877 487 * @arg LTDC_IT_RR: Register Reload Interrupt Flag
ganlikun 0:13413ea9a877 488 * @retval The state of INTERRUPT (SET or RESET).
ganlikun 0:13413ea9a877 489 */
ganlikun 0:13413ea9a877 490 #define __HAL_LTDC_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->IER & (__INTERRUPT__))
ganlikun 0:13413ea9a877 491 /**
ganlikun 0:13413ea9a877 492 * @}
ganlikun 0:13413ea9a877 493 */
ganlikun 0:13413ea9a877 494
ganlikun 0:13413ea9a877 495 /* Include LTDC HAL Extension module */
ganlikun 0:13413ea9a877 496 #include "stm32f4xx_hal_ltdc_ex.h"
ganlikun 0:13413ea9a877 497
ganlikun 0:13413ea9a877 498 /* Exported functions --------------------------------------------------------*/
ganlikun 0:13413ea9a877 499 /** @addtogroup LTDC_Exported_Functions
ganlikun 0:13413ea9a877 500 * @{
ganlikun 0:13413ea9a877 501 */
ganlikun 0:13413ea9a877 502 /** @addtogroup LTDC_Exported_Functions_Group1
ganlikun 0:13413ea9a877 503 * @{
ganlikun 0:13413ea9a877 504 */
ganlikun 0:13413ea9a877 505 /* Initialization and de-initialization functions *****************************/
ganlikun 0:13413ea9a877 506 HAL_StatusTypeDef HAL_LTDC_Init(LTDC_HandleTypeDef *hltdc);
ganlikun 0:13413ea9a877 507 HAL_StatusTypeDef HAL_LTDC_DeInit(LTDC_HandleTypeDef *hltdc);
ganlikun 0:13413ea9a877 508 void HAL_LTDC_MspInit(LTDC_HandleTypeDef* hltdc);
ganlikun 0:13413ea9a877 509 void HAL_LTDC_MspDeInit(LTDC_HandleTypeDef* hltdc);
ganlikun 0:13413ea9a877 510 void HAL_LTDC_ErrorCallback(LTDC_HandleTypeDef *hltdc);
ganlikun 0:13413ea9a877 511 void HAL_LTDC_LineEventCallback(LTDC_HandleTypeDef *hltdc);
ganlikun 0:13413ea9a877 512 void HAL_LTDC_ReloadEventCallback(LTDC_HandleTypeDef *hltdc);
ganlikun 0:13413ea9a877 513 /**
ganlikun 0:13413ea9a877 514 * @}
ganlikun 0:13413ea9a877 515 */
ganlikun 0:13413ea9a877 516
ganlikun 0:13413ea9a877 517 /** @addtogroup LTDC_Exported_Functions_Group2
ganlikun 0:13413ea9a877 518 * @{
ganlikun 0:13413ea9a877 519 */
ganlikun 0:13413ea9a877 520 /* IO operation functions *****************************************************/
ganlikun 0:13413ea9a877 521 void HAL_LTDC_IRQHandler(LTDC_HandleTypeDef *hltdc);
ganlikun 0:13413ea9a877 522 /**
ganlikun 0:13413ea9a877 523 * @}
ganlikun 0:13413ea9a877 524 */
ganlikun 0:13413ea9a877 525
ganlikun 0:13413ea9a877 526 /** @addtogroup LTDC_Exported_Functions_Group3
ganlikun 0:13413ea9a877 527 * @{
ganlikun 0:13413ea9a877 528 */
ganlikun 0:13413ea9a877 529 /* Peripheral Control functions ***********************************************/
ganlikun 0:13413ea9a877 530 HAL_StatusTypeDef HAL_LTDC_ConfigLayer(LTDC_HandleTypeDef *hltdc, LTDC_LayerCfgTypeDef *pLayerCfg, uint32_t LayerIdx);
ganlikun 0:13413ea9a877 531 HAL_StatusTypeDef HAL_LTDC_SetWindowSize(LTDC_HandleTypeDef *hltdc, uint32_t XSize, uint32_t YSize, uint32_t LayerIdx);
ganlikun 0:13413ea9a877 532 HAL_StatusTypeDef HAL_LTDC_SetWindowPosition(LTDC_HandleTypeDef *hltdc, uint32_t X0, uint32_t Y0, uint32_t LayerIdx);
ganlikun 0:13413ea9a877 533 HAL_StatusTypeDef HAL_LTDC_SetPixelFormat(LTDC_HandleTypeDef *hltdc, uint32_t Pixelformat, uint32_t LayerIdx);
ganlikun 0:13413ea9a877 534 HAL_StatusTypeDef HAL_LTDC_SetAlpha(LTDC_HandleTypeDef *hltdc, uint32_t Alpha, uint32_t LayerIdx);
ganlikun 0:13413ea9a877 535 HAL_StatusTypeDef HAL_LTDC_SetAddress(LTDC_HandleTypeDef *hltdc, uint32_t Address, uint32_t LayerIdx);
ganlikun 0:13413ea9a877 536 HAL_StatusTypeDef HAL_LTDC_SetPitch(LTDC_HandleTypeDef *hltdc, uint32_t LinePitchInPixels, uint32_t LayerIdx);
ganlikun 0:13413ea9a877 537 HAL_StatusTypeDef HAL_LTDC_ConfigColorKeying(LTDC_HandleTypeDef *hltdc, uint32_t RGBValue, uint32_t LayerIdx);
ganlikun 0:13413ea9a877 538 HAL_StatusTypeDef HAL_LTDC_ConfigCLUT(LTDC_HandleTypeDef *hltdc, uint32_t *pCLUT, uint32_t CLUTSize, uint32_t LayerIdx);
ganlikun 0:13413ea9a877 539 HAL_StatusTypeDef HAL_LTDC_EnableColorKeying(LTDC_HandleTypeDef *hltdc, uint32_t LayerIdx);
ganlikun 0:13413ea9a877 540 HAL_StatusTypeDef HAL_LTDC_DisableColorKeying(LTDC_HandleTypeDef *hltdc, uint32_t LayerIdx);
ganlikun 0:13413ea9a877 541 HAL_StatusTypeDef HAL_LTDC_EnableCLUT(LTDC_HandleTypeDef *hltdc, uint32_t LayerIdx);
ganlikun 0:13413ea9a877 542 HAL_StatusTypeDef HAL_LTDC_DisableCLUT(LTDC_HandleTypeDef *hltdc, uint32_t LayerIdx);
ganlikun 0:13413ea9a877 543 HAL_StatusTypeDef HAL_LTDC_ProgramLineEvent(LTDC_HandleTypeDef *hltdc, uint32_t Line);
ganlikun 0:13413ea9a877 544 HAL_StatusTypeDef HAL_LTDC_EnableDither(LTDC_HandleTypeDef *hltdc);
ganlikun 0:13413ea9a877 545 HAL_StatusTypeDef HAL_LTDC_DisableDither(LTDC_HandleTypeDef *hltdc);
ganlikun 0:13413ea9a877 546 HAL_StatusTypeDef HAL_LTDC_Reload(LTDC_HandleTypeDef *hltdc, uint32_t ReloadType);
ganlikun 0:13413ea9a877 547 HAL_StatusTypeDef HAL_LTDC_ConfigLayer_NoReload(LTDC_HandleTypeDef *hltdc, LTDC_LayerCfgTypeDef *pLayerCfg, uint32_t LayerIdx);
ganlikun 0:13413ea9a877 548 HAL_StatusTypeDef HAL_LTDC_SetWindowSize_NoReload(LTDC_HandleTypeDef *hltdc, uint32_t XSize, uint32_t YSize, uint32_t LayerIdx);
ganlikun 0:13413ea9a877 549 HAL_StatusTypeDef HAL_LTDC_SetWindowPosition_NoReload(LTDC_HandleTypeDef *hltdc, uint32_t X0, uint32_t Y0, uint32_t LayerIdx);
ganlikun 0:13413ea9a877 550 HAL_StatusTypeDef HAL_LTDC_SetPixelFormat_NoReload(LTDC_HandleTypeDef *hltdc, uint32_t Pixelformat, uint32_t LayerIdx);
ganlikun 0:13413ea9a877 551 HAL_StatusTypeDef HAL_LTDC_SetAlpha_NoReload(LTDC_HandleTypeDef *hltdc, uint32_t Alpha, uint32_t LayerIdx);
ganlikun 0:13413ea9a877 552 HAL_StatusTypeDef HAL_LTDC_SetAddress_NoReload(LTDC_HandleTypeDef *hltdc, uint32_t Address, uint32_t LayerIdx);
ganlikun 0:13413ea9a877 553 HAL_StatusTypeDef HAL_LTDC_SetPitch_NoReload(LTDC_HandleTypeDef *hltdc, uint32_t LinePitchInPixels, uint32_t LayerIdx);
ganlikun 0:13413ea9a877 554 HAL_StatusTypeDef HAL_LTDC_ConfigColorKeying_NoReload(LTDC_HandleTypeDef *hltdc, uint32_t RGBValue, uint32_t LayerIdx);
ganlikun 0:13413ea9a877 555 HAL_StatusTypeDef HAL_LTDC_EnableColorKeying_NoReload(LTDC_HandleTypeDef *hltdc, uint32_t LayerIdx);
ganlikun 0:13413ea9a877 556 HAL_StatusTypeDef HAL_LTDC_DisableColorKeying_NoReload(LTDC_HandleTypeDef *hltdc, uint32_t LayerIdx);
ganlikun 0:13413ea9a877 557 HAL_StatusTypeDef HAL_LTDC_EnableCLUT_NoReload(LTDC_HandleTypeDef *hltdc, uint32_t LayerIdx);
ganlikun 0:13413ea9a877 558 HAL_StatusTypeDef HAL_LTDC_DisableCLUT_NoReload(LTDC_HandleTypeDef *hltdc, uint32_t LayerIdx);
ganlikun 0:13413ea9a877 559
ganlikun 0:13413ea9a877 560 /**
ganlikun 0:13413ea9a877 561 * @}
ganlikun 0:13413ea9a877 562 */
ganlikun 0:13413ea9a877 563
ganlikun 0:13413ea9a877 564 /** @addtogroup LTDC_Exported_Functions_Group4
ganlikun 0:13413ea9a877 565 * @{
ganlikun 0:13413ea9a877 566 */
ganlikun 0:13413ea9a877 567 /* Peripheral State functions *************************************************/
ganlikun 0:13413ea9a877 568 HAL_LTDC_StateTypeDef HAL_LTDC_GetState(LTDC_HandleTypeDef *hltdc);
ganlikun 0:13413ea9a877 569 uint32_t HAL_LTDC_GetError(LTDC_HandleTypeDef *hltdc);
ganlikun 0:13413ea9a877 570 /**
ganlikun 0:13413ea9a877 571 * @}
ganlikun 0:13413ea9a877 572 */
ganlikun 0:13413ea9a877 573
ganlikun 0:13413ea9a877 574 /**
ganlikun 0:13413ea9a877 575 * @}
ganlikun 0:13413ea9a877 576 */
ganlikun 0:13413ea9a877 577
ganlikun 0:13413ea9a877 578 /* Private types -------------------------------------------------------------*/
ganlikun 0:13413ea9a877 579 /* Private variables ---------------------------------------------------------*/
ganlikun 0:13413ea9a877 580 /* Private constants ---------------------------------------------------------*/
ganlikun 0:13413ea9a877 581 /* Private macros ------------------------------------------------------------*/
ganlikun 0:13413ea9a877 582 /** @defgroup LTDC_Private_Macros LTDC Private Macros
ganlikun 0:13413ea9a877 583 * @{
ganlikun 0:13413ea9a877 584 */
ganlikun 0:13413ea9a877 585 #define LTDC_LAYER(__HANDLE__, __LAYER__) ((LTDC_Layer_TypeDef *)((uint32_t)(((uint32_t)((__HANDLE__)->Instance)) + 0x84U + (0x80U*(__LAYER__)))))
ganlikun 0:13413ea9a877 586 #define IS_LTDC_LAYER(__LAYER__) ((__LAYER__) < MAX_LAYER)
ganlikun 0:13413ea9a877 587 #define IS_LTDC_HSPOL(__HSPOL__) (((__HSPOL__) == LTDC_HSPOLARITY_AL) || ((__HSPOL__) == LTDC_HSPOLARITY_AH))
ganlikun 0:13413ea9a877 588 #define IS_LTDC_VSPOL(__VSPOL__) (((__VSPOL__) == LTDC_VSPOLARITY_AL) || ((__VSPOL__) == LTDC_VSPOLARITY_AH))
ganlikun 0:13413ea9a877 589 #define IS_LTDC_DEPOL(__DEPOL__) (((__DEPOL__) == LTDC_DEPOLARITY_AL) || ((__DEPOL__) == LTDC_DEPOLARITY_AH))
ganlikun 0:13413ea9a877 590 #define IS_LTDC_PCPOL(__PCPOL__) (((__PCPOL__) == LTDC_PCPOLARITY_IPC) || ((__PCPOL__) == LTDC_PCPOLARITY_IIPC))
ganlikun 0:13413ea9a877 591 #define IS_LTDC_HSYNC(__HSYNC__) ((__HSYNC__) <= LTDC_HORIZONTALSYNC)
ganlikun 0:13413ea9a877 592 #define IS_LTDC_VSYNC(__VSYNC__) ((__VSYNC__) <= LTDC_VERTICALSYNC)
ganlikun 0:13413ea9a877 593 #define IS_LTDC_AHBP(__AHBP__) ((__AHBP__) <= LTDC_HORIZONTALSYNC)
ganlikun 0:13413ea9a877 594 #define IS_LTDC_AVBP(__AVBP__) ((__AVBP__) <= LTDC_VERTICALSYNC)
ganlikun 0:13413ea9a877 595 #define IS_LTDC_AAW(__AAW__) ((__AAW__) <= LTDC_HORIZONTALSYNC)
ganlikun 0:13413ea9a877 596 #define IS_LTDC_AAH(__AAH__) ((__AAH__) <= LTDC_VERTICALSYNC)
ganlikun 0:13413ea9a877 597 #define IS_LTDC_TOTALW(__TOTALW__) ((__TOTALW__) <= LTDC_HORIZONTALSYNC)
ganlikun 0:13413ea9a877 598 #define IS_LTDC_TOTALH(__TOTALH__) ((__TOTALH__) <= LTDC_VERTICALSYNC)
ganlikun 0:13413ea9a877 599 #define IS_LTDC_BLUEVALUE(__BBLUE__) ((__BBLUE__) <= LTDC_COLOR)
ganlikun 0:13413ea9a877 600 #define IS_LTDC_GREENVALUE(__BGREEN__) ((__BGREEN__) <= LTDC_COLOR)
ganlikun 0:13413ea9a877 601 #define IS_LTDC_REDVALUE(__BRED__) ((__BRED__) <= LTDC_COLOR)
ganlikun 0:13413ea9a877 602 #define IS_LTDC_BLENDING_FACTOR1(__BLENDING_FACTOR1__) (((__BLENDING_FACTOR1__) == LTDC_BLENDING_FACTOR1_CA) || \
ganlikun 0:13413ea9a877 603 ((__BLENDING_FACTOR1__) == LTDC_BLENDING_FACTOR1_PAxCA))
ganlikun 0:13413ea9a877 604 #define IS_LTDC_BLENDING_FACTOR2(__BLENDING_FACTOR1__) (((__BLENDING_FACTOR1__) == LTDC_BLENDING_FACTOR2_CA) || \
ganlikun 0:13413ea9a877 605 ((__BLENDING_FACTOR1__) == LTDC_BLENDING_FACTOR2_PAxCA))
ganlikun 0:13413ea9a877 606 #define IS_LTDC_PIXEL_FORMAT(__PIXEL_FORMAT__) (((__PIXEL_FORMAT__) == LTDC_PIXEL_FORMAT_ARGB8888) || ((__PIXEL_FORMAT__) == LTDC_PIXEL_FORMAT_RGB888) || \
ganlikun 0:13413ea9a877 607 ((__PIXEL_FORMAT__) == LTDC_PIXEL_FORMAT_RGB565) || ((__PIXEL_FORMAT__) == LTDC_PIXEL_FORMAT_ARGB1555) || \
ganlikun 0:13413ea9a877 608 ((__PIXEL_FORMAT__) == LTDC_PIXEL_FORMAT_ARGB4444) || ((__PIXEL_FORMAT__) == LTDC_PIXEL_FORMAT_L8) || \
ganlikun 0:13413ea9a877 609 ((__PIXEL_FORMAT__) == LTDC_PIXEL_FORMAT_AL44) || ((__PIXEL_FORMAT__) == LTDC_PIXEL_FORMAT_AL88))
ganlikun 0:13413ea9a877 610 #define IS_LTDC_ALPHA(__ALPHA__) ((__ALPHA__) <= LTDC_ALPHA)
ganlikun 0:13413ea9a877 611 #define IS_LTDC_HCONFIGST(__HCONFIGST__) ((__HCONFIGST__) <= LTDC_STARTPOSITION)
ganlikun 0:13413ea9a877 612 #define IS_LTDC_HCONFIGSP(__HCONFIGSP__) ((__HCONFIGSP__) <= LTDC_STOPPOSITION)
ganlikun 0:13413ea9a877 613 #define IS_LTDC_VCONFIGST(__VCONFIGST__) ((__VCONFIGST__) <= LTDC_STARTPOSITION)
ganlikun 0:13413ea9a877 614 #define IS_LTDC_VCONFIGSP(__VCONFIGSP__) ((__VCONFIGSP__) <= LTDC_STOPPOSITION)
ganlikun 0:13413ea9a877 615 #define IS_LTDC_CFBP(__CFBP__) ((__CFBP__) <= LTDC_COLOR_FRAME_BUFFER)
ganlikun 0:13413ea9a877 616 #define IS_LTDC_CFBLL(__CFBLL__) ((__CFBLL__) <= LTDC_COLOR_FRAME_BUFFER)
ganlikun 0:13413ea9a877 617 #define IS_LTDC_CFBLNBR(__CFBLNBR__) ((__CFBLNBR__) <= LTDC_LINE_NUMBER)
ganlikun 0:13413ea9a877 618 #define IS_LTDC_LIPOS(__LIPOS__) ((__LIPOS__) <= 0x7FFU)
ganlikun 0:13413ea9a877 619 #define IS_LTDC_RELOAD(__RELOADTYPE__) (((__RELOADTYPE__) == LTDC_RELOAD_IMMEDIATE) || ((__RELOADTYPE__) == LTDC_SRCR_VBR))
ganlikun 0:13413ea9a877 620 /**
ganlikun 0:13413ea9a877 621 * @}
ganlikun 0:13413ea9a877 622 */
ganlikun 0:13413ea9a877 623
ganlikun 0:13413ea9a877 624 /* Private functions ---------------------------------------------------------*/
ganlikun 0:13413ea9a877 625 /** @defgroup LTDC_Private_Functions LTDC Private Functions
ganlikun 0:13413ea9a877 626 * @{
ganlikun 0:13413ea9a877 627 */
ganlikun 0:13413ea9a877 628
ganlikun 0:13413ea9a877 629 /**
ganlikun 0:13413ea9a877 630 * @}
ganlikun 0:13413ea9a877 631 */
ganlikun 0:13413ea9a877 632
ganlikun 0:13413ea9a877 633 /**
ganlikun 0:13413ea9a877 634 * @}
ganlikun 0:13413ea9a877 635 */
ganlikun 0:13413ea9a877 636
ganlikun 0:13413ea9a877 637 /**
ganlikun 0:13413ea9a877 638 * @}
ganlikun 0:13413ea9a877 639 */
ganlikun 0:13413ea9a877 640
ganlikun 0:13413ea9a877 641 #endif /* STM32F429xx || STM32F439xx || STM32F469xx || STM32F479xx */
ganlikun 0:13413ea9a877 642
ganlikun 0:13413ea9a877 643 #ifdef __cplusplus
ganlikun 0:13413ea9a877 644 }
ganlikun 0:13413ea9a877 645 #endif
ganlikun 0:13413ea9a877 646
ganlikun 0:13413ea9a877 647 #endif /* __STM32F4xx_HAL_LTDC_H */
ganlikun 0:13413ea9a877 648
ganlikun 0:13413ea9a877 649 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
ganlikun 0:13413ea9a877 650