Fork of the official mbed C/C SDK provides the software platform and libraries to build your applications for RenBED.

Dependents:   1-RenBuggyTimed RenBED_RGB RenBED_RGB_PWM RenBED_RGB

Fork of mbed by mbed official

Committer:
elijahorr
Date:
Thu Apr 14 07:28:54 2016 +0000
Revision:
121:672067c3ada4
Parent:
110:165afa46840b
.

Who changed what in which revision?

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