mbed official / mbed

Dependents:   hello SerialTestv11 SerialTestv12 Sierpinski ... more

Committer:
Kojto
Date:
Thu Jul 07 14:34:11 2016 +0100
Revision:
122:f9eeca106725
Parent:
110:165afa46840b
Release 122 of the mbed library

Changes:
- new targets - Nucleo L432KC, Beetle, Nucleo F446ZE, Nucleo L011K4
- Thread safety addition - mbed API should contain a statement about thread safety
- critical section API addition
- CAS API (core_util_atomic_incr/decr)
- DEVICE_ are generated from targets.json file, device.h deprecated
- Callback replaces FunctionPointer to provide std like interface
- mbed HAL API docs improvements
- toolchain - prexif attributes with MBED_
- add new attributes - packed, weak, forcedinline, align
- target.json - contains targets definitions
- ST - L1XX - Cube update to 1.5
- SPI clock selection fix (clock from APB domain)
- F7 - Cube update v1.4.0
- L0 - baudrate init fix
- L1 - Cube update v1.5
- F3 - baudrate init fix, 3 targets CAN support
- F4 - Cube update v1.12.0, 3 targets CAN support
- L4XX - Cube update v1.5.1
- F0 - update Cube to v1.5.0
- L4 - 2 targets (L476RG/VG) CAN support
- NXP - pwm clock fix for KSDK2 MCU
- LPC2368 - remove ARM toolchain support - due to regression
- KSDK2 - fix SPI , I2C address and repeat start
- Silabs - some fixes backported from mbed 3
- Renesas - RZ_A1H - SystemCoreClockUpdate addition

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Kojto 110:165afa46840b 1 /**
Kojto 110:165afa46840b 2 ******************************************************************************
Kojto 110:165afa46840b 3 * @file stm32f4xx_hal_dma2d.h
Kojto 110:165afa46840b 4 * @author MCD Application Team
Kojto 122:f9eeca106725 5 * @version V1.5.0
Kojto 122:f9eeca106725 6 * @date 06-May-2016
Kojto 110:165afa46840b 7 * @brief Header file of DMA2D HAL module.
Kojto 110:165afa46840b 8 ******************************************************************************
Kojto 110:165afa46840b 9 * @attention
Kojto 110:165afa46840b 10 *
Kojto 122:f9eeca106725 11 * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
Kojto 110:165afa46840b 12 *
Kojto 110:165afa46840b 13 * Redistribution and use in source and binary forms, with or without modification,
Kojto 110:165afa46840b 14 * are permitted provided that the following conditions are met:
Kojto 110:165afa46840b 15 * 1. Redistributions of source code must retain the above copyright notice,
Kojto 110:165afa46840b 16 * this list of conditions and the following disclaimer.
Kojto 110:165afa46840b 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
Kojto 110:165afa46840b 18 * this list of conditions and the following disclaimer in the documentation
Kojto 110:165afa46840b 19 * and/or other materials provided with the distribution.
Kojto 110:165afa46840b 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
Kojto 110:165afa46840b 21 * may be used to endorse or promote products derived from this software
Kojto 110:165afa46840b 22 * without specific prior written permission.
Kojto 110:165afa46840b 23 *
Kojto 110:165afa46840b 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
Kojto 110:165afa46840b 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Kojto 110:165afa46840b 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Kojto 110:165afa46840b 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
Kojto 110:165afa46840b 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Kojto 110:165afa46840b 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
Kojto 110:165afa46840b 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
Kojto 110:165afa46840b 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
Kojto 110:165afa46840b 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Kojto 110:165afa46840b 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Kojto 110:165afa46840b 34 *
Kojto 110:165afa46840b 35 ******************************************************************************
Kojto 122:f9eeca106725 36 */
Kojto 110:165afa46840b 37
Kojto 110:165afa46840b 38 /* Define to prevent recursive inclusion -------------------------------------*/
Kojto 110:165afa46840b 39 #ifndef __STM32F4xx_HAL_DMA2D_H
Kojto 110:165afa46840b 40 #define __STM32F4xx_HAL_DMA2D_H
Kojto 110:165afa46840b 41
Kojto 110:165afa46840b 42 #ifdef __cplusplus
Kojto 110:165afa46840b 43 extern "C" {
Kojto 110:165afa46840b 44 #endif
Kojto 110:165afa46840b 45
Kojto 110:165afa46840b 46 #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) ||\
Kojto 110:165afa46840b 47 defined(STM32F469xx) || defined(STM32F479xx)
Kojto 110:165afa46840b 48 /* Includes ------------------------------------------------------------------*/
Kojto 110:165afa46840b 49 #include "stm32f4xx_hal_def.h"
Kojto 110:165afa46840b 50
Kojto 110:165afa46840b 51 /** @addtogroup STM32F4xx_HAL_Driver
Kojto 110:165afa46840b 52 * @{
Kojto 110:165afa46840b 53 */
Kojto 110:165afa46840b 54
Kojto 122:f9eeca106725 55 /** @addtogroup DMA2D DMA2D
Kojto 110:165afa46840b 56 * @brief DMA2D HAL module driver
Kojto 110:165afa46840b 57 * @{
Kojto 110:165afa46840b 58 */
Kojto 110:165afa46840b 59
Kojto 110:165afa46840b 60 /* Exported types ------------------------------------------------------------*/
Kojto 110:165afa46840b 61 /** @defgroup DMA2D_Exported_Types DMA2D Exported Types
Kojto 110:165afa46840b 62 * @{
Kojto 110:165afa46840b 63 */
Kojto 122:f9eeca106725 64 #define MAX_DMA2D_LAYER 2U
Kojto 110:165afa46840b 65
Kojto 110:165afa46840b 66 /**
Kojto 110:165afa46840b 67 * @brief DMA2D color Structure definition
Kojto 110:165afa46840b 68 */
Kojto 110:165afa46840b 69 typedef struct
Kojto 110:165afa46840b 70 {
Kojto 110:165afa46840b 71 uint32_t Blue; /*!< Configures the blue value.
Kojto 110:165afa46840b 72 This parameter must be a number between Min_Data = 0x00 and Max_Data = 0xFF. */
Kojto 110:165afa46840b 73
Kojto 110:165afa46840b 74 uint32_t Green; /*!< Configures the green value.
Kojto 110:165afa46840b 75 This parameter must be a number between Min_Data = 0x00 and Max_Data = 0xFF. */
Kojto 110:165afa46840b 76
Kojto 110:165afa46840b 77 uint32_t Red; /*!< Configures the red value.
Kojto 110:165afa46840b 78 This parameter must be a number between Min_Data = 0x00 and Max_Data = 0xFF. */
Kojto 110:165afa46840b 79 } DMA2D_ColorTypeDef;
Kojto 110:165afa46840b 80
Kojto 110:165afa46840b 81 /**
Kojto 110:165afa46840b 82 * @brief DMA2D CLUT Structure definition
Kojto 110:165afa46840b 83 */
Kojto 110:165afa46840b 84 typedef struct
Kojto 110:165afa46840b 85 {
Kojto 110:165afa46840b 86 uint32_t *pCLUT; /*!< Configures the DMA2D CLUT memory address.*/
Kojto 110:165afa46840b 87
Kojto 122:f9eeca106725 88 uint32_t CLUTColorMode; /*!< Configures the DMA2D CLUT color mode.
Kojto 122:f9eeca106725 89 This parameter can be one value of @ref DMA2D_CLUT_CM. */
Kojto 110:165afa46840b 90
Kojto 122:f9eeca106725 91 uint32_t Size; /*!< Configures the DMA2D CLUT size.
Kojto 110:165afa46840b 92 This parameter must be a number between Min_Data = 0x00 and Max_Data = 0xFF.*/
Kojto 110:165afa46840b 93 } DMA2D_CLUTCfgTypeDef;
Kojto 110:165afa46840b 94
Kojto 110:165afa46840b 95 /**
Kojto 110:165afa46840b 96 * @brief DMA2D Init structure definition
Kojto 110:165afa46840b 97 */
Kojto 110:165afa46840b 98 typedef struct
Kojto 110:165afa46840b 99 {
Kojto 122:f9eeca106725 100 uint32_t Mode; /*!< Configures the DMA2D transfer mode.
Kojto 122:f9eeca106725 101 This parameter can be one value of @ref DMA2D_Mode. */
Kojto 110:165afa46840b 102
Kojto 122:f9eeca106725 103 uint32_t ColorMode; /*!< Configures the color format of the output image.
Kojto 122:f9eeca106725 104 This parameter can be one value of @ref DMA2D_Output_Color_Mode. */
Kojto 110:165afa46840b 105
Kojto 122:f9eeca106725 106 uint32_t OutputOffset; /*!< Specifies the Offset value.
Kojto 122:f9eeca106725 107 This parameter must be a number between Min_Data = 0x0000 and Max_Data = 0x3FFF. */
Kojto 122:f9eeca106725 108
Kojto 110:165afa46840b 109 } DMA2D_InitTypeDef;
Kojto 110:165afa46840b 110
Kojto 110:165afa46840b 111 /**
Kojto 110:165afa46840b 112 * @brief DMA2D Layer structure definition
Kojto 110:165afa46840b 113 */
Kojto 110:165afa46840b 114 typedef struct
Kojto 110:165afa46840b 115 {
Kojto 122:f9eeca106725 116 uint32_t InputOffset; /*!< Configures the DMA2D foreground or background offset.
Kojto 110:165afa46840b 117 This parameter must be a number between Min_Data = 0x0000 and Max_Data = 0x3FFF. */
Kojto 110:165afa46840b 118
Kojto 122:f9eeca106725 119 uint32_t InputColorMode; /*!< Configures the DMA2D foreground or background color mode.
Kojto 122:f9eeca106725 120 This parameter can be one value of @ref DMA2D_Input_Color_Mode. */
Kojto 110:165afa46840b 121
Kojto 122:f9eeca106725 122 uint32_t AlphaMode; /*!< Configures the DMA2D foreground or background alpha mode.
Kojto 122:f9eeca106725 123 This parameter can be one value of @ref DMA2D_Alpha_Mode. */
Kojto 110:165afa46840b 124
Kojto 122:f9eeca106725 125 uint32_t InputAlpha; /*!< Specifies the DMA2D foreground or background alpha value and color value in case of A8 or A4 color mode.
Kojto 122:f9eeca106725 126 This parameter must be a number between Min_Data = 0x00 and Max_Data = 0xFF except for the color modes detailed below.
Kojto 122:f9eeca106725 127 @note In case of A8 or A4 color mode (ARGB), this parameter must be a number between
Kojto 122:f9eeca106725 128 Min_Data = 0x00000000 and Max_Data = 0xFFFFFFFF where
Kojto 122:f9eeca106725 129 - InputAlpha[24:31] is the alpha value ALPHA[0:7]
Kojto 122:f9eeca106725 130 - InputAlpha[16:23] is the red value RED[0:7]
Kojto 122:f9eeca106725 131 - InputAlpha[8:15] is the green value GREEN[0:7]
Kojto 122:f9eeca106725 132 - InputAlpha[0:7] is the blue value BLUE[0:7]. */
Kojto 122:f9eeca106725 133
Kojto 110:165afa46840b 134 } DMA2D_LayerCfgTypeDef;
Kojto 110:165afa46840b 135
Kojto 110:165afa46840b 136 /**
Kojto 110:165afa46840b 137 * @brief HAL DMA2D State structures definition
Kojto 110:165afa46840b 138 */
Kojto 110:165afa46840b 139 typedef enum
Kojto 110:165afa46840b 140 {
Kojto 122:f9eeca106725 141 HAL_DMA2D_STATE_RESET = 0x00U, /*!< DMA2D not yet initialized or disabled */
Kojto 122:f9eeca106725 142 HAL_DMA2D_STATE_READY = 0x01U, /*!< Peripheral Initialized and ready for use */
Kojto 122:f9eeca106725 143 HAL_DMA2D_STATE_BUSY = 0x02U, /*!< An internal process is ongoing */
Kojto 122:f9eeca106725 144 HAL_DMA2D_STATE_TIMEOUT = 0x03U, /*!< Timeout state */
Kojto 122:f9eeca106725 145 HAL_DMA2D_STATE_ERROR = 0x04U, /*!< DMA2D state error */
Kojto 122:f9eeca106725 146 HAL_DMA2D_STATE_SUSPEND = 0x05U /*!< DMA2D process is suspended */
Kojto 110:165afa46840b 147 }HAL_DMA2D_StateTypeDef;
Kojto 110:165afa46840b 148
Kojto 122:f9eeca106725 149 /**
Kojto 110:165afa46840b 150 * @brief DMA2D handle Structure definition
Kojto 110:165afa46840b 151 */
Kojto 110:165afa46840b 152 typedef struct __DMA2D_HandleTypeDef
Kojto 110:165afa46840b 153 {
Kojto 122:f9eeca106725 154 DMA2D_TypeDef *Instance; /*!< DMA2D register base address. */
Kojto 110:165afa46840b 155
Kojto 122:f9eeca106725 156 DMA2D_InitTypeDef Init; /*!< DMA2D communication parameters. */
Kojto 110:165afa46840b 157
Kojto 122:f9eeca106725 158 void (* XferCpltCallback)(struct __DMA2D_HandleTypeDef * hdma2d); /*!< DMA2D transfer complete callback. */
Kojto 110:165afa46840b 159
Kojto 122:f9eeca106725 160 void (* XferErrorCallback)(struct __DMA2D_HandleTypeDef * hdma2d); /*!< DMA2D transfer error callback. */
Kojto 110:165afa46840b 161
Kojto 122:f9eeca106725 162 DMA2D_LayerCfgTypeDef LayerCfg[MAX_DMA2D_LAYER]; /*!< DMA2D Layers parameters */
Kojto 110:165afa46840b 163
Kojto 122:f9eeca106725 164 HAL_LockTypeDef Lock; /*!< DMA2D lock. */
Kojto 110:165afa46840b 165
Kojto 122:f9eeca106725 166 __IO HAL_DMA2D_StateTypeDef State; /*!< DMA2D transfer state. */
Kojto 110:165afa46840b 167
Kojto 122:f9eeca106725 168 __IO uint32_t ErrorCode; /*!< DMA2D error code. */
Kojto 110:165afa46840b 169 } DMA2D_HandleTypeDef;
Kojto 110:165afa46840b 170 /**
Kojto 110:165afa46840b 171 * @}
Kojto 110:165afa46840b 172 */
Kojto 110:165afa46840b 173
Kojto 110:165afa46840b 174 /* Exported constants --------------------------------------------------------*/
Kojto 110:165afa46840b 175 /** @defgroup DMA2D_Exported_Constants DMA2D Exported Constants
Kojto 110:165afa46840b 176 * @{
Kojto 110:165afa46840b 177 */
Kojto 110:165afa46840b 178
Kojto 110:165afa46840b 179 /** @defgroup DMA2D_Error_Code DMA2D Error Code
Kojto 110:165afa46840b 180 * @{
Kojto 110:165afa46840b 181 */
Kojto 122:f9eeca106725 182 #define HAL_DMA2D_ERROR_NONE ((uint32_t)0x00000000U) /*!< No error */
Kojto 122:f9eeca106725 183 #define HAL_DMA2D_ERROR_TE ((uint32_t)0x00000001U) /*!< Transfer error */
Kojto 122:f9eeca106725 184 #define HAL_DMA2D_ERROR_CE ((uint32_t)0x00000002U) /*!< Configuration error */
Kojto 122:f9eeca106725 185 #define HAL_DMA2D_ERROR_CAE ((uint32_t)0x00000004U) /*!< CLUT access error */
Kojto 122:f9eeca106725 186 #define HAL_DMA2D_ERROR_TIMEOUT ((uint32_t)0x00000020U) /*!< Timeout error */
Kojto 110:165afa46840b 187 /**
Kojto 110:165afa46840b 188 * @}
Kojto 110:165afa46840b 189 */
Kojto 110:165afa46840b 190
Kojto 110:165afa46840b 191 /** @defgroup DMA2D_Mode DMA2D Mode
Kojto 110:165afa46840b 192 * @{
Kojto 110:165afa46840b 193 */
Kojto 122:f9eeca106725 194 #define DMA2D_M2M ((uint32_t)0x00000000U) /*!< DMA2D memory to memory transfer mode */
Kojto 122:f9eeca106725 195 #define DMA2D_M2M_PFC DMA2D_CR_MODE_0 /*!< DMA2D memory to memory with pixel format conversion transfer mode */
Kojto 122:f9eeca106725 196 #define DMA2D_M2M_BLEND DMA2D_CR_MODE_1 /*!< DMA2D memory to memory with blending transfer mode */
Kojto 122:f9eeca106725 197 #define DMA2D_R2M DMA2D_CR_MODE /*!< DMA2D register to memory transfer mode */
Kojto 110:165afa46840b 198 /**
Kojto 110:165afa46840b 199 * @}
Kojto 110:165afa46840b 200 */
Kojto 110:165afa46840b 201
Kojto 122:f9eeca106725 202 /** @defgroup DMA2D_Output_Color_Mode DMA2D Output Color Mode
Kojto 110:165afa46840b 203 * @{
Kojto 110:165afa46840b 204 */
Kojto 122:f9eeca106725 205 #define DMA2D_OUTPUT_ARGB8888 ((uint32_t)0x00000000U) /*!< ARGB8888 DMA2D color mode */
Kojto 122:f9eeca106725 206 #define DMA2D_OUTPUT_RGB888 DMA2D_OPFCCR_CM_0 /*!< RGB888 DMA2D color mode */
Kojto 122:f9eeca106725 207 #define DMA2D_OUTPUT_RGB565 DMA2D_OPFCCR_CM_1 /*!< RGB565 DMA2D color mode */
Kojto 122:f9eeca106725 208 #define DMA2D_OUTPUT_ARGB1555 (DMA2D_OPFCCR_CM_0|DMA2D_OPFCCR_CM_1) /*!< ARGB1555 DMA2D color mode */
Kojto 122:f9eeca106725 209 #define DMA2D_OUTPUT_ARGB4444 DMA2D_OPFCCR_CM_2 /*!< ARGB4444 DMA2D color mode */
Kojto 110:165afa46840b 210 /**
Kojto 110:165afa46840b 211 * @}
Kojto 110:165afa46840b 212 */
Kojto 110:165afa46840b 213
Kojto 110:165afa46840b 214 /** @defgroup DMA2D_Input_Color_Mode DMA2D Input Color Mode
Kojto 110:165afa46840b 215 * @{
Kojto 110:165afa46840b 216 */
Kojto 122:f9eeca106725 217 #define DMA2D_INPUT_ARGB8888 ((uint32_t)0x00000000U) /*!< ARGB8888 color mode */
Kojto 122:f9eeca106725 218 #define DMA2D_INPUT_RGB888 ((uint32_t)0x00000001U) /*!< RGB888 color mode */
Kojto 122:f9eeca106725 219 #define DMA2D_INPUT_RGB565 ((uint32_t)0x00000002U) /*!< RGB565 color mode */
Kojto 122:f9eeca106725 220 #define DMA2D_INPUT_ARGB1555 ((uint32_t)0x00000003U) /*!< ARGB1555 color mode */
Kojto 122:f9eeca106725 221 #define DMA2D_INPUT_ARGB4444 ((uint32_t)0x00000004U) /*!< ARGB4444 color mode */
Kojto 122:f9eeca106725 222 #define DMA2D_INPUT_L8 ((uint32_t)0x00000005U) /*!< L8 color mode */
Kojto 122:f9eeca106725 223 #define DMA2D_INPUT_AL44 ((uint32_t)0x00000006U) /*!< AL44 color mode */
Kojto 122:f9eeca106725 224 #define DMA2D_INPUT_AL88 ((uint32_t)0x00000007U) /*!< AL88 color mode */
Kojto 122:f9eeca106725 225 #define DMA2D_INPUT_L4 ((uint32_t)0x00000008U) /*!< L4 color mode */
Kojto 122:f9eeca106725 226 #define DMA2D_INPUT_A8 ((uint32_t)0x00000009U) /*!< A8 color mode */
Kojto 122:f9eeca106725 227 #define DMA2D_INPUT_A4 ((uint32_t)0x0000000AU) /*!< A4 color mode */
Kojto 110:165afa46840b 228 /**
Kojto 110:165afa46840b 229 * @}
Kojto 110:165afa46840b 230 */
Kojto 110:165afa46840b 231
Kojto 122:f9eeca106725 232 /** @defgroup DMA2D_Alpha_Mode DMA2D Alpha Mode
Kojto 110:165afa46840b 233 * @{
Kojto 110:165afa46840b 234 */
Kojto 122:f9eeca106725 235 #define DMA2D_NO_MODIF_ALPHA ((uint32_t)0x00000000U) /*!< No modification of the alpha channel value */
Kojto 122:f9eeca106725 236 #define DMA2D_REPLACE_ALPHA ((uint32_t)0x00000001U) /*!< Replace original alpha channel value by programmed alpha value */
Kojto 122:f9eeca106725 237 #define DMA2D_COMBINE_ALPHA ((uint32_t)0x00000002U) /*!< Replace original alpha channel value by programmed alpha value
Kojto 122:f9eeca106725 238 with original alpha channel value */
Kojto 110:165afa46840b 239 /**
Kojto 110:165afa46840b 240 * @}
Kojto 122:f9eeca106725 241 */
Kojto 110:165afa46840b 242
Kojto 122:f9eeca106725 243 /** @defgroup DMA2D_CLUT_CM DMA2D CLUT Color Mode
Kojto 110:165afa46840b 244 * @{
Kojto 110:165afa46840b 245 */
Kojto 122:f9eeca106725 246 #define DMA2D_CCM_ARGB8888 ((uint32_t)0x00000000U) /*!< ARGB8888 DMA2D CLUT color mode */
Kojto 122:f9eeca106725 247 #define DMA2D_CCM_RGB888 ((uint32_t)0x00000001U) /*!< RGB888 DMA2D CLUT color mode */
Kojto 110:165afa46840b 248 /**
Kojto 110:165afa46840b 249 * @}
Kojto 110:165afa46840b 250 */
Kojto 110:165afa46840b 251
Kojto 122:f9eeca106725 252 /** @defgroup DMA2D_Interrupts DMA2D Interrupts
Kojto 110:165afa46840b 253 * @{
Kojto 110:165afa46840b 254 */
Kojto 122:f9eeca106725 255 #define DMA2D_IT_CE DMA2D_CR_CEIE /*!< Configuration Error Interrupt */
Kojto 122:f9eeca106725 256 #define DMA2D_IT_CTC DMA2D_CR_CTCIE /*!< CLUT Transfer Complete Interrupt */
Kojto 122:f9eeca106725 257 #define DMA2D_IT_CAE DMA2D_CR_CAEIE /*!< CLUT Access Error Interrupt */
Kojto 122:f9eeca106725 258 #define DMA2D_IT_TW DMA2D_CR_TWIE /*!< Transfer Watermark Interrupt */
Kojto 122:f9eeca106725 259 #define DMA2D_IT_TC DMA2D_CR_TCIE /*!< Transfer Complete Interrupt */
Kojto 122:f9eeca106725 260 #define DMA2D_IT_TE DMA2D_CR_TEIE /*!< Transfer Error Interrupt */
Kojto 110:165afa46840b 261 /**
Kojto 110:165afa46840b 262 * @}
Kojto 110:165afa46840b 263 */
Kojto 110:165afa46840b 264
Kojto 122:f9eeca106725 265 /** @defgroup DMA2D_Flags DMA2D Flags
Kojto 110:165afa46840b 266 * @{
Kojto 110:165afa46840b 267 */
Kojto 122:f9eeca106725 268 #define DMA2D_FLAG_CE DMA2D_ISR_CEIF /*!< Configuration Error Interrupt Flag */
Kojto 122:f9eeca106725 269 #define DMA2D_FLAG_CTC DMA2D_ISR_CTCIF /*!< CLUT Transfer Complete Interrupt Flag */
Kojto 122:f9eeca106725 270 #define DMA2D_FLAG_CAE DMA2D_ISR_CAEIF /*!< CLUT Access Error Interrupt Flag */
Kojto 122:f9eeca106725 271 #define DMA2D_FLAG_TW DMA2D_ISR_TWIF /*!< Transfer Watermark Interrupt Flag */
Kojto 122:f9eeca106725 272 #define DMA2D_FLAG_TC DMA2D_ISR_TCIF /*!< Transfer Complete Interrupt Flag */
Kojto 122:f9eeca106725 273 #define DMA2D_FLAG_TE DMA2D_ISR_TEIF /*!< Transfer Error Interrupt Flag */
Kojto 122:f9eeca106725 274 /**
Kojto 122:f9eeca106725 275 * @}
Kojto 122:f9eeca106725 276 */
Kojto 122:f9eeca106725 277
Kojto 122:f9eeca106725 278 /** @defgroup DMA2D_Aliases DMA2D API Aliases
Kojto 122:f9eeca106725 279 * @{
Kojto 122:f9eeca106725 280 */
Kojto 122:f9eeca106725 281 #define HAL_DMA2D_DisableCLUT HAL_DMA2D_CLUTLoading_Abort /*!< Aliased to HAL_DMA2D_CLUTLoading_Abort for compatibility with legacy code */
Kojto 110:165afa46840b 282 /**
Kojto 110:165afa46840b 283 * @}
Kojto 110:165afa46840b 284 */
Kojto 110:165afa46840b 285
Kojto 110:165afa46840b 286 /**
Kojto 110:165afa46840b 287 * @}
Kojto 110:165afa46840b 288 */
Kojto 122:f9eeca106725 289 /* Exported macros ------------------------------------------------------------*/
Kojto 110:165afa46840b 290 /** @defgroup DMA2D_Exported_Macros DMA2D Exported Macros
Kojto 110:165afa46840b 291 * @{
Kojto 110:165afa46840b 292 */
Kojto 110:165afa46840b 293
Kojto 110:165afa46840b 294 /** @brief Reset DMA2D handle state
Kojto 110:165afa46840b 295 * @param __HANDLE__: specifies the DMA2D handle.
Kojto 110:165afa46840b 296 * @retval None
Kojto 110:165afa46840b 297 */
Kojto 110:165afa46840b 298 #define __HAL_DMA2D_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_DMA2D_STATE_RESET)
Kojto 110:165afa46840b 299
Kojto 110:165afa46840b 300 /**
Kojto 110:165afa46840b 301 * @brief Enable the DMA2D.
Kojto 110:165afa46840b 302 * @param __HANDLE__: DMA2D handle
Kojto 110:165afa46840b 303 * @retval None.
Kojto 110:165afa46840b 304 */
Kojto 110:165afa46840b 305 #define __HAL_DMA2D_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= DMA2D_CR_START)
Kojto 110:165afa46840b 306
Kojto 110:165afa46840b 307 /* Interrupt & Flag management */
Kojto 110:165afa46840b 308 /**
Kojto 110:165afa46840b 309 * @brief Get the DMA2D pending flags.
Kojto 110:165afa46840b 310 * @param __HANDLE__: DMA2D handle
Kojto 122:f9eeca106725 311 * @param __FLAG__: flag to check.
Kojto 110:165afa46840b 312 * This parameter can be any combination of the following values:
Kojto 110:165afa46840b 313 * @arg DMA2D_FLAG_CE: Configuration error flag
Kojto 122:f9eeca106725 314 * @arg DMA2D_FLAG_CTC: CLUT transfer complete flag
Kojto 122:f9eeca106725 315 * @arg DMA2D_FLAG_CAE: CLUT access error flag
Kojto 110:165afa46840b 316 * @arg DMA2D_FLAG_TW: Transfer Watermark flag
Kojto 110:165afa46840b 317 * @arg DMA2D_FLAG_TC: Transfer complete flag
Kojto 110:165afa46840b 318 * @arg DMA2D_FLAG_TE: Transfer error flag
Kojto 110:165afa46840b 319 * @retval The state of FLAG.
Kojto 110:165afa46840b 320 */
Kojto 110:165afa46840b 321 #define __HAL_DMA2D_GET_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR & (__FLAG__))
Kojto 110:165afa46840b 322
Kojto 110:165afa46840b 323 /**
Kojto 122:f9eeca106725 324 * @brief Clear the DMA2D pending flags.
Kojto 110:165afa46840b 325 * @param __HANDLE__: DMA2D handle
Kojto 110:165afa46840b 326 * @param __FLAG__: specifies the flag to clear.
Kojto 110:165afa46840b 327 * This parameter can be any combination of the following values:
Kojto 110:165afa46840b 328 * @arg DMA2D_FLAG_CE: Configuration error flag
Kojto 122:f9eeca106725 329 * @arg DMA2D_FLAG_CTC: CLUT transfer complete flag
Kojto 122:f9eeca106725 330 * @arg DMA2D_FLAG_CAE: CLUT access error flag
Kojto 110:165afa46840b 331 * @arg DMA2D_FLAG_TW: Transfer Watermark flag
Kojto 110:165afa46840b 332 * @arg DMA2D_FLAG_TC: Transfer complete flag
Kojto 122:f9eeca106725 333 * @arg DMA2D_FLAG_TE: Transfer error flag
Kojto 110:165afa46840b 334 * @retval None
Kojto 110:165afa46840b 335 */
Kojto 110:165afa46840b 336 #define __HAL_DMA2D_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->IFCR = (__FLAG__))
Kojto 110:165afa46840b 337
Kojto 110:165afa46840b 338 /**
Kojto 122:f9eeca106725 339 * @brief Enable the specified DMA2D interrupts.
Kojto 110:165afa46840b 340 * @param __HANDLE__: DMA2D handle
Kojto 122:f9eeca106725 341 * @param __INTERRUPT__: specifies the DMA2D interrupt sources to be enabled.
Kojto 110:165afa46840b 342 * This parameter can be any combination of the following values:
Kojto 110:165afa46840b 343 * @arg DMA2D_IT_CE: Configuration error interrupt mask
Kojto 122:f9eeca106725 344 * @arg DMA2D_IT_CTC: CLUT transfer complete interrupt mask
Kojto 122:f9eeca106725 345 * @arg DMA2D_IT_CAE: CLUT access error interrupt mask
Kojto 110:165afa46840b 346 * @arg DMA2D_IT_TW: Transfer Watermark interrupt mask
Kojto 110:165afa46840b 347 * @arg DMA2D_IT_TC: Transfer complete interrupt mask
Kojto 110:165afa46840b 348 * @arg DMA2D_IT_TE: Transfer error interrupt mask
Kojto 110:165afa46840b 349 * @retval None
Kojto 110:165afa46840b 350 */
Kojto 110:165afa46840b 351 #define __HAL_DMA2D_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR |= (__INTERRUPT__))
Kojto 110:165afa46840b 352
Kojto 110:165afa46840b 353 /**
Kojto 122:f9eeca106725 354 * @brief Disable the specified DMA2D interrupts.
Kojto 110:165afa46840b 355 * @param __HANDLE__: DMA2D handle
Kojto 122:f9eeca106725 356 * @param __INTERRUPT__: specifies the DMA2D interrupt sources to be disabled.
Kojto 110:165afa46840b 357 * This parameter can be any combination of the following values:
Kojto 110:165afa46840b 358 * @arg DMA2D_IT_CE: Configuration error interrupt mask
Kojto 122:f9eeca106725 359 * @arg DMA2D_IT_CTC: CLUT transfer complete interrupt mask
Kojto 122:f9eeca106725 360 * @arg DMA2D_IT_CAE: CLUT access error interrupt mask
Kojto 110:165afa46840b 361 * @arg DMA2D_IT_TW: Transfer Watermark interrupt mask
Kojto 110:165afa46840b 362 * @arg DMA2D_IT_TC: Transfer complete interrupt mask
Kojto 110:165afa46840b 363 * @arg DMA2D_IT_TE: Transfer error interrupt mask
Kojto 110:165afa46840b 364 * @retval None
Kojto 110:165afa46840b 365 */
Kojto 110:165afa46840b 366 #define __HAL_DMA2D_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR &= ~(__INTERRUPT__))
Kojto 110:165afa46840b 367
Kojto 110:165afa46840b 368 /**
Kojto 122:f9eeca106725 369 * @brief Check whether the specified DMA2D interrupt source is enabled or not.
Kojto 110:165afa46840b 370 * @param __HANDLE__: DMA2D handle
Kojto 110:165afa46840b 371 * @param __INTERRUPT__: specifies the DMA2D interrupt source to check.
Kojto 110:165afa46840b 372 * This parameter can be one of the following values:
Kojto 110:165afa46840b 373 * @arg DMA2D_IT_CE: Configuration error interrupt mask
Kojto 122:f9eeca106725 374 * @arg DMA2D_IT_CTC: CLUT transfer complete interrupt mask
Kojto 122:f9eeca106725 375 * @arg DMA2D_IT_CAE: CLUT access error interrupt mask
Kojto 110:165afa46840b 376 * @arg DMA2D_IT_TW: Transfer Watermark interrupt mask
Kojto 110:165afa46840b 377 * @arg DMA2D_IT_TC: Transfer complete interrupt mask
Kojto 110:165afa46840b 378 * @arg DMA2D_IT_TE: Transfer error interrupt mask
Kojto 122:f9eeca106725 379 * @retval The state of INTERRUPT source.
Kojto 110:165afa46840b 380 */
Kojto 110:165afa46840b 381 #define __HAL_DMA2D_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR & (__INTERRUPT__))
Kojto 122:f9eeca106725 382
Kojto 110:165afa46840b 383 /**
Kojto 110:165afa46840b 384 * @}
Kojto 110:165afa46840b 385 */
Kojto 110:165afa46840b 386
Kojto 122:f9eeca106725 387 /* Exported functions --------------------------------------------------------*/
Kojto 122:f9eeca106725 388 /** @addtogroup DMA2D_Exported_Functions DMA2D Exported Functions
Kojto 122:f9eeca106725 389 * @{
Kojto 122:f9eeca106725 390 */
Kojto 122:f9eeca106725 391
Kojto 122:f9eeca106725 392 /** @addtogroup DMA2D_Exported_Functions_Group1 Initialization and de-initialization functions
Kojto 110:165afa46840b 393 * @{
Kojto 110:165afa46840b 394 */
Kojto 122:f9eeca106725 395
Kojto 110:165afa46840b 396 /* Initialization and de-initialization functions *******************************/
Kojto 122:f9eeca106725 397 HAL_StatusTypeDef HAL_DMA2D_Init(DMA2D_HandleTypeDef *hdma2d);
Kojto 110:165afa46840b 398 HAL_StatusTypeDef HAL_DMA2D_DeInit (DMA2D_HandleTypeDef *hdma2d);
Kojto 122:f9eeca106725 399 void HAL_DMA2D_MspInit(DMA2D_HandleTypeDef* hdma2d);
Kojto 122:f9eeca106725 400 void HAL_DMA2D_MspDeInit(DMA2D_HandleTypeDef* hdma2d);
Kojto 122:f9eeca106725 401
Kojto 122:f9eeca106725 402 /**
Kojto 122:f9eeca106725 403 * @}
Kojto 122:f9eeca106725 404 */
Kojto 122:f9eeca106725 405
Kojto 122:f9eeca106725 406 /** @addtogroup DMA2D_Exported_Functions_Group2 IO operation functions
Kojto 122:f9eeca106725 407 * @{
Kojto 122:f9eeca106725 408 */
Kojto 110:165afa46840b 409
Kojto 110:165afa46840b 410 /* IO operation functions *******************************************************/
Kojto 110:165afa46840b 411 HAL_StatusTypeDef HAL_DMA2D_Start(DMA2D_HandleTypeDef *hdma2d, uint32_t pdata, uint32_t DstAddress, uint32_t Width, uint32_t Height);
Kojto 110:165afa46840b 412 HAL_StatusTypeDef HAL_DMA2D_BlendingStart(DMA2D_HandleTypeDef *hdma2d, uint32_t SrcAddress1, uint32_t SrcAddress2, uint32_t DstAddress, uint32_t Width, uint32_t Height);
Kojto 110:165afa46840b 413 HAL_StatusTypeDef HAL_DMA2D_Start_IT(DMA2D_HandleTypeDef *hdma2d, uint32_t pdata, uint32_t DstAddress, uint32_t Width, uint32_t Height);
Kojto 110:165afa46840b 414 HAL_StatusTypeDef HAL_DMA2D_BlendingStart_IT(DMA2D_HandleTypeDef *hdma2d, uint32_t SrcAddress1, uint32_t SrcAddress2, uint32_t DstAddress, uint32_t Width, uint32_t Height);
Kojto 110:165afa46840b 415 HAL_StatusTypeDef HAL_DMA2D_Suspend(DMA2D_HandleTypeDef *hdma2d);
Kojto 110:165afa46840b 416 HAL_StatusTypeDef HAL_DMA2D_Resume(DMA2D_HandleTypeDef *hdma2d);
Kojto 110:165afa46840b 417 HAL_StatusTypeDef HAL_DMA2D_Abort(DMA2D_HandleTypeDef *hdma2d);
Kojto 122:f9eeca106725 418 HAL_StatusTypeDef HAL_DMA2D_EnableCLUT(DMA2D_HandleTypeDef *hdma2d, uint32_t LayerIdx);
Kojto 122:f9eeca106725 419 HAL_StatusTypeDef HAL_DMA2D_CLUTLoad(DMA2D_HandleTypeDef *hdma2d, DMA2D_CLUTCfgTypeDef CLUTCfg, uint32_t LayerIdx);
Kojto 122:f9eeca106725 420 HAL_StatusTypeDef HAL_DMA2D_CLUTLoad_IT(DMA2D_HandleTypeDef *hdma2d, DMA2D_CLUTCfgTypeDef CLUTCfg, uint32_t LayerIdx);
Kojto 122:f9eeca106725 421 HAL_StatusTypeDef HAL_DMA2D_CLUTLoading_Abort(DMA2D_HandleTypeDef *hdma2d, uint32_t LayerIdx);
Kojto 122:f9eeca106725 422 HAL_StatusTypeDef HAL_DMA2D_CLUTLoading_Suspend(DMA2D_HandleTypeDef *hdma2d, uint32_t LayerIdx);
Kojto 122:f9eeca106725 423 HAL_StatusTypeDef HAL_DMA2D_CLUTLoading_Resume(DMA2D_HandleTypeDef *hdma2d, uint32_t LayerIdx);
Kojto 110:165afa46840b 424 HAL_StatusTypeDef HAL_DMA2D_PollForTransfer(DMA2D_HandleTypeDef *hdma2d, uint32_t Timeout);
Kojto 110:165afa46840b 425 void HAL_DMA2D_IRQHandler(DMA2D_HandleTypeDef *hdma2d);
Kojto 122:f9eeca106725 426 void HAL_DMA2D_LineEventCallback(DMA2D_HandleTypeDef *hdma2d);
Kojto 122:f9eeca106725 427 void HAL_DMA2D_CLUTLoadingCpltCallback(DMA2D_HandleTypeDef *hdma2d);
Kojto 122:f9eeca106725 428
Kojto 122:f9eeca106725 429 /**
Kojto 122:f9eeca106725 430 * @}
Kojto 122:f9eeca106725 431 */
Kojto 122:f9eeca106725 432
Kojto 122:f9eeca106725 433 /** @addtogroup DMA2D_Exported_Functions_Group3 Peripheral Control functions
Kojto 122:f9eeca106725 434 * @{
Kojto 122:f9eeca106725 435 */
Kojto 110:165afa46840b 436
Kojto 110:165afa46840b 437 /* Peripheral Control functions *************************************************/
Kojto 122:f9eeca106725 438 HAL_StatusTypeDef HAL_DMA2D_ConfigLayer(DMA2D_HandleTypeDef *hdma2d, uint32_t LayerIdx);
Kojto 122:f9eeca106725 439 HAL_StatusTypeDef HAL_DMA2D_ConfigCLUT(DMA2D_HandleTypeDef *hdma2d, DMA2D_CLUTCfgTypeDef CLUTCfg, uint32_t LayerIdx);
Kojto 122:f9eeca106725 440 HAL_StatusTypeDef HAL_DMA2D_ProgramLineEvent(DMA2D_HandleTypeDef *hdma2d, uint32_t Line);
Kojto 122:f9eeca106725 441 HAL_StatusTypeDef HAL_DMA2D_EnableDeadTime(DMA2D_HandleTypeDef *hdma2d);
Kojto 122:f9eeca106725 442 HAL_StatusTypeDef HAL_DMA2D_DisableDeadTime(DMA2D_HandleTypeDef *hdma2d);
Kojto 122:f9eeca106725 443 HAL_StatusTypeDef HAL_DMA2D_ConfigDeadTime(DMA2D_HandleTypeDef *hdma2d, uint8_t DeadTime);
Kojto 122:f9eeca106725 444
Kojto 122:f9eeca106725 445 /**
Kojto 122:f9eeca106725 446 * @}
Kojto 122:f9eeca106725 447 */
Kojto 122:f9eeca106725 448
Kojto 122:f9eeca106725 449 /** @addtogroup DMA2D_Exported_Functions_Group4 Peripheral State and Error functions
Kojto 122:f9eeca106725 450 * @{
Kojto 122:f9eeca106725 451 */
Kojto 110:165afa46840b 452
Kojto 110:165afa46840b 453 /* Peripheral State functions ***************************************************/
Kojto 110:165afa46840b 454 HAL_DMA2D_StateTypeDef HAL_DMA2D_GetState(DMA2D_HandleTypeDef *hdma2d);
Kojto 110:165afa46840b 455 uint32_t HAL_DMA2D_GetError(DMA2D_HandleTypeDef *hdma2d);
Kojto 110:165afa46840b 456
Kojto 110:165afa46840b 457 /**
Kojto 110:165afa46840b 458 * @}
Kojto 110:165afa46840b 459 */
Kojto 110:165afa46840b 460
Kojto 110:165afa46840b 461 /**
Kojto 110:165afa46840b 462 * @}
Kojto 110:165afa46840b 463 */
Kojto 110:165afa46840b 464
Kojto 122:f9eeca106725 465 /* Private constants ---------------------------------------------------------*/
Kojto 122:f9eeca106725 466
Kojto 122:f9eeca106725 467 /** @addtogroup DMA2D_Private_Constants DMA2D Private Constants
Kojto 110:165afa46840b 468 * @{
Kojto 110:165afa46840b 469 */
Kojto 110:165afa46840b 470
Kojto 122:f9eeca106725 471 /** @defgroup DMA2D_Maximum_Line_WaterMark DMA2D Maximum Line Watermark
Kojto 122:f9eeca106725 472 * @{
Kojto 122:f9eeca106725 473 */
Kojto 122:f9eeca106725 474 #define DMA2D_LINE_WATERMARK_MAX DMA2D_LWR_LW /*!< DMA2D maximum line watermark */
Kojto 122:f9eeca106725 475 /**
Kojto 122:f9eeca106725 476 * @}
Kojto 122:f9eeca106725 477 */
Kojto 122:f9eeca106725 478
Kojto 122:f9eeca106725 479 /** @defgroup DMA2D_Color_Value DMA2D Color Value
Kojto 122:f9eeca106725 480 * @{
Kojto 122:f9eeca106725 481 */
Kojto 122:f9eeca106725 482 #define DMA2D_COLOR_VALUE ((uint32_t)0x000000FFU) /*!< Color value mask */
Kojto 122:f9eeca106725 483 /**
Kojto 122:f9eeca106725 484 * @}
Kojto 122:f9eeca106725 485 */
Kojto 122:f9eeca106725 486
Kojto 122:f9eeca106725 487 /** @defgroup DMA2D_Max_Layer DMA2D Maximum Number of Layers
Kojto 122:f9eeca106725 488 * @{
Kojto 122:f9eeca106725 489 */
Kojto 122:f9eeca106725 490 #define DMA2D_MAX_LAYER 2U /*!< DMA2D maximum number of layers */
Kojto 122:f9eeca106725 491 /**
Kojto 122:f9eeca106725 492 * @}
Kojto 122:f9eeca106725 493 */
Kojto 122:f9eeca106725 494
Kojto 122:f9eeca106725 495 /** @defgroup DMA2D_Offset DMA2D Offset
Kojto 122:f9eeca106725 496 * @{
Kojto 122:f9eeca106725 497 */
Kojto 122:f9eeca106725 498 #define DMA2D_OFFSET DMA2D_FGOR_LO /*!< Line Offset */
Kojto 110:165afa46840b 499 /**
Kojto 110:165afa46840b 500 * @}
Kojto 110:165afa46840b 501 */
Kojto 110:165afa46840b 502
Kojto 122:f9eeca106725 503 /** @defgroup DMA2D_Size DMA2D Size
Kojto 110:165afa46840b 504 * @{
Kojto 110:165afa46840b 505 */
Kojto 122:f9eeca106725 506 #define DMA2D_PIXEL (DMA2D_NLR_PL >> 16U) /*!< DMA2D number of pixels per line */
Kojto 122:f9eeca106725 507 #define DMA2D_LINE DMA2D_NLR_NL /*!< DMA2D number of lines */
Kojto 122:f9eeca106725 508 /**
Kojto 122:f9eeca106725 509 * @}
Kojto 122:f9eeca106725 510 */
Kojto 122:f9eeca106725 511
Kojto 122:f9eeca106725 512 /** @defgroup DMA2D_CLUT_Size DMA2D CLUT Size
Kojto 122:f9eeca106725 513 * @{
Kojto 122:f9eeca106725 514 */
Kojto 122:f9eeca106725 515 #define DMA2D_CLUT_SIZE (DMA2D_FGPFCCR_CS >> 8U) /*!< DMA2D CLUT size */
Kojto 122:f9eeca106725 516 /**
Kojto 122:f9eeca106725 517 * @}
Kojto 122:f9eeca106725 518 */
Kojto 110:165afa46840b 519
Kojto 110:165afa46840b 520 /**
Kojto 110:165afa46840b 521 * @}
Kojto 110:165afa46840b 522 */
Kojto 110:165afa46840b 523
Kojto 110:165afa46840b 524 /* Private macros ------------------------------------------------------------*/
Kojto 110:165afa46840b 525 /** @defgroup DMA2D_Private_Macros DMA2D Private Macros
Kojto 110:165afa46840b 526 * @{
Kojto 110:165afa46840b 527 */
Kojto 122:f9eeca106725 528 #define IS_DMA2D_LAYER(LAYER) ((LAYER) <= DMA2D_MAX_LAYER)
Kojto 110:165afa46840b 529 #define IS_DMA2D_MODE(MODE) (((MODE) == DMA2D_M2M) || ((MODE) == DMA2D_M2M_PFC) || \
Kojto 110:165afa46840b 530 ((MODE) == DMA2D_M2M_BLEND) || ((MODE) == DMA2D_R2M))
Kojto 122:f9eeca106725 531 #define IS_DMA2D_CMODE(MODE_ARGB) (((MODE_ARGB) == DMA2D_OUTPUT_ARGB8888) || ((MODE_ARGB) == DMA2D_OUTPUT_RGB888) || \
Kojto 122:f9eeca106725 532 ((MODE_ARGB) == DMA2D_OUTPUT_RGB565) || ((MODE_ARGB) == DMA2D_OUTPUT_ARGB1555) || \
Kojto 122:f9eeca106725 533 ((MODE_ARGB) == DMA2D_OUTPUT_ARGB4444))
Kojto 122:f9eeca106725 534 #define IS_DMA2D_COLOR(COLOR) ((COLOR) <= DMA2D_COLOR_VALUE)
Kojto 110:165afa46840b 535 #define IS_DMA2D_LINE(LINE) ((LINE) <= DMA2D_LINE)
Kojto 110:165afa46840b 536 #define IS_DMA2D_PIXEL(PIXEL) ((PIXEL) <= DMA2D_PIXEL)
Kojto 110:165afa46840b 537 #define IS_DMA2D_OFFSET(OOFFSET) ((OOFFSET) <= DMA2D_OFFSET)
Kojto 122:f9eeca106725 538 #define IS_DMA2D_INPUT_COLOR_MODE(INPUT_CM) (((INPUT_CM) == DMA2D_INPUT_ARGB8888) || ((INPUT_CM) == DMA2D_INPUT_RGB888) || \
Kojto 122:f9eeca106725 539 ((INPUT_CM) == DMA2D_INPUT_RGB565) || ((INPUT_CM) == DMA2D_INPUT_ARGB1555) || \
Kojto 122:f9eeca106725 540 ((INPUT_CM) == DMA2D_INPUT_ARGB4444) || ((INPUT_CM) == DMA2D_INPUT_L8) || \
Kojto 122:f9eeca106725 541 ((INPUT_CM) == DMA2D_INPUT_AL44) || ((INPUT_CM) == DMA2D_INPUT_AL88) || \
Kojto 122:f9eeca106725 542 ((INPUT_CM) == DMA2D_INPUT_L4) || ((INPUT_CM) == DMA2D_INPUT_A8) || \
Kojto 122:f9eeca106725 543 ((INPUT_CM) == DMA2D_INPUT_A4))
Kojto 110:165afa46840b 544 #define IS_DMA2D_ALPHA_MODE(AlphaMode) (((AlphaMode) == DMA2D_NO_MODIF_ALPHA) || \
Kojto 110:165afa46840b 545 ((AlphaMode) == DMA2D_REPLACE_ALPHA) || \
Kojto 110:165afa46840b 546 ((AlphaMode) == DMA2D_COMBINE_ALPHA))
Kojto 122:f9eeca106725 547
Kojto 110:165afa46840b 548 #define IS_DMA2D_CLUT_CM(CLUT_CM) (((CLUT_CM) == DMA2D_CCM_ARGB8888) || ((CLUT_CM) == DMA2D_CCM_RGB888))
Kojto 110:165afa46840b 549 #define IS_DMA2D_CLUT_SIZE(CLUT_SIZE) ((CLUT_SIZE) <= DMA2D_CLUT_SIZE)
Kojto 122:f9eeca106725 550 #define IS_DMA2D_LINEWATERMARK(LineWatermark) ((LineWatermark) <= DMA2D_LINE_WATERMARK_MAX)
Kojto 122:f9eeca106725 551 #define IS_DMA2D_IT(IT) (((IT) == DMA2D_IT_CTC) || ((IT) == DMA2D_IT_CAE) || \
Kojto 122:f9eeca106725 552 ((IT) == DMA2D_IT_TW) || ((IT) == DMA2D_IT_TC) || \
Kojto 122:f9eeca106725 553 ((IT) == DMA2D_IT_TE) || ((IT) == DMA2D_IT_CE))
Kojto 122:f9eeca106725 554 #define IS_DMA2D_GET_FLAG(FLAG) (((FLAG) == DMA2D_FLAG_CTC) || ((FLAG) == DMA2D_FLAG_CAE) || \
Kojto 122:f9eeca106725 555 ((FLAG) == DMA2D_FLAG_TW) || ((FLAG) == DMA2D_FLAG_TC) || \
Kojto 122:f9eeca106725 556 ((FLAG) == DMA2D_FLAG_TE) || ((FLAG) == DMA2D_FLAG_CE))
Kojto 110:165afa46840b 557 /**
Kojto 110:165afa46840b 558 * @}
Kojto 110:165afa46840b 559 */
Kojto 110:165afa46840b 560
Kojto 110:165afa46840b 561 /**
Kojto 110:165afa46840b 562 * @}
Kojto 122:f9eeca106725 563 */
Kojto 110:165afa46840b 564
Kojto 110:165afa46840b 565 /**
Kojto 110:165afa46840b 566 * @}
Kojto 110:165afa46840b 567 */
Kojto 110:165afa46840b 568
Kojto 110:165afa46840b 569 #endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F469xx || STM32F479xx */
Kojto 110:165afa46840b 570
Kojto 110:165afa46840b 571 #ifdef __cplusplus
Kojto 110:165afa46840b 572 }
Kojto 110:165afa46840b 573 #endif
Kojto 110:165afa46840b 574
Kojto 110:165afa46840b 575 #endif /* __STM32F4xx_HAL_DMA2D_H */
Kojto 110:165afa46840b 576
Kojto 110:165afa46840b 577 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/