You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

505 lines
22 KiB

  1. /**
  2. ******************************************************************************
  3. * @file stm32f4xx_hal_dma2d.h
  4. * @author MCD Application Team
  5. * @version V1.1.0
  6. * @date 19-June-2014
  7. * @brief Header file of DMA2D HAL module.
  8. ******************************************************************************
  9. * @attention
  10. *
  11. * <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
  12. *
  13. * Redistribution and use in source and binary forms, with or without modification,
  14. * are permitted provided that the following conditions are met:
  15. * 1. Redistributions of source code must retain the above copyright notice,
  16. * this list of conditions and the following disclaimer.
  17. * 2. Redistributions in binary form must reproduce the above copyright notice,
  18. * this list of conditions and the following disclaimer in the documentation
  19. * and/or other materials provided with the distribution.
  20. * 3. Neither the name of STMicroelectronics nor the names of its contributors
  21. * may be used to endorse or promote products derived from this software
  22. * without specific prior written permission.
  23. *
  24. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  25. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  26. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  27. * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
  28. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  29. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  30. * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  31. * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  32. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  33. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  34. *
  35. ******************************************************************************
  36. */
  37. /* Define to prevent recursive inclusion -------------------------------------*/
  38. #ifndef __STM32F4xx_HAL_DMA2D_H
  39. #define __STM32F4xx_HAL_DMA2D_H
  40. #ifdef __cplusplus
  41. extern "C" {
  42. #endif
  43. #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx)
  44. /* Includes ------------------------------------------------------------------*/
  45. #include "stm32f4xx_hal_def.h"
  46. /** @addtogroup STM32F4xx_HAL_Driver
  47. * @{
  48. */
  49. /** @addtogroup DMA2D
  50. * @{
  51. */
  52. /* Exported types ------------------------------------------------------------*/
  53. #define MAX_DMA2D_LAYER 2
  54. /**
  55. * @brief DMA2D color Structure definition
  56. */
  57. typedef struct
  58. {
  59. uint32_t Blue; /*!< Configures the blue value.
  60. This parameter must be a number between Min_Data = 0x00 and Max_Data = 0xFF. */
  61. uint32_t Green; /*!< Configures the green value.
  62. This parameter must be a number between Min_Data = 0x00 and Max_Data = 0xFF. */
  63. uint32_t Red; /*!< Configures the red value.
  64. This parameter must be a number between Min_Data = 0x00 and Max_Data = 0xFF. */
  65. } DMA2D_ColorTypeDef;
  66. /**
  67. * @brief DMA2D CLUT Structure definition
  68. */
  69. typedef struct
  70. {
  71. uint32_t *pCLUT; /*!< Configures the DMA2D CLUT memory address.*/
  72. uint32_t CLUTColorMode; /*!< configures the DMA2D CLUT color mode.
  73. This parameter can be one value of @ref DMA2D_CLUT_CM */
  74. uint32_t Size; /*!< configures the DMA2D CLUT size.
  75. This parameter must be a number between Min_Data = 0x00 and Max_Data = 0xFF.*/
  76. } DMA2D_CLUTCfgTypeDef;
  77. /**
  78. * @brief DMA2D Init structure definition
  79. */
  80. typedef struct
  81. {
  82. uint32_t Mode; /*!< configures the DMA2D transfer mode.
  83. This parameter can be one value of @ref DMA2D_Mode */
  84. uint32_t ColorMode; /*!< configures the color format of the output image.
  85. This parameter can be one value of @ref DMA2D_Color_Mode */
  86. uint32_t OutputOffset; /*!< Specifies the Offset value.
  87. This parameter must be a number between Min_Data = 0x0000 and Max_Data = 0x3FFF. */
  88. } DMA2D_InitTypeDef;
  89. /**
  90. * @brief DMA2D Layer structure definition
  91. */
  92. typedef struct
  93. {
  94. uint32_t InputOffset; /*!< configures the DMA2D foreground offset.
  95. This parameter must be a number between Min_Data = 0x0000 and Max_Data = 0x3FFF. */
  96. uint32_t InputColorMode; /*!< configures the DMA2D foreground color mode .
  97. This parameter can be one value of @ref DMA2D_Input_Color_Mode */
  98. uint32_t AlphaMode; /*!< configures the DMA2D foreground alpha mode.
  99. This parameter can be one value of @ref DMA2D_ALPHA_MODE */
  100. uint32_t InputAlpha; /*!< Specifies the DMA2D foreground alpha value and color value in case of A8 or A4 color mode.
  101. This parameter must be a number between Min_Data = 0x00000000 and Max_Data = 0xFFFFFFFF
  102. in case of A8 or A4 color mode (ARGB).
  103. Otherwise, This parameter must be a number between Min_Data = 0x00 and Max_Data = 0xFF.*/
  104. } DMA2D_LayerCfgTypeDef;
  105. /**
  106. * @brief HAL DMA2D State structures definition
  107. */
  108. typedef enum
  109. {
  110. HAL_DMA2D_STATE_RESET = 0x00, /*!< DMA2D not yet initialized or disabled */
  111. HAL_DMA2D_STATE_READY = 0x01, /*!< Peripheral Initialized and ready for use */
  112. HAL_DMA2D_STATE_BUSY = 0x02, /*!< an internal process is ongoing */
  113. HAL_DMA2D_STATE_TIMEOUT = 0x03, /*!< Timeout state */
  114. HAL_DMA2D_STATE_ERROR = 0x04, /*!< DMA2D state error */
  115. HAL_DMA2D_STATE_SUSPEND = 0x05 /*!< DMA2D process is suspended */
  116. }HAL_DMA2D_StateTypeDef;
  117. /**
  118. * @brief DMA2D handle Structure definition
  119. */
  120. typedef struct __DMA2D_HandleTypeDef
  121. {
  122. DMA2D_TypeDef *Instance; /*!< DMA2D Register base address */
  123. DMA2D_InitTypeDef Init; /*!< DMA2D communication parameters */
  124. void (* XferCpltCallback)(struct __DMA2D_HandleTypeDef * hdma2d); /*!< DMA2D transfer complete callback */
  125. void (* XferErrorCallback)(struct __DMA2D_HandleTypeDef * hdma2d); /*!< DMA2D transfer error callback */
  126. DMA2D_LayerCfgTypeDef LayerCfg[MAX_DMA2D_LAYER]; /*!< DMA2D Layers parameters */
  127. HAL_LockTypeDef Lock; /*!< DMA2D Lock */
  128. __IO HAL_DMA2D_StateTypeDef State; /*!< DMA2D transfer state */
  129. __IO uint32_t ErrorCode; /*!< DMA2D Error code */
  130. } DMA2D_HandleTypeDef;
  131. /* Exported constants --------------------------------------------------------*/
  132. /** @defgroup DMA2D_Exported_Constants
  133. * @{
  134. */
  135. /** @defgroup DMA2D_Layer
  136. * @{
  137. */
  138. #define IS_DMA2D_LAYER(LAYER) ((LAYER) <= MAX_DMA2D_LAYER)
  139. /**
  140. * @}
  141. */
  142. /** @defgroup DMA2D_Error_Code
  143. * @{
  144. */
  145. #define HAL_DMA2D_ERROR_NONE ((uint32_t)0x00000000) /*!< No error */
  146. #define HAL_DMA2D_ERROR_TE ((uint32_t)0x00000001) /*!< Transfer error */
  147. #define HAL_DMA2D_ERROR_CE ((uint32_t)0x00000002) /*!< Configuration error */
  148. #define HAL_DMA2D_ERROR_TIMEOUT ((uint32_t)0x00000020) /*!< Timeout error */
  149. /**
  150. * @}
  151. */
  152. /** @defgroup DMA2D_Mode
  153. * @{
  154. */
  155. #define DMA2D_M2M ((uint32_t)0x00000000) /*!< DMA2D memory to memory transfer mode */
  156. #define DMA2D_M2M_PFC ((uint32_t)0x00010000) /*!< DMA2D memory to memory with pixel format conversion transfer mode */
  157. #define DMA2D_M2M_BLEND ((uint32_t)0x00020000) /*!< DMA2D memory to memory with blending transfer mode */
  158. #define DMA2D_R2M ((uint32_t)0x00030000) /*!< DMA2D register to memory transfer mode */
  159. #define IS_DMA2D_MODE(MODE) (((MODE) == DMA2D_M2M) || ((MODE) == DMA2D_M2M_PFC) || \
  160. ((MODE) == DMA2D_M2M_BLEND) || ((MODE) == DMA2D_R2M))
  161. /**
  162. * @}
  163. */
  164. /** @defgroup DMA2D_Color_Mode
  165. * @{
  166. */
  167. #define DMA2D_ARGB8888 ((uint32_t)0x00000000) /*!< ARGB8888 DMA2D color mode */
  168. #define DMA2D_RGB888 ((uint32_t)0x00000001) /*!< RGB888 DMA2D color mode */
  169. #define DMA2D_RGB565 ((uint32_t)0x00000002) /*!< RGB565 DMA2D color mode */
  170. #define DMA2D_ARGB1555 ((uint32_t)0x00000003) /*!< ARGB1555 DMA2D color mode */
  171. #define DMA2D_ARGB4444 ((uint32_t)0x00000004) /*!< ARGB4444 DMA2D color mode */
  172. #define IS_DMA2D_CMODE(MODE_ARGB) (((MODE_ARGB) == DMA2D_ARGB8888) || ((MODE_ARGB) == DMA2D_RGB888) || \
  173. ((MODE_ARGB) == DMA2D_RGB565) || ((MODE_ARGB) == DMA2D_ARGB1555) || \
  174. ((MODE_ARGB) == DMA2D_ARGB4444))
  175. /**
  176. * @}
  177. */
  178. /** @defgroup DMA2D_COLOR_VALUE
  179. * @{
  180. */
  181. #define COLOR_VALUE ((uint32_t)0x000000FF) /*!< color value mask */
  182. #define IS_DMA2D_COLOR(COLOR) ((COLOR) <= COLOR_VALUE)
  183. /**
  184. * @}
  185. */
  186. /** @defgroup DMA2D_SIZE
  187. * @{
  188. */
  189. #define DMA2D_PIXEL (DMA2D_NLR_PL >> 16) /*!< DMA2D pixel per line */
  190. #define DMA2D_LINE DMA2D_NLR_NL /*!< DMA2D number of line */
  191. #define IS_DMA2D_LINE(LINE) ((LINE) <= DMA2D_LINE)
  192. #define IS_DMA2D_PIXEL(PIXEL) ((PIXEL) <= DMA2D_PIXEL)
  193. /**
  194. * @}
  195. */
  196. /** @defgroup DMA2D_Offset
  197. * @{
  198. */
  199. #define DMA2D_OFFSET DMA2D_FGOR_LO /*!< Line Offset */
  200. #define IS_DMA2D_OFFSET(OOFFSET) ((OOFFSET) <= DMA2D_OFFSET)
  201. /**
  202. * @}
  203. */
  204. /** @defgroup DMA2D_Input_Color_Mode
  205. * @{
  206. */
  207. #define CM_ARGB8888 ((uint32_t)0x00000000) /*!< ARGB8888 color mode */
  208. #define CM_RGB888 ((uint32_t)0x00000001) /*!< RGB888 color mode */
  209. #define CM_RGB565 ((uint32_t)0x00000002) /*!< RGB565 color mode */
  210. #define CM_ARGB1555 ((uint32_t)0x00000003) /*!< ARGB1555 color mode */
  211. #define CM_ARGB4444 ((uint32_t)0x00000004) /*!< ARGB4444 color mode */
  212. #define CM_L8 ((uint32_t)0x00000005) /*!< L8 color mode */
  213. #define CM_AL44 ((uint32_t)0x00000006) /*!< AL44 color mode */
  214. #define CM_AL88 ((uint32_t)0x00000007) /*!< AL88 color mode */
  215. #define CM_L4 ((uint32_t)0x00000008) /*!< L4 color mode */
  216. #define CM_A8 ((uint32_t)0x00000009) /*!< A8 color mode */
  217. #define CM_A4 ((uint32_t)0x0000000A) /*!< A4 color mode */
  218. #define IS_DMA2D_INPUT_COLOR_MODE(INPUT_CM) (((INPUT_CM) == CM_ARGB8888) || ((INPUT_CM) == CM_RGB888) || \
  219. ((INPUT_CM) == CM_RGB565) || ((INPUT_CM) == CM_ARGB1555) || \
  220. ((INPUT_CM) == CM_ARGB4444) || ((INPUT_CM) == CM_L8) || \
  221. ((INPUT_CM) == CM_AL44) || ((INPUT_CM) == CM_AL88) || \
  222. ((INPUT_CM) == CM_L4) || ((INPUT_CM) == CM_A8) || \
  223. ((INPUT_CM) == CM_A4))
  224. /**
  225. * @}
  226. */
  227. /** @defgroup DMA2D_ALPHA_MODE
  228. * @{
  229. */
  230. #define DMA2D_NO_MODIF_ALPHA ((uint32_t)0x00000000) /*!< No modification of the alpha channel value */
  231. #define DMA2D_REPLACE_ALPHA ((uint32_t)0x00000001) /*!< Replace original alpha channel value by programmed alpha value */
  232. #define DMA2D_COMBINE_ALPHA ((uint32_t)0x00000002) /*!< Replace original alpha channel value by programmed alpha value
  233. with original alpha channel value */
  234. #define IS_DMA2D_ALPHA_MODE(AlphaMode) (((AlphaMode) == DMA2D_NO_MODIF_ALPHA) || \
  235. ((AlphaMode) == DMA2D_REPLACE_ALPHA) || \
  236. ((AlphaMode) == DMA2D_COMBINE_ALPHA))
  237. /**
  238. * @}
  239. */
  240. /** @defgroup DMA2D_CLUT_CM
  241. * @{
  242. */
  243. #define DMA2D_CCM_ARGB8888 ((uint32_t)0x00000000) /*!< ARGB8888 DMA2D C-LUT color mode */
  244. #define DMA2D_CCM_RGB888 ((uint32_t)0x00000001) /*!< RGB888 DMA2D C-LUT color mode */
  245. #define IS_DMA2D_CLUT_CM(CLUT_CM) (((CLUT_CM) == DMA2D_CCM_ARGB8888) || ((CLUT_CM) == DMA2D_CCM_RGB888))
  246. /**
  247. * @}
  248. */
  249. /** @defgroup DMA2D_Size_Clut
  250. * @{
  251. */
  252. #define DMA2D_CLUT_SIZE (DMA2D_FGPFCCR_CS >> 8) /*!< DMA2D C-LUT size */
  253. #define IS_DMA2D_CLUT_SIZE(CLUT_SIZE) ((CLUT_SIZE) <= DMA2D_CLUT_SIZE)
  254. /**
  255. * @}
  256. */
  257. /** @defgroup DMA2D_DeadTime
  258. * @{
  259. */
  260. #define LINE_WATERMARK DMA2D_LWR_LW
  261. #define IS_DMA2D_LineWatermark(LineWatermark) ((LineWatermark) <= LINE_WATERMARK)
  262. /**
  263. * @}
  264. */
  265. /** @defgroup DMA2D_Interrupts
  266. * @{
  267. */
  268. #define DMA2D_IT_CE DMA2D_CR_CEIE /*!< Configuration Error Interrupt */
  269. #define DMA2D_IT_CTC DMA2D_CR_CTCIE /*!< C-LUT Transfer Complete Interrupt */
  270. #define DMA2D_IT_CAE DMA2D_CR_CAEIE /*!< C-LUT Access Error Interrupt */
  271. #define DMA2D_IT_TW DMA2D_CR_TWIE /*!< Transfer Watermark Interrupt */
  272. #define DMA2D_IT_TC DMA2D_CR_TCIE /*!< Transfer Complete Interrupt */
  273. #define DMA2D_IT_TE DMA2D_CR_TEIE /*!< Transfer Error Interrupt */
  274. #define IS_DMA2D_IT(IT) (((IT) == DMA2D_IT_CTC) || ((IT) == DMA2D_IT_CAE) || \
  275. ((IT) == DMA2D_IT_TW) || ((IT) == DMA2D_IT_TC) || \
  276. ((IT) == DMA2D_IT_TE) || ((IT) == DMA2D_IT_CE))
  277. /**
  278. * @}
  279. */
  280. /** @defgroup DMA2D_Flag
  281. * @{
  282. */
  283. #define DMA2D_FLAG_CE DMA2D_ISR_CEIF /*!< Configuration Error Interrupt Flag */
  284. #define DMA2D_FLAG_CTC DMA2D_ISR_CTCIF /*!< C-LUT Transfer Complete Interrupt Flag */
  285. #define DMA2D_FLAG_CAE DMA2D_ISR_CAEIF /*!< C-LUT Access Error Interrupt Flag */
  286. #define DMA2D_FLAG_TW DMA2D_ISR_TWIF /*!< Transfer Watermark Interrupt Flag */
  287. #define DMA2D_FLAG_TC DMA2D_ISR_TCIF /*!< Transfer Complete Interrupt Flag */
  288. #define DMA2D_FLAG_TE DMA2D_ISR_TEIF /*!< Transfer Error Interrupt Flag */
  289. #define IS_DMA2D_GET_FLAG(FLAG) (((FLAG) == DMA2D_FLAG_CTC) || ((FLAG) == DMA2D_FLAG_CAE) || \
  290. ((FLAG) == DMA2D_FLAG_TW) || ((FLAG) == DMA2D_FLAG_TC) || \
  291. ((FLAG) == DMA2D_FLAG_TE) || ((FLAG) == DMA2D_FLAG_CE))
  292. /**
  293. * @}
  294. */
  295. /**
  296. * @}
  297. */
  298. /* Exported macro ------------------------------------------------------------*/
  299. /** @brief Reset DMA2D handle state
  300. * @param __HANDLE__: specifies the DMA2D handle.
  301. * @retval None
  302. */
  303. #define __HAL_DMA2D_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_DMA2D_STATE_RESET)
  304. /**
  305. * @brief Enable the DMA2D.
  306. * @param __HANDLE__: DMA2D handle
  307. * @retval None.
  308. */
  309. #define __HAL_DMA2D_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= DMA2D_CR_START)
  310. /**
  311. * @brief Disable the DMA2D.
  312. * @param __HANDLE__: DMA2D handle
  313. * @retval None.
  314. */
  315. #define __HAL_DMA2D_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~DMA2D_CR_START)
  316. /* Interrupt & Flag management */
  317. /**
  318. * @brief Get the DMA2D pending flags.
  319. * @param __HANDLE__: DMA2D handle
  320. * @param __FLAG__: Get the specified flag.
  321. * This parameter can be any combination of the following values:
  322. * @arg DMA2D_FLAG_CE: Configuration error flag
  323. * @arg DMA2D_FLAG_CTC: C-LUT transfer complete flag
  324. * @arg DMA2D_FLAG_CAE: C-LUT access error flag
  325. * @arg DMA2D_FLAG_TW: Transfer Watermark flag
  326. * @arg DMA2D_FLAG_TC: Transfer complete flag
  327. * @arg DMA2D_FLAG_TE: Transfer error flag
  328. * @retval The state of FLAG.
  329. */
  330. #define __HAL_DMA2D_GET_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR & (__FLAG__))
  331. /**
  332. * @brief Clears the DMA2D pending flags.
  333. * @param __HANDLE__: DMA2D handle
  334. * @param __FLAG__: specifies the flag to clear.
  335. * This parameter can be any combination of the following values:
  336. * @arg DMA2D_FLAG_CE: Configuration error flag
  337. * @arg DMA2D_FLAG_CTC: C-LUT transfer complete flag
  338. * @arg DMA2D_FLAG_CAE: C-LUT access error flag
  339. * @arg DMA2D_FLAG_TW: Transfer Watermark flag
  340. * @arg DMA2D_FLAG_TC: Transfer complete flag
  341. * @arg DMA2D_FLAG_TE: Transfer error flag
  342. * @retval None
  343. */
  344. #define __HAL_DMA2D_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->IFCR = (__FLAG__))
  345. /**
  346. * @brief Enables the specified DMA2D interrupts.
  347. * @param __HANDLE__: DMA2D handle
  348. * @param __INTERRUPT__: specifies the DMA2D interrupt sources to be enabled.
  349. * This parameter can be any combination of the following values:
  350. * @arg DMA2D_IT_CE: Configuration error interrupt mask
  351. * @arg DMA2D_IT_CTC: C-LUT transfer complete interrupt mask
  352. * @arg DMA2D_IT_CAE: C-LUT access error interrupt mask
  353. * @arg DMA2D_IT_TW: Transfer Watermark interrupt mask
  354. * @arg DMA2D_IT_TC: Transfer complete interrupt mask
  355. * @arg DMA2D_IT_TE: Transfer error interrupt mask
  356. * @retval None
  357. */
  358. #define __HAL_DMA2D_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR |= (__INTERRUPT__))
  359. /**
  360. * @brief Disables the specified DMA2D interrupts.
  361. * @param __HANDLE__: DMA2D handle
  362. * @param __INTERRUPT__: specifies the DMA2D interrupt sources to be disabled.
  363. * This parameter can be any combination of the following values:
  364. * @arg DMA2D_IT_CE: Configuration error interrupt mask
  365. * @arg DMA2D_IT_CTC: C-LUT transfer complete interrupt mask
  366. * @arg DMA2D_IT_CAE: C-LUT access error interrupt mask
  367. * @arg DMA2D_IT_TW: Transfer Watermark interrupt mask
  368. * @arg DMA2D_IT_TC: Transfer complete interrupt mask
  369. * @arg DMA2D_IT_TE: Transfer error interrupt mask
  370. * @retval None
  371. */
  372. #define __HAL_DMA2D_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR &= ~(__INTERRUPT__))
  373. /**
  374. * @brief Checks whether the specified DMA2D interrupt has occurred or not.
  375. * @param __HANDLE__: DMA2D handle
  376. * @param __INTERRUPT__: specifies the DMA2D interrupt source to check.
  377. * This parameter can be one of the following values:
  378. * @arg DMA2D_IT_CE: Configuration error interrupt mask
  379. * @arg DMA2D_IT_CTC: C-LUT transfer complete interrupt mask
  380. * @arg DMA2D_IT_CAE: C-LUT access error interrupt mask
  381. * @arg DMA2D_IT_TW: Transfer Watermark interrupt mask
  382. * @arg DMA2D_IT_TC: Transfer complete interrupt mask
  383. * @arg DMA2D_IT_TE: Transfer error interrupt mask
  384. * @retval The state of INTERRUPT.
  385. */
  386. #define __HAL_DMA2D_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR & (__INTERRUPT__))
  387. /* Exported functions --------------------------------------------------------*/
  388. /* Initialization and de-initialization functions *******************************/
  389. HAL_StatusTypeDef HAL_DMA2D_Init(DMA2D_HandleTypeDef *hdma2d);
  390. HAL_StatusTypeDef HAL_DMA2D_DeInit (DMA2D_HandleTypeDef *hdma2d);
  391. void HAL_DMA2D_MspInit(DMA2D_HandleTypeDef* hdma2d);
  392. void HAL_DMA2D_MspDeInit(DMA2D_HandleTypeDef* hdma2d);
  393. /* IO operation functions *******************************************************/
  394. HAL_StatusTypeDef HAL_DMA2D_Start(DMA2D_HandleTypeDef *hdma2d, uint32_t pdata, uint32_t DstAddress, uint32_t Width, uint32_t Heigh);
  395. HAL_StatusTypeDef HAL_DMA2D_BlendingStart(DMA2D_HandleTypeDef *hdma2d, uint32_t SrcAddress1, uint32_t SrcAddress2, uint32_t DstAddress, uint32_t Width, uint32_t Heigh);
  396. HAL_StatusTypeDef HAL_DMA2D_Start_IT(DMA2D_HandleTypeDef *hdma2d, uint32_t pdata, uint32_t DstAddress, uint32_t Width, uint32_t Heigh);
  397. HAL_StatusTypeDef HAL_DMA2D_BlendingStart_IT(DMA2D_HandleTypeDef *hdma2d, uint32_t SrcAddress1, uint32_t SrcAddress2, uint32_t DstAddress, uint32_t Width, uint32_t Heigh);
  398. HAL_StatusTypeDef HAL_DMA2D_Suspend(DMA2D_HandleTypeDef *hdma2d);
  399. HAL_StatusTypeDef HAL_DMA2D_Resume(DMA2D_HandleTypeDef *hdma2d);
  400. HAL_StatusTypeDef HAL_DMA2D_Abort(DMA2D_HandleTypeDef *hdma2d);
  401. HAL_StatusTypeDef HAL_DMA2D_PollForTransfer(DMA2D_HandleTypeDef *hdma2d, uint32_t Timeout);
  402. void HAL_DMA2D_IRQHandler(DMA2D_HandleTypeDef *hdma2d);
  403. /* Peripheral Control functions *************************************************/
  404. HAL_StatusTypeDef HAL_DMA2D_ConfigLayer(DMA2D_HandleTypeDef *hdma2d, uint32_t LayerIdx);
  405. HAL_StatusTypeDef HAL_DMA2D_ConfigCLUT(DMA2D_HandleTypeDef *hdma2d, DMA2D_CLUTCfgTypeDef CLUTCfg, uint32_t LayerIdx);
  406. HAL_StatusTypeDef HAL_DMA2D_EnableCLUT(DMA2D_HandleTypeDef *hdma2d, uint32_t LayerIdx);
  407. HAL_StatusTypeDef HAL_DMA2D_DisableCLUT(DMA2D_HandleTypeDef *hdma2d, uint32_t LayerIdx);
  408. HAL_StatusTypeDef HAL_DMA2D_ProgramLineEvent(DMA2D_HandleTypeDef *hdma2d, uint32_t Line);
  409. /* Peripheral State functions ***************************************************/
  410. HAL_DMA2D_StateTypeDef HAL_DMA2D_GetState(DMA2D_HandleTypeDef *hdma2d);
  411. uint32_t HAL_DMA2D_GetError(DMA2D_HandleTypeDef *hdma2d);
  412. #endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */
  413. /**
  414. * @}
  415. */
  416. /**
  417. * @}
  418. */
  419. #ifdef __cplusplus
  420. }
  421. #endif
  422. #endif /* __STM32F4xx_HAL_DMA2D_H */
  423. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/