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