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 106:ba1f97679dad 1 /**
Kojto 106:ba1f97679dad 2 ******************************************************************************
Kojto 106:ba1f97679dad 3 * @file stm32f4xx_hal_dma2d.h
Kojto 106:ba1f97679dad 4 * @author MCD Application Team
Kojto 122:f9eeca106725 5 * @version V1.5.0
Kojto 122:f9eeca106725 6 * @date 06-May-2016
Kojto 106:ba1f97679dad 7 * @brief Header file of DMA2D HAL module.
Kojto 106:ba1f97679dad 8 ******************************************************************************
Kojto 106:ba1f97679dad 9 * @attention
Kojto 106:ba1f97679dad 10 *
Kojto 122:f9eeca106725 11 * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
Kojto 106:ba1f97679dad 12 *
Kojto 106:ba1f97679dad 13 * Redistribution and use in source and binary forms, with or without modification,
Kojto 106:ba1f97679dad 14 * are permitted provided that the following conditions are met:
Kojto 106:ba1f97679dad 15 * 1. Redistributions of source code must retain the above copyright notice,
Kojto 106:ba1f97679dad 16 * this list of conditions and the following disclaimer.
Kojto 106:ba1f97679dad 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
Kojto 106:ba1f97679dad 18 * this list of conditions and the following disclaimer in the documentation
Kojto 106:ba1f97679dad 19 * and/or other materials provided with the distribution.
Kojto 106:ba1f97679dad 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
Kojto 106:ba1f97679dad 21 * may be used to endorse or promote products derived from this software
Kojto 106:ba1f97679dad 22 * without specific prior written permission.
Kojto 106:ba1f97679dad 23 *
Kojto 106:ba1f97679dad 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
Kojto 106:ba1f97679dad 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Kojto 106:ba1f97679dad 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Kojto 106:ba1f97679dad 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
Kojto 106:ba1f97679dad 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Kojto 106:ba1f97679dad 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
Kojto 106:ba1f97679dad 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
Kojto 106:ba1f97679dad 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
Kojto 106:ba1f97679dad 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Kojto 106:ba1f97679dad 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Kojto 106:ba1f97679dad 34 *
Kojto 106:ba1f97679dad 35 ******************************************************************************
Kojto 122:f9eeca106725 36 */
Kojto 106:ba1f97679dad 37
Kojto 106:ba1f97679dad 38 /* Define to prevent recursive inclusion -------------------------------------*/
Kojto 106:ba1f97679dad 39 #ifndef __STM32F4xx_HAL_DMA2D_H
Kojto 106:ba1f97679dad 40 #define __STM32F4xx_HAL_DMA2D_H
Kojto 106:ba1f97679dad 41
Kojto 106:ba1f97679dad 42 #ifdef __cplusplus
Kojto 106:ba1f97679dad 43 extern "C" {
Kojto 106:ba1f97679dad 44 #endif
Kojto 106:ba1f97679dad 45
Kojto 110:165afa46840b 46 #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) ||\
Kojto 110:165afa46840b 47 defined(STM32F469xx) || defined(STM32F479xx)
Kojto 106:ba1f97679dad 48 /* Includes ------------------------------------------------------------------*/
Kojto 106:ba1f97679dad 49 #include "stm32f4xx_hal_def.h"
Kojto 106:ba1f97679dad 50
Kojto 106:ba1f97679dad 51 /** @addtogroup STM32F4xx_HAL_Driver
Kojto 106:ba1f97679dad 52 * @{
Kojto 106:ba1f97679dad 53 */
Kojto 106:ba1f97679dad 54
Kojto 122:f9eeca106725 55 /** @addtogroup DMA2D DMA2D
Kojto 106:ba1f97679dad 56 * @brief DMA2D HAL module driver
Kojto 106:ba1f97679dad 57 * @{
Kojto 106:ba1f97679dad 58 */
Kojto 106:ba1f97679dad 59
Kojto 106:ba1f97679dad 60 /* Exported types ------------------------------------------------------------*/
Kojto 106:ba1f97679dad 61 /** @defgroup DMA2D_Exported_Types DMA2D Exported Types
Kojto 106:ba1f97679dad 62 * @{
Kojto 106:ba1f97679dad 63 */
Kojto 122:f9eeca106725 64 #define MAX_DMA2D_LAYER 2U
Kojto 106:ba1f97679dad 65
Kojto 106:ba1f97679dad 66 /**
Kojto 106:ba1f97679dad 67 * @brief DMA2D color Structure definition
Kojto 106:ba1f97679dad 68 */
Kojto 106:ba1f97679dad 69 typedef struct
Kojto 106:ba1f97679dad 70 {
Kojto 106:ba1f97679dad 71 uint32_t Blue; /*!< Configures the blue value.
Kojto 106:ba1f97679dad 72 This parameter must be a number between Min_Data = 0x00 and Max_Data = 0xFF. */
Kojto 106:ba1f97679dad 73
Kojto 106:ba1f97679dad 74 uint32_t Green; /*!< Configures the green value.
Kojto 106:ba1f97679dad 75 This parameter must be a number between Min_Data = 0x00 and Max_Data = 0xFF. */
Kojto 106:ba1f97679dad 76
Kojto 106:ba1f97679dad 77 uint32_t Red; /*!< Configures the red value.
Kojto 106:ba1f97679dad 78 This parameter must be a number between Min_Data = 0x00 and Max_Data = 0xFF. */
Kojto 106:ba1f97679dad 79 } DMA2D_ColorTypeDef;
Kojto 106:ba1f97679dad 80
Kojto 106:ba1f97679dad 81 /**
Kojto 106:ba1f97679dad 82 * @brief DMA2D CLUT Structure definition
Kojto 106:ba1f97679dad 83 */
Kojto 106:ba1f97679dad 84 typedef struct
Kojto 106:ba1f97679dad 85 {
Kojto 106:ba1f97679dad 86 uint32_t *pCLUT; /*!< Configures the DMA2D CLUT memory address.*/
Kojto 106:ba1f97679dad 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 106:ba1f97679dad 90
Kojto 122:f9eeca106725 91 uint32_t Size; /*!< Configures the DMA2D CLUT size.
Kojto 106:ba1f97679dad 92 This parameter must be a number between Min_Data = 0x00 and Max_Data = 0xFF.*/
Kojto 106:ba1f97679dad 93 } DMA2D_CLUTCfgTypeDef;
Kojto 106:ba1f97679dad 94
Kojto 106:ba1f97679dad 95 /**
Kojto 106:ba1f97679dad 96 * @brief DMA2D Init structure definition
Kojto 106:ba1f97679dad 97 */
Kojto 106:ba1f97679dad 98 typedef struct
Kojto 106:ba1f97679dad 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 106:ba1f97679dad 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 106:ba1f97679dad 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 106:ba1f97679dad 109 } DMA2D_InitTypeDef;
Kojto 106:ba1f97679dad 110
Kojto 106:ba1f97679dad 111 /**
Kojto 106:ba1f97679dad 112 * @brief DMA2D Layer structure definition
Kojto 106:ba1f97679dad 113 */
Kojto 106:ba1f97679dad 114 typedef struct
Kojto 106:ba1f97679dad 115 {
Kojto 122:f9eeca106725 116 uint32_t InputOffset; /*!< Configures the DMA2D foreground or background offset.
Kojto 106:ba1f97679dad 117 This parameter must be a number between Min_Data = 0x0000 and Max_Data = 0x3FFF. */
Kojto 106:ba1f97679dad 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 106:ba1f97679dad 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 106:ba1f97679dad 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 106:ba1f97679dad 134 } DMA2D_LayerCfgTypeDef;
Kojto 106:ba1f97679dad 135
Kojto 106:ba1f97679dad 136 /**
Kojto 106:ba1f97679dad 137 * @brief HAL DMA2D State structures definition
Kojto 106:ba1f97679dad 138 */
Kojto 106:ba1f97679dad 139 typedef enum
Kojto 106:ba1f97679dad 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 106:ba1f97679dad 147 }HAL_DMA2D_StateTypeDef;
Kojto 106:ba1f97679dad 148
Kojto 122:f9eeca106725 149 /**
Kojto 106:ba1f97679dad 150 * @brief DMA2D handle Structure definition
Kojto 106:ba1f97679dad 151 */
Kojto 106:ba1f97679dad 152 typedef struct __DMA2D_HandleTypeDef
Kojto 106:ba1f97679dad 153 {
Kojto 122:f9eeca106725 154 DMA2D_TypeDef *Instance; /*!< DMA2D register base address. */
Kojto 106:ba1f97679dad 155
Kojto 122:f9eeca106725 156 DMA2D_InitTypeDef Init; /*!< DMA2D communication parameters. */
Kojto 106:ba1f97679dad 157
Kojto 122:f9eeca106725 158 void (* XferCpltCallback)(struct __DMA2D_HandleTypeDef * hdma2d); /*!< DMA2D transfer complete callback. */
Kojto 106:ba1f97679dad 159
Kojto 122:f9eeca106725 160 void (* XferErrorCallback)(struct __DMA2D_HandleTypeDef * hdma2d); /*!< DMA2D transfer error callback. */
Kojto 106:ba1f97679dad 161
Kojto 122:f9eeca106725 162 DMA2D_LayerCfgTypeDef LayerCfg[MAX_DMA2D_LAYER]; /*!< DMA2D Layers parameters */
Kojto 106:ba1f97679dad 163
Kojto 122:f9eeca106725 164 HAL_LockTypeDef Lock; /*!< DMA2D lock. */
Kojto 106:ba1f97679dad 165
Kojto 122:f9eeca106725 166 __IO HAL_DMA2D_StateTypeDef State; /*!< DMA2D transfer state. */
Kojto 106:ba1f97679dad 167
Kojto 122:f9eeca106725 168 __IO uint32_t ErrorCode; /*!< DMA2D error code. */
Kojto 106:ba1f97679dad 169 } DMA2D_HandleTypeDef;
Kojto 106:ba1f97679dad 170 /**
Kojto 106:ba1f97679dad 171 * @}
Kojto 106:ba1f97679dad 172 */
Kojto 106:ba1f97679dad 173
Kojto 106:ba1f97679dad 174 /* Exported constants --------------------------------------------------------*/
Kojto 106:ba1f97679dad 175 /** @defgroup DMA2D_Exported_Constants DMA2D Exported Constants
Kojto 106:ba1f97679dad 176 * @{
Kojto 106:ba1f97679dad 177 */
Kojto 106:ba1f97679dad 178
Kojto 106:ba1f97679dad 179 /** @defgroup DMA2D_Error_Code DMA2D Error Code
Kojto 106:ba1f97679dad 180 * @{
Kojto 106:ba1f97679dad 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 106:ba1f97679dad 187 /**
Kojto 106:ba1f97679dad 188 * @}
Kojto 106:ba1f97679dad 189 */
Kojto 106:ba1f97679dad 190
Kojto 106:ba1f97679dad 191 /** @defgroup DMA2D_Mode DMA2D Mode
Kojto 106:ba1f97679dad 192 * @{
Kojto 106:ba1f97679dad 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 106:ba1f97679dad 198 /**
Kojto 106:ba1f97679dad 199 * @}
Kojto 106:ba1f97679dad 200 */
Kojto 106:ba1f97679dad 201
Kojto 122:f9eeca106725 202 /** @defgroup DMA2D_Output_Color_Mode DMA2D Output Color Mode
Kojto 106:ba1f97679dad 203 * @{
Kojto 106:ba1f97679dad 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 106:ba1f97679dad 210 /**
Kojto 106:ba1f97679dad 211 * @}
Kojto 106:ba1f97679dad 212 */
Kojto 106:ba1f97679dad 213
Kojto 106:ba1f97679dad 214 /** @defgroup DMA2D_Input_Color_Mode DMA2D Input Color Mode
Kojto 106:ba1f97679dad 215 * @{
Kojto 106:ba1f97679dad 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 106:ba1f97679dad 228 /**
Kojto 106:ba1f97679dad 229 * @}
Kojto 106:ba1f97679dad 230 */
Kojto 106:ba1f97679dad 231
Kojto 122:f9eeca106725 232 /** @defgroup DMA2D_Alpha_Mode DMA2D Alpha Mode
Kojto 106:ba1f97679dad 233 * @{
Kojto 106:ba1f97679dad 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 106:ba1f97679dad 239 /**
Kojto 106:ba1f97679dad 240 * @}
Kojto 122:f9eeca106725 241 */
Kojto 106:ba1f97679dad 242
Kojto 122:f9eeca106725 243 /** @defgroup DMA2D_CLUT_CM DMA2D CLUT Color Mode
Kojto 106:ba1f97679dad 244 * @{
Kojto 106:ba1f97679dad 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 106:ba1f97679dad 248 /**
Kojto 106:ba1f97679dad 249 * @}
Kojto 106:ba1f97679dad 250 */
Kojto 106:ba1f97679dad 251
Kojto 122:f9eeca106725 252 /** @defgroup DMA2D_Interrupts DMA2D Interrupts
Kojto 106:ba1f97679dad 253 * @{
Kojto 106:ba1f97679dad 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 106:ba1f97679dad 261 /**
Kojto 106:ba1f97679dad 262 * @}
Kojto 106:ba1f97679dad 263 */
Kojto 106:ba1f97679dad 264
Kojto 122:f9eeca106725 265 /** @defgroup DMA2D_Flags DMA2D Flags
Kojto 106:ba1f97679dad 266 * @{
Kojto 106:ba1f97679dad 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 106:ba1f97679dad 282 /**
Kojto 106:ba1f97679dad 283 * @}
Kojto 106:ba1f97679dad 284 */
Kojto 106:ba1f97679dad 285
Kojto 106:ba1f97679dad 286 /**
Kojto 106:ba1f97679dad 287 * @}
Kojto 106:ba1f97679dad 288 */
Kojto 122:f9eeca106725 289 /* Exported macros ------------------------------------------------------------*/
Kojto 106:ba1f97679dad 290 /** @defgroup DMA2D_Exported_Macros DMA2D Exported Macros
Kojto 106:ba1f97679dad 291 * @{
Kojto 106:ba1f97679dad 292 */
Kojto 106:ba1f97679dad 293
Kojto 106:ba1f97679dad 294 /** @brief Reset DMA2D handle state
Kojto 106:ba1f97679dad 295 * @param __HANDLE__: specifies the DMA2D handle.
Kojto 106:ba1f97679dad 296 * @retval None
Kojto 106:ba1f97679dad 297 */
Kojto 106:ba1f97679dad 298 #define __HAL_DMA2D_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_DMA2D_STATE_RESET)
Kojto 106:ba1f97679dad 299
Kojto 106:ba1f97679dad 300 /**
Kojto 106:ba1f97679dad 301 * @brief Enable the DMA2D.
Kojto 106:ba1f97679dad 302 * @param __HANDLE__: DMA2D handle
Kojto 106:ba1f97679dad 303 * @retval None.
Kojto 106:ba1f97679dad 304 */
Kojto 106:ba1f97679dad 305 #define __HAL_DMA2D_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= DMA2D_CR_START)
Kojto 106:ba1f97679dad 306
Kojto 106:ba1f97679dad 307 /* Interrupt & Flag management */
Kojto 106:ba1f97679dad 308 /**
Kojto 106:ba1f97679dad 309 * @brief Get the DMA2D pending flags.
Kojto 106:ba1f97679dad 310 * @param __HANDLE__: DMA2D handle
Kojto 122:f9eeca106725 311 * @param __FLAG__: flag to check.
Kojto 106:ba1f97679dad 312 * This parameter can be any combination of the following values:
Kojto 106:ba1f97679dad 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 106:ba1f97679dad 316 * @arg DMA2D_FLAG_TW: Transfer Watermark flag
Kojto 106:ba1f97679dad 317 * @arg DMA2D_FLAG_TC: Transfer complete flag
Kojto 106:ba1f97679dad 318 * @arg DMA2D_FLAG_TE: Transfer error flag
Kojto 106:ba1f97679dad 319 * @retval The state of FLAG.
Kojto 106:ba1f97679dad 320 */
Kojto 106:ba1f97679dad 321 #define __HAL_DMA2D_GET_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR & (__FLAG__))
Kojto 106:ba1f97679dad 322
Kojto 106:ba1f97679dad 323 /**
Kojto 122:f9eeca106725 324 * @brief Clear the DMA2D pending flags.
Kojto 106:ba1f97679dad 325 * @param __HANDLE__: DMA2D handle
Kojto 106:ba1f97679dad 326 * @param __FLAG__: specifies the flag to clear.
Kojto 106:ba1f97679dad 327 * This parameter can be any combination of the following values:
Kojto 106:ba1f97679dad 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 106:ba1f97679dad 331 * @arg DMA2D_FLAG_TW: Transfer Watermark flag
Kojto 106:ba1f97679dad 332 * @arg DMA2D_FLAG_TC: Transfer complete flag
Kojto 122:f9eeca106725 333 * @arg DMA2D_FLAG_TE: Transfer error flag
Kojto 106:ba1f97679dad 334 * @retval None
Kojto 106:ba1f97679dad 335 */
Kojto 106:ba1f97679dad 336 #define __HAL_DMA2D_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->IFCR = (__FLAG__))
Kojto 106:ba1f97679dad 337
Kojto 106:ba1f97679dad 338 /**
Kojto 122:f9eeca106725 339 * @brief Enable the specified DMA2D interrupts.
Kojto 106:ba1f97679dad 340 * @param __HANDLE__: DMA2D handle
Kojto 122:f9eeca106725 341 * @param __INTERRUPT__: specifies the DMA2D interrupt sources to be enabled.
Kojto 106:ba1f97679dad 342 * This parameter can be any combination of the following values:
Kojto 106:ba1f97679dad 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 106:ba1f97679dad 346 * @arg DMA2D_IT_TW: Transfer Watermark interrupt mask
Kojto 106:ba1f97679dad 347 * @arg DMA2D_IT_TC: Transfer complete interrupt mask
Kojto 106:ba1f97679dad 348 * @arg DMA2D_IT_TE: Transfer error interrupt mask
Kojto 106:ba1f97679dad 349 * @retval None
Kojto 106:ba1f97679dad 350 */
Kojto 106:ba1f97679dad 351 #define __HAL_DMA2D_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR |= (__INTERRUPT__))
Kojto 106:ba1f97679dad 352
Kojto 106:ba1f97679dad 353 /**
Kojto 122:f9eeca106725 354 * @brief Disable the specified DMA2D interrupts.
Kojto 106:ba1f97679dad 355 * @param __HANDLE__: DMA2D handle
Kojto 122:f9eeca106725 356 * @param __INTERRUPT__: specifies the DMA2D interrupt sources to be disabled.
Kojto 106:ba1f97679dad 357 * This parameter can be any combination of the following values:
Kojto 106:ba1f97679dad 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 106:ba1f97679dad 361 * @arg DMA2D_IT_TW: Transfer Watermark interrupt mask
Kojto 106:ba1f97679dad 362 * @arg DMA2D_IT_TC: Transfer complete interrupt mask
Kojto 106:ba1f97679dad 363 * @arg DMA2D_IT_TE: Transfer error interrupt mask
Kojto 106:ba1f97679dad 364 * @retval None
Kojto 106:ba1f97679dad 365 */
Kojto 106:ba1f97679dad 366 #define __HAL_DMA2D_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR &= ~(__INTERRUPT__))
Kojto 106:ba1f97679dad 367
Kojto 106:ba1f97679dad 368 /**
Kojto 122:f9eeca106725 369 * @brief Check whether the specified DMA2D interrupt source is enabled or not.
Kojto 106:ba1f97679dad 370 * @param __HANDLE__: DMA2D handle
Kojto 106:ba1f97679dad 371 * @param __INTERRUPT__: specifies the DMA2D interrupt source to check.
Kojto 106:ba1f97679dad 372 * This parameter can be one of the following values:
Kojto 106:ba1f97679dad 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 106:ba1f97679dad 376 * @arg DMA2D_IT_TW: Transfer Watermark interrupt mask
Kojto 106:ba1f97679dad 377 * @arg DMA2D_IT_TC: Transfer complete interrupt mask
Kojto 106:ba1f97679dad 378 * @arg DMA2D_IT_TE: Transfer error interrupt mask
Kojto 122:f9eeca106725 379 * @retval The state of INTERRUPT source.
Kojto 106:ba1f97679dad 380 */
Kojto 106:ba1f97679dad 381 #define __HAL_DMA2D_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR & (__INTERRUPT__))
Kojto 122:f9eeca106725 382
Kojto 106:ba1f97679dad 383 /**
Kojto 106:ba1f97679dad 384 * @}
Kojto 106:ba1f97679dad 385 */
Kojto 106:ba1f97679dad 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 106:ba1f97679dad 393 * @{
Kojto 106:ba1f97679dad 394 */
Kojto 122:f9eeca106725 395
Kojto 106:ba1f97679dad 396 /* Initialization and de-initialization functions *******************************/
Kojto 122:f9eeca106725 397 HAL_StatusTypeDef HAL_DMA2D_Init(DMA2D_HandleTypeDef *hdma2d);
Kojto 106:ba1f97679dad 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 106:ba1f97679dad 409
Kojto 106:ba1f97679dad 410 /* IO operation functions *******************************************************/
Kojto 106:ba1f97679dad 411 HAL_StatusTypeDef HAL_DMA2D_Start(DMA2D_HandleTypeDef *hdma2d, uint32_t pdata, uint32_t DstAddress, uint32_t Width, uint32_t Height);
Kojto 106:ba1f97679dad 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 106:ba1f97679dad 413 HAL_StatusTypeDef HAL_DMA2D_Start_IT(DMA2D_HandleTypeDef *hdma2d, uint32_t pdata, uint32_t DstAddress, uint32_t Width, uint32_t Height);
Kojto 106:ba1f97679dad 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 106:ba1f97679dad 415 HAL_StatusTypeDef HAL_DMA2D_Suspend(DMA2D_HandleTypeDef *hdma2d);
Kojto 106:ba1f97679dad 416 HAL_StatusTypeDef HAL_DMA2D_Resume(DMA2D_HandleTypeDef *hdma2d);
Kojto 106:ba1f97679dad 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 106:ba1f97679dad 424 HAL_StatusTypeDef HAL_DMA2D_PollForTransfer(DMA2D_HandleTypeDef *hdma2d, uint32_t Timeout);
Kojto 106:ba1f97679dad 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 106:ba1f97679dad 436
Kojto 106:ba1f97679dad 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 106:ba1f97679dad 452
Kojto 106:ba1f97679dad 453 /* Peripheral State functions ***************************************************/
Kojto 106:ba1f97679dad 454 HAL_DMA2D_StateTypeDef HAL_DMA2D_GetState(DMA2D_HandleTypeDef *hdma2d);
Kojto 106:ba1f97679dad 455 uint32_t HAL_DMA2D_GetError(DMA2D_HandleTypeDef *hdma2d);
Kojto 106:ba1f97679dad 456
Kojto 106:ba1f97679dad 457 /**
Kojto 106:ba1f97679dad 458 * @}
Kojto 106:ba1f97679dad 459 */
Kojto 106:ba1f97679dad 460
Kojto 106:ba1f97679dad 461 /**
Kojto 106:ba1f97679dad 462 * @}
Kojto 106:ba1f97679dad 463 */
Kojto 106:ba1f97679dad 464
Kojto 122:f9eeca106725 465 /* Private constants ---------------------------------------------------------*/
Kojto 122:f9eeca106725 466
Kojto 122:f9eeca106725 467 /** @addtogroup DMA2D_Private_Constants DMA2D Private Constants
Kojto 106:ba1f97679dad 468 * @{
Kojto 106:ba1f97679dad 469 */
Kojto 106:ba1f97679dad 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 106:ba1f97679dad 499 /**
Kojto 106:ba1f97679dad 500 * @}
Kojto 106:ba1f97679dad 501 */
Kojto 106:ba1f97679dad 502
Kojto 122:f9eeca106725 503 /** @defgroup DMA2D_Size DMA2D Size
Kojto 106:ba1f97679dad 504 * @{
Kojto 106:ba1f97679dad 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 106:ba1f97679dad 519
Kojto 106:ba1f97679dad 520 /**
Kojto 106:ba1f97679dad 521 * @}
Kojto 106:ba1f97679dad 522 */
Kojto 106:ba1f97679dad 523
Kojto 106:ba1f97679dad 524 /* Private macros ------------------------------------------------------------*/
Kojto 106:ba1f97679dad 525 /** @defgroup DMA2D_Private_Macros DMA2D Private Macros
Kojto 106:ba1f97679dad 526 * @{
Kojto 106:ba1f97679dad 527 */
Kojto 122:f9eeca106725 528 #define IS_DMA2D_LAYER(LAYER) ((LAYER) <= DMA2D_MAX_LAYER)
Kojto 106:ba1f97679dad 529 #define IS_DMA2D_MODE(MODE) (((MODE) == DMA2D_M2M) || ((MODE) == DMA2D_M2M_PFC) || \
Kojto 106:ba1f97679dad 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 106:ba1f97679dad 535 #define IS_DMA2D_LINE(LINE) ((LINE) <= DMA2D_LINE)
Kojto 106:ba1f97679dad 536 #define IS_DMA2D_PIXEL(PIXEL) ((PIXEL) <= DMA2D_PIXEL)
Kojto 106:ba1f97679dad 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 106:ba1f97679dad 544 #define IS_DMA2D_ALPHA_MODE(AlphaMode) (((AlphaMode) == DMA2D_NO_MODIF_ALPHA) || \
Kojto 106:ba1f97679dad 545 ((AlphaMode) == DMA2D_REPLACE_ALPHA) || \
Kojto 106:ba1f97679dad 546 ((AlphaMode) == DMA2D_COMBINE_ALPHA))
Kojto 122:f9eeca106725 547
Kojto 106:ba1f97679dad 548 #define IS_DMA2D_CLUT_CM(CLUT_CM) (((CLUT_CM) == DMA2D_CCM_ARGB8888) || ((CLUT_CM) == DMA2D_CCM_RGB888))
Kojto 106:ba1f97679dad 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 106:ba1f97679dad 557 /**
Kojto 106:ba1f97679dad 558 * @}
Kojto 106:ba1f97679dad 559 */
Kojto 106:ba1f97679dad 560
Kojto 106:ba1f97679dad 561 /**
Kojto 106:ba1f97679dad 562 * @}
Kojto 122:f9eeca106725 563 */
Kojto 106:ba1f97679dad 564
Kojto 106:ba1f97679dad 565 /**
Kojto 106:ba1f97679dad 566 * @}
Kojto 106:ba1f97679dad 567 */
Kojto 106:ba1f97679dad 568
Kojto 110:165afa46840b 569 #endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F469xx || STM32F479xx */
Kojto 106:ba1f97679dad 570
Kojto 106:ba1f97679dad 571 #ifdef __cplusplus
Kojto 106:ba1f97679dad 572 }
Kojto 106:ba1f97679dad 573 #endif
Kojto 106:ba1f97679dad 574
Kojto 106:ba1f97679dad 575 #endif /* __STM32F4xx_HAL_DMA2D_H */
Kojto 106:ba1f97679dad 576
Kojto 106:ba1f97679dad 577 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/