meh

Fork of mbed by mbed official

Committer:
ricardobtez
Date:
Tue Apr 05 23:51:21 2016 +0000
Revision:
118:16969dd821af
Parent:
92:4fc01daae5a5
Child:
99:dbbf35b96557
dgdgr

Who changed what in which revision?

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