stm32f4xx_hal_dma.h 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804
  1. /**
  2. ******************************************************************************
  3. * @file stm32f4xx_hal_dma.h
  4. * @author MCD Application Team
  5. * @brief Header file of DMA HAL module.
  6. ******************************************************************************
  7. * @attention
  8. *
  9. * <h2><center>&copy; Copyright (c) 2017 STMicroelectronics.
  10. * All rights reserved.</center></h2>
  11. *
  12. * This software component is licensed by ST under BSD 3-Clause license,
  13. * the "License"; You may not use this file except in compliance with the
  14. * License. You may obtain a copy of the License at:
  15. * opensource.org/licenses/BSD-3-Clause
  16. *
  17. ******************************************************************************
  18. */
  19. /* Define to prevent recursive inclusion -------------------------------------*/
  20. #ifndef __STM32F4xx_HAL_DMA_H
  21. #define __STM32F4xx_HAL_DMA_H
  22. #ifdef __cplusplus
  23. extern "C" {
  24. #endif
  25. /* Includes ------------------------------------------------------------------*/
  26. #include "stm32f4xx_hal_def.h"
  27. /** @addtogroup STM32F4xx_HAL_Driver
  28. * @{
  29. */
  30. /** @addtogroup DMA
  31. * @{
  32. */
  33. /* Exported types ------------------------------------------------------------*/
  34. /** @defgroup DMA_Exported_Types DMA Exported Types
  35. * @brief DMA Exported Types
  36. * @{
  37. */
  38. /**
  39. * @brief DMA Configuration Structure definition
  40. */
  41. typedef struct
  42. {
  43. uint32_t Channel; /*!< Specifies the channel used for the specified stream.
  44. This parameter can be a value of @ref DMA_Channel_selection */
  45. uint32_t Direction; /*!< Specifies if the data will be transferred from memory to peripheral,
  46. from memory to memory or from peripheral to memory.
  47. This parameter can be a value of @ref DMA_Data_transfer_direction */
  48. uint32_t PeriphInc; /*!< Specifies whether the Peripheral address register should be incremented or not.
  49. This parameter can be a value of @ref DMA_Peripheral_incremented_mode */
  50. uint32_t MemInc; /*!< Specifies whether the memory address register should be incremented or not.
  51. This parameter can be a value of @ref DMA_Memory_incremented_mode */
  52. uint32_t PeriphDataAlignment; /*!< Specifies the Peripheral data width.
  53. This parameter can be a value of @ref DMA_Peripheral_data_size */
  54. uint32_t MemDataAlignment; /*!< Specifies the Memory data width.
  55. This parameter can be a value of @ref DMA_Memory_data_size */
  56. uint32_t Mode; /*!< Specifies the operation mode of the DMAy Streamx.
  57. This parameter can be a value of @ref DMA_mode
  58. @note The circular buffer mode cannot be used if the memory-to-memory
  59. data transfer is configured on the selected Stream */
  60. uint32_t Priority; /*!< Specifies the software priority for the DMAy Streamx.
  61. This parameter can be a value of @ref DMA_Priority_level */
  62. uint32_t FIFOMode; /*!< Specifies if the FIFO mode or Direct mode will be used for the specified stream.
  63. This parameter can be a value of @ref DMA_FIFO_direct_mode
  64. @note The Direct mode (FIFO mode disabled) cannot be used if the
  65. memory-to-memory data transfer is configured on the selected stream */
  66. uint32_t FIFOThreshold; /*!< Specifies the FIFO threshold level.
  67. This parameter can be a value of @ref DMA_FIFO_threshold_level */
  68. uint32_t MemBurst; /*!< Specifies the Burst transfer configuration for the memory transfers.
  69. It specifies the amount of data to be transferred in a single non interruptible
  70. transaction.
  71. This parameter can be a value of @ref DMA_Memory_burst
  72. @note The burst mode is possible only if the address Increment mode is enabled. */
  73. uint32_t PeriphBurst; /*!< Specifies the Burst transfer configuration for the peripheral transfers.
  74. It specifies the amount of data to be transferred in a single non interruptible
  75. transaction.
  76. This parameter can be a value of @ref DMA_Peripheral_burst
  77. @note The burst mode is possible only if the address Increment mode is enabled. */
  78. }DMA_InitTypeDef;
  79. /**
  80. * @brief HAL DMA State structures definition
  81. */
  82. typedef enum
  83. {
  84. HAL_DMA_STATE_RESET = 0x00U, /*!< DMA not yet initialized or disabled */
  85. HAL_DMA_STATE_READY = 0x01U, /*!< DMA initialized and ready for use */
  86. HAL_DMA_STATE_BUSY = 0x02U, /*!< DMA process is ongoing */
  87. HAL_DMA_STATE_TIMEOUT = 0x03U, /*!< DMA timeout state */
  88. HAL_DMA_STATE_ERROR = 0x04U, /*!< DMA error state */
  89. HAL_DMA_STATE_ABORT = 0x05U, /*!< DMA Abort state */
  90. }HAL_DMA_StateTypeDef;
  91. /**
  92. * @brief HAL DMA Error Code structure definition
  93. */
  94. typedef enum
  95. {
  96. HAL_DMA_FULL_TRANSFER = 0x00U, /*!< Full transfer */
  97. HAL_DMA_HALF_TRANSFER = 0x01U /*!< Half Transfer */
  98. }HAL_DMA_LevelCompleteTypeDef;
  99. /**
  100. * @brief HAL DMA Error Code structure definition
  101. */
  102. typedef enum
  103. {
  104. HAL_DMA_XFER_CPLT_CB_ID = 0x00U, /*!< Full transfer */
  105. HAL_DMA_XFER_HALFCPLT_CB_ID = 0x01U, /*!< Half Transfer */
  106. HAL_DMA_XFER_M1CPLT_CB_ID = 0x02U, /*!< M1 Full Transfer */
  107. HAL_DMA_XFER_M1HALFCPLT_CB_ID = 0x03U, /*!< M1 Half Transfer */
  108. HAL_DMA_XFER_ERROR_CB_ID = 0x04U, /*!< Error */
  109. HAL_DMA_XFER_ABORT_CB_ID = 0x05U, /*!< Abort */
  110. HAL_DMA_XFER_ALL_CB_ID = 0x06U /*!< All */
  111. }HAL_DMA_CallbackIDTypeDef;
  112. /**
  113. * @brief DMA handle Structure definition
  114. */
  115. typedef struct __DMA_HandleTypeDef
  116. {
  117. DMA_Stream_TypeDef *Instance; /*!< Register base address */
  118. DMA_InitTypeDef Init; /*!< DMA communication parameters */
  119. HAL_LockTypeDef Lock; /*!< DMA locking object */
  120. __IO HAL_DMA_StateTypeDef State; /*!< DMA transfer state */
  121. void *Parent; /*!< Parent object state */
  122. void (* XferCpltCallback)( struct __DMA_HandleTypeDef * hdma); /*!< DMA transfer complete callback */
  123. void (* XferHalfCpltCallback)( struct __DMA_HandleTypeDef * hdma); /*!< DMA Half transfer complete callback */
  124. void (* XferM1CpltCallback)( struct __DMA_HandleTypeDef * hdma); /*!< DMA transfer complete Memory1 callback */
  125. void (* XferM1HalfCpltCallback)( struct __DMA_HandleTypeDef * hdma); /*!< DMA transfer Half complete Memory1 callback */
  126. void (* XferErrorCallback)( struct __DMA_HandleTypeDef * hdma); /*!< DMA transfer error callback */
  127. void (* XferAbortCallback)( struct __DMA_HandleTypeDef * hdma); /*!< DMA transfer Abort callback */
  128. __IO uint32_t ErrorCode; /*!< DMA Error code */
  129. uint32_t StreamBaseAddress; /*!< DMA Stream Base Address */
  130. uint32_t StreamIndex; /*!< DMA Stream Index */
  131. }DMA_HandleTypeDef;
  132. /**
  133. * @}
  134. */
  135. /* Exported constants --------------------------------------------------------*/
  136. /** @defgroup DMA_Exported_Constants DMA Exported Constants
  137. * @brief DMA Exported constants
  138. * @{
  139. */
  140. /** @defgroup DMA_Error_Code DMA Error Code
  141. * @brief DMA Error Code
  142. * @{
  143. */
  144. #define HAL_DMA_ERROR_NONE 0x00000000U /*!< No error */
  145. #define HAL_DMA_ERROR_TE 0x00000001U /*!< Transfer error */
  146. #define HAL_DMA_ERROR_FE 0x00000002U /*!< FIFO error */
  147. #define HAL_DMA_ERROR_DME 0x00000004U /*!< Direct Mode error */
  148. #define HAL_DMA_ERROR_TIMEOUT 0x00000020U /*!< Timeout error */
  149. #define HAL_DMA_ERROR_PARAM 0x00000040U /*!< Parameter error */
  150. #define HAL_DMA_ERROR_NO_XFER 0x00000080U /*!< Abort requested with no Xfer ongoing */
  151. #define HAL_DMA_ERROR_NOT_SUPPORTED 0x00000100U /*!< Not supported mode */
  152. /**
  153. * @}
  154. */
  155. /** @defgroup DMA_Channel_selection DMA Channel selection
  156. * @brief DMA channel selection
  157. * @{
  158. */
  159. #define DMA_CHANNEL_0 0x00000000U /*!< DMA Channel 0 */
  160. #define DMA_CHANNEL_1 0x02000000U /*!< DMA Channel 1 */
  161. #define DMA_CHANNEL_2 0x04000000U /*!< DMA Channel 2 */
  162. #define DMA_CHANNEL_3 0x06000000U /*!< DMA Channel 3 */
  163. #define DMA_CHANNEL_4 0x08000000U /*!< DMA Channel 4 */
  164. #define DMA_CHANNEL_5 0x0A000000U /*!< DMA Channel 5 */
  165. #define DMA_CHANNEL_6 0x0C000000U /*!< DMA Channel 6 */
  166. #define DMA_CHANNEL_7 0x0E000000U /*!< DMA Channel 7 */
  167. #if defined (DMA_SxCR_CHSEL_3)
  168. #define DMA_CHANNEL_8 0x10000000U /*!< DMA Channel 8 */
  169. #define DMA_CHANNEL_9 0x12000000U /*!< DMA Channel 9 */
  170. #define DMA_CHANNEL_10 0x14000000U /*!< DMA Channel 10 */
  171. #define DMA_CHANNEL_11 0x16000000U /*!< DMA Channel 11 */
  172. #define DMA_CHANNEL_12 0x18000000U /*!< DMA Channel 12 */
  173. #define DMA_CHANNEL_13 0x1A000000U /*!< DMA Channel 13 */
  174. #define DMA_CHANNEL_14 0x1C000000U /*!< DMA Channel 14 */
  175. #define DMA_CHANNEL_15 0x1E000000U /*!< DMA Channel 15 */
  176. #endif /* DMA_SxCR_CHSEL_3 */
  177. /**
  178. * @}
  179. */
  180. /** @defgroup DMA_Data_transfer_direction DMA Data transfer direction
  181. * @brief DMA data transfer direction
  182. * @{
  183. */
  184. #define DMA_PERIPH_TO_MEMORY 0x00000000U /*!< Peripheral to memory direction */
  185. #define DMA_MEMORY_TO_PERIPH ((uint32_t)DMA_SxCR_DIR_0) /*!< Memory to peripheral direction */
  186. #define DMA_MEMORY_TO_MEMORY ((uint32_t)DMA_SxCR_DIR_1) /*!< Memory to memory direction */
  187. /**
  188. * @}
  189. */
  190. /** @defgroup DMA_Peripheral_incremented_mode DMA Peripheral incremented mode
  191. * @brief DMA peripheral incremented mode
  192. * @{
  193. */
  194. #define DMA_PINC_ENABLE ((uint32_t)DMA_SxCR_PINC) /*!< Peripheral increment mode enable */
  195. #define DMA_PINC_DISABLE 0x00000000U /*!< Peripheral increment mode disable */
  196. /**
  197. * @}
  198. */
  199. /** @defgroup DMA_Memory_incremented_mode DMA Memory incremented mode
  200. * @brief DMA memory incremented mode
  201. * @{
  202. */
  203. #define DMA_MINC_ENABLE ((uint32_t)DMA_SxCR_MINC) /*!< Memory increment mode enable */
  204. #define DMA_MINC_DISABLE 0x00000000U /*!< Memory increment mode disable */
  205. /**
  206. * @}
  207. */
  208. /** @defgroup DMA_Peripheral_data_size DMA Peripheral data size
  209. * @brief DMA peripheral data size
  210. * @{
  211. */
  212. #define DMA_PDATAALIGN_BYTE 0x00000000U /*!< Peripheral data alignment: Byte */
  213. #define DMA_PDATAALIGN_HALFWORD ((uint32_t)DMA_SxCR_PSIZE_0) /*!< Peripheral data alignment: HalfWord */
  214. #define DMA_PDATAALIGN_WORD ((uint32_t)DMA_SxCR_PSIZE_1) /*!< Peripheral data alignment: Word */
  215. /**
  216. * @}
  217. */
  218. /** @defgroup DMA_Memory_data_size DMA Memory data size
  219. * @brief DMA memory data size
  220. * @{
  221. */
  222. #define DMA_MDATAALIGN_BYTE 0x00000000U /*!< Memory data alignment: Byte */
  223. #define DMA_MDATAALIGN_HALFWORD ((uint32_t)DMA_SxCR_MSIZE_0) /*!< Memory data alignment: HalfWord */
  224. #define DMA_MDATAALIGN_WORD ((uint32_t)DMA_SxCR_MSIZE_1) /*!< Memory data alignment: Word */
  225. /**
  226. * @}
  227. */
  228. /** @defgroup DMA_mode DMA mode
  229. * @brief DMA mode
  230. * @{
  231. */
  232. #define DMA_NORMAL 0x00000000U /*!< Normal mode */
  233. #define DMA_CIRCULAR ((uint32_t)DMA_SxCR_CIRC) /*!< Circular mode */
  234. #define DMA_PFCTRL ((uint32_t)DMA_SxCR_PFCTRL) /*!< Peripheral flow control mode */
  235. /**
  236. * @}
  237. */
  238. /** @defgroup DMA_Priority_level DMA Priority level
  239. * @brief DMA priority levels
  240. * @{
  241. */
  242. #define DMA_PRIORITY_LOW 0x00000000U /*!< Priority level: Low */
  243. #define DMA_PRIORITY_MEDIUM ((uint32_t)DMA_SxCR_PL_0) /*!< Priority level: Medium */
  244. #define DMA_PRIORITY_HIGH ((uint32_t)DMA_SxCR_PL_1) /*!< Priority level: High */
  245. #define DMA_PRIORITY_VERY_HIGH ((uint32_t)DMA_SxCR_PL) /*!< Priority level: Very High */
  246. /**
  247. * @}
  248. */
  249. /** @defgroup DMA_FIFO_direct_mode DMA FIFO direct mode
  250. * @brief DMA FIFO direct mode
  251. * @{
  252. */
  253. #define DMA_FIFOMODE_DISABLE 0x00000000U /*!< FIFO mode disable */
  254. #define DMA_FIFOMODE_ENABLE ((uint32_t)DMA_SxFCR_DMDIS) /*!< FIFO mode enable */
  255. /**
  256. * @}
  257. */
  258. /** @defgroup DMA_FIFO_threshold_level DMA FIFO threshold level
  259. * @brief DMA FIFO level
  260. * @{
  261. */
  262. #define DMA_FIFO_THRESHOLD_1QUARTERFULL 0x00000000U /*!< FIFO threshold 1 quart full configuration */
  263. #define DMA_FIFO_THRESHOLD_HALFFULL ((uint32_t)DMA_SxFCR_FTH_0) /*!< FIFO threshold half full configuration */
  264. #define DMA_FIFO_THRESHOLD_3QUARTERSFULL ((uint32_t)DMA_SxFCR_FTH_1) /*!< FIFO threshold 3 quarts full configuration */
  265. #define DMA_FIFO_THRESHOLD_FULL ((uint32_t)DMA_SxFCR_FTH) /*!< FIFO threshold full configuration */
  266. /**
  267. * @}
  268. */
  269. /** @defgroup DMA_Memory_burst DMA Memory burst
  270. * @brief DMA memory burst
  271. * @{
  272. */
  273. #define DMA_MBURST_SINGLE 0x00000000U
  274. #define DMA_MBURST_INC4 ((uint32_t)DMA_SxCR_MBURST_0)
  275. #define DMA_MBURST_INC8 ((uint32_t)DMA_SxCR_MBURST_1)
  276. #define DMA_MBURST_INC16 ((uint32_t)DMA_SxCR_MBURST)
  277. /**
  278. * @}
  279. */
  280. /** @defgroup DMA_Peripheral_burst DMA Peripheral burst
  281. * @brief DMA peripheral burst
  282. * @{
  283. */
  284. #define DMA_PBURST_SINGLE 0x00000000U
  285. #define DMA_PBURST_INC4 ((uint32_t)DMA_SxCR_PBURST_0)
  286. #define DMA_PBURST_INC8 ((uint32_t)DMA_SxCR_PBURST_1)
  287. #define DMA_PBURST_INC16 ((uint32_t)DMA_SxCR_PBURST)
  288. /**
  289. * @}
  290. */
  291. /** @defgroup DMA_interrupt_enable_definitions DMA interrupt enable definitions
  292. * @brief DMA interrupts definition
  293. * @{
  294. */
  295. #define DMA_IT_TC ((uint32_t)DMA_SxCR_TCIE)
  296. #define DMA_IT_HT ((uint32_t)DMA_SxCR_HTIE)
  297. #define DMA_IT_TE ((uint32_t)DMA_SxCR_TEIE)
  298. #define DMA_IT_DME ((uint32_t)DMA_SxCR_DMEIE)
  299. #define DMA_IT_FE 0x00000080U
  300. /**
  301. * @}
  302. */
  303. /** @defgroup DMA_flag_definitions DMA flag definitions
  304. * @brief DMA flag definitions
  305. * @{
  306. */
  307. #define DMA_FLAG_FEIF0_4 0x00000001U
  308. #define DMA_FLAG_DMEIF0_4 0x00000004U
  309. #define DMA_FLAG_TEIF0_4 0x00000008U
  310. #define DMA_FLAG_HTIF0_4 0x00000010U
  311. #define DMA_FLAG_TCIF0_4 0x00000020U
  312. #define DMA_FLAG_FEIF1_5 0x00000040U
  313. #define DMA_FLAG_DMEIF1_5 0x00000100U
  314. #define DMA_FLAG_TEIF1_5 0x00000200U
  315. #define DMA_FLAG_HTIF1_5 0x00000400U
  316. #define DMA_FLAG_TCIF1_5 0x00000800U
  317. #define DMA_FLAG_FEIF2_6 0x00010000U
  318. #define DMA_FLAG_DMEIF2_6 0x00040000U
  319. #define DMA_FLAG_TEIF2_6 0x00080000U
  320. #define DMA_FLAG_HTIF2_6 0x00100000U
  321. #define DMA_FLAG_TCIF2_6 0x00200000U
  322. #define DMA_FLAG_FEIF3_7 0x00400000U
  323. #define DMA_FLAG_DMEIF3_7 0x01000000U
  324. #define DMA_FLAG_TEIF3_7 0x02000000U
  325. #define DMA_FLAG_HTIF3_7 0x04000000U
  326. #define DMA_FLAG_TCIF3_7 0x08000000U
  327. /**
  328. * @}
  329. */
  330. /**
  331. * @}
  332. */
  333. /* Exported macro ------------------------------------------------------------*/
  334. /** @brief Reset DMA handle state
  335. * @param __HANDLE__ specifies the DMA handle.
  336. * @retval None
  337. */
  338. #define __HAL_DMA_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_DMA_STATE_RESET)
  339. /**
  340. * @brief Return the current DMA Stream FIFO filled level.
  341. * @param __HANDLE__ DMA handle
  342. * @retval The FIFO filling state.
  343. * - DMA_FIFOStatus_Less1QuarterFull: when FIFO is less than 1 quarter-full
  344. * and not empty.
  345. * - DMA_FIFOStatus_1QuarterFull: if more than 1 quarter-full.
  346. * - DMA_FIFOStatus_HalfFull: if more than 1 half-full.
  347. * - DMA_FIFOStatus_3QuartersFull: if more than 3 quarters-full.
  348. * - DMA_FIFOStatus_Empty: when FIFO is empty
  349. * - DMA_FIFOStatus_Full: when FIFO is full
  350. */
  351. #define __HAL_DMA_GET_FS(__HANDLE__) (((__HANDLE__)->Instance->FCR & (DMA_SxFCR_FS)))
  352. /**
  353. * @brief Enable the specified DMA Stream.
  354. * @param __HANDLE__ DMA handle
  355. * @retval None
  356. */
  357. #define __HAL_DMA_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= DMA_SxCR_EN)
  358. /**
  359. * @brief Disable the specified DMA Stream.
  360. * @param __HANDLE__ DMA handle
  361. * @retval None
  362. */
  363. #define __HAL_DMA_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~DMA_SxCR_EN)
  364. /* Interrupt & Flag management */
  365. /**
  366. * @brief Return the current DMA Stream transfer complete flag.
  367. * @param __HANDLE__ DMA handle
  368. * @retval The specified transfer complete flag index.
  369. */
  370. #define __HAL_DMA_GET_TC_FLAG_INDEX(__HANDLE__) \
  371. (((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream0))? DMA_FLAG_TCIF0_4 :\
  372. ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream0))? DMA_FLAG_TCIF0_4 :\
  373. ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream4))? DMA_FLAG_TCIF0_4 :\
  374. ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream4))? DMA_FLAG_TCIF0_4 :\
  375. ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream1))? DMA_FLAG_TCIF1_5 :\
  376. ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream1))? DMA_FLAG_TCIF1_5 :\
  377. ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream5))? DMA_FLAG_TCIF1_5 :\
  378. ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream5))? DMA_FLAG_TCIF1_5 :\
  379. ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream2))? DMA_FLAG_TCIF2_6 :\
  380. ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream2))? DMA_FLAG_TCIF2_6 :\
  381. ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream6))? DMA_FLAG_TCIF2_6 :\
  382. ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream6))? DMA_FLAG_TCIF2_6 :\
  383. DMA_FLAG_TCIF3_7)
  384. /**
  385. * @brief Return the current DMA Stream half transfer complete flag.
  386. * @param __HANDLE__ DMA handle
  387. * @retval The specified half transfer complete flag index.
  388. */
  389. #define __HAL_DMA_GET_HT_FLAG_INDEX(__HANDLE__)\
  390. (((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream0))? DMA_FLAG_HTIF0_4 :\
  391. ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream0))? DMA_FLAG_HTIF0_4 :\
  392. ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream4))? DMA_FLAG_HTIF0_4 :\
  393. ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream4))? DMA_FLAG_HTIF0_4 :\
  394. ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream1))? DMA_FLAG_HTIF1_5 :\
  395. ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream1))? DMA_FLAG_HTIF1_5 :\
  396. ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream5))? DMA_FLAG_HTIF1_5 :\
  397. ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream5))? DMA_FLAG_HTIF1_5 :\
  398. ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream2))? DMA_FLAG_HTIF2_6 :\
  399. ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream2))? DMA_FLAG_HTIF2_6 :\
  400. ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream6))? DMA_FLAG_HTIF2_6 :\
  401. ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream6))? DMA_FLAG_HTIF2_6 :\
  402. DMA_FLAG_HTIF3_7)
  403. /**
  404. * @brief Return the current DMA Stream transfer error flag.
  405. * @param __HANDLE__ DMA handle
  406. * @retval The specified transfer error flag index.
  407. */
  408. #define __HAL_DMA_GET_TE_FLAG_INDEX(__HANDLE__)\
  409. (((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream0))? DMA_FLAG_TEIF0_4 :\
  410. ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream0))? DMA_FLAG_TEIF0_4 :\
  411. ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream4))? DMA_FLAG_TEIF0_4 :\
  412. ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream4))? DMA_FLAG_TEIF0_4 :\
  413. ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream1))? DMA_FLAG_TEIF1_5 :\
  414. ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream1))? DMA_FLAG_TEIF1_5 :\
  415. ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream5))? DMA_FLAG_TEIF1_5 :\
  416. ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream5))? DMA_FLAG_TEIF1_5 :\
  417. ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream2))? DMA_FLAG_TEIF2_6 :\
  418. ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream2))? DMA_FLAG_TEIF2_6 :\
  419. ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream6))? DMA_FLAG_TEIF2_6 :\
  420. ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream6))? DMA_FLAG_TEIF2_6 :\
  421. DMA_FLAG_TEIF3_7)
  422. /**
  423. * @brief Return the current DMA Stream FIFO error flag.
  424. * @param __HANDLE__ DMA handle
  425. * @retval The specified FIFO error flag index.
  426. */
  427. #define __HAL_DMA_GET_FE_FLAG_INDEX(__HANDLE__)\
  428. (((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream0))? DMA_FLAG_FEIF0_4 :\
  429. ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream0))? DMA_FLAG_FEIF0_4 :\
  430. ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream4))? DMA_FLAG_FEIF0_4 :\
  431. ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream4))? DMA_FLAG_FEIF0_4 :\
  432. ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream1))? DMA_FLAG_FEIF1_5 :\
  433. ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream1))? DMA_FLAG_FEIF1_5 :\
  434. ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream5))? DMA_FLAG_FEIF1_5 :\
  435. ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream5))? DMA_FLAG_FEIF1_5 :\
  436. ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream2))? DMA_FLAG_FEIF2_6 :\
  437. ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream2))? DMA_FLAG_FEIF2_6 :\
  438. ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream6))? DMA_FLAG_FEIF2_6 :\
  439. ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream6))? DMA_FLAG_FEIF2_6 :\
  440. DMA_FLAG_FEIF3_7)
  441. /**
  442. * @brief Return the current DMA Stream direct mode error flag.
  443. * @param __HANDLE__ DMA handle
  444. * @retval The specified direct mode error flag index.
  445. */
  446. #define __HAL_DMA_GET_DME_FLAG_INDEX(__HANDLE__)\
  447. (((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream0))? DMA_FLAG_DMEIF0_4 :\
  448. ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream0))? DMA_FLAG_DMEIF0_4 :\
  449. ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream4))? DMA_FLAG_DMEIF0_4 :\
  450. ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream4))? DMA_FLAG_DMEIF0_4 :\
  451. ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream1))? DMA_FLAG_DMEIF1_5 :\
  452. ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream1))? DMA_FLAG_DMEIF1_5 :\
  453. ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream5))? DMA_FLAG_DMEIF1_5 :\
  454. ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream5))? DMA_FLAG_DMEIF1_5 :\
  455. ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream2))? DMA_FLAG_DMEIF2_6 :\
  456. ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream2))? DMA_FLAG_DMEIF2_6 :\
  457. ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream6))? DMA_FLAG_DMEIF2_6 :\
  458. ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream6))? DMA_FLAG_DMEIF2_6 :\
  459. DMA_FLAG_DMEIF3_7)
  460. /**
  461. * @brief Get the DMA Stream pending flags.
  462. * @param __HANDLE__ DMA handle
  463. * @param __FLAG__ Get the specified flag.
  464. * This parameter can be any combination of the following values:
  465. * @arg DMA_FLAG_TCIFx: Transfer complete flag.
  466. * @arg DMA_FLAG_HTIFx: Half transfer complete flag.
  467. * @arg DMA_FLAG_TEIFx: Transfer error flag.
  468. * @arg DMA_FLAG_DMEIFx: Direct mode error flag.
  469. * @arg DMA_FLAG_FEIFx: FIFO error flag.
  470. * Where x can be 0_4, 1_5, 2_6 or 3_7 to select the DMA Stream flag.
  471. * @retval The state of FLAG (SET or RESET).
  472. */
  473. #define __HAL_DMA_GET_FLAG(__HANDLE__, __FLAG__)\
  474. (((uint32_t)((__HANDLE__)->Instance) > (uint32_t)DMA2_Stream3)? (DMA2->HISR & (__FLAG__)) :\
  475. ((uint32_t)((__HANDLE__)->Instance) > (uint32_t)DMA1_Stream7)? (DMA2->LISR & (__FLAG__)) :\
  476. ((uint32_t)((__HANDLE__)->Instance) > (uint32_t)DMA1_Stream3)? (DMA1->HISR & (__FLAG__)) : (DMA1->LISR & (__FLAG__)))
  477. /**
  478. * @brief Clear the DMA Stream pending flags.
  479. * @param __HANDLE__ DMA handle
  480. * @param __FLAG__ specifies the flag to clear.
  481. * This parameter can be any combination of the following values:
  482. * @arg DMA_FLAG_TCIFx: Transfer complete flag.
  483. * @arg DMA_FLAG_HTIFx: Half transfer complete flag.
  484. * @arg DMA_FLAG_TEIFx: Transfer error flag.
  485. * @arg DMA_FLAG_DMEIFx: Direct mode error flag.
  486. * @arg DMA_FLAG_FEIFx: FIFO error flag.
  487. * Where x can be 0_4, 1_5, 2_6 or 3_7 to select the DMA Stream flag.
  488. * @retval None
  489. */
  490. #define __HAL_DMA_CLEAR_FLAG(__HANDLE__, __FLAG__) \
  491. (((uint32_t)((__HANDLE__)->Instance) > (uint32_t)DMA2_Stream3)? (DMA2->HIFCR = (__FLAG__)) :\
  492. ((uint32_t)((__HANDLE__)->Instance) > (uint32_t)DMA1_Stream7)? (DMA2->LIFCR = (__FLAG__)) :\
  493. ((uint32_t)((__HANDLE__)->Instance) > (uint32_t)DMA1_Stream3)? (DMA1->HIFCR = (__FLAG__)) : (DMA1->LIFCR = (__FLAG__)))
  494. /**
  495. * @brief Enable the specified DMA Stream interrupts.
  496. * @param __HANDLE__ DMA handle
  497. * @param __INTERRUPT__ specifies the DMA interrupt sources to be enabled or disabled.
  498. * This parameter can be any combination of the following values:
  499. * @arg DMA_IT_TC: Transfer complete interrupt mask.
  500. * @arg DMA_IT_HT: Half transfer complete interrupt mask.
  501. * @arg DMA_IT_TE: Transfer error interrupt mask.
  502. * @arg DMA_IT_FE: FIFO error interrupt mask.
  503. * @arg DMA_IT_DME: Direct mode error interrupt.
  504. * @retval None
  505. */
  506. #define __HAL_DMA_ENABLE_IT(__HANDLE__, __INTERRUPT__) (((__INTERRUPT__) != DMA_IT_FE)? \
  507. ((__HANDLE__)->Instance->CR |= (__INTERRUPT__)) : ((__HANDLE__)->Instance->FCR |= (__INTERRUPT__)))
  508. /**
  509. * @brief Disable the specified DMA Stream interrupts.
  510. * @param __HANDLE__ DMA handle
  511. * @param __INTERRUPT__ specifies the DMA interrupt sources to be enabled or disabled.
  512. * This parameter can be any combination of the following values:
  513. * @arg DMA_IT_TC: Transfer complete interrupt mask.
  514. * @arg DMA_IT_HT: Half transfer complete interrupt mask.
  515. * @arg DMA_IT_TE: Transfer error interrupt mask.
  516. * @arg DMA_IT_FE: FIFO error interrupt mask.
  517. * @arg DMA_IT_DME: Direct mode error interrupt.
  518. * @retval None
  519. */
  520. #define __HAL_DMA_DISABLE_IT(__HANDLE__, __INTERRUPT__) (((__INTERRUPT__) != DMA_IT_FE)? \
  521. ((__HANDLE__)->Instance->CR &= ~(__INTERRUPT__)) : ((__HANDLE__)->Instance->FCR &= ~(__INTERRUPT__)))
  522. /**
  523. * @brief Check whether the specified DMA Stream interrupt is enabled or disabled.
  524. * @param __HANDLE__ DMA handle
  525. * @param __INTERRUPT__ specifies the DMA interrupt source to check.
  526. * This parameter can be one of the following values:
  527. * @arg DMA_IT_TC: Transfer complete interrupt mask.
  528. * @arg DMA_IT_HT: Half transfer complete interrupt mask.
  529. * @arg DMA_IT_TE: Transfer error interrupt mask.
  530. * @arg DMA_IT_FE: FIFO error interrupt mask.
  531. * @arg DMA_IT_DME: Direct mode error interrupt.
  532. * @retval The state of DMA_IT.
  533. */
  534. #define __HAL_DMA_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((__INTERRUPT__) != DMA_IT_FE)? \
  535. ((__HANDLE__)->Instance->CR & (__INTERRUPT__)) : \
  536. ((__HANDLE__)->Instance->FCR & (__INTERRUPT__)))
  537. /**
  538. * @brief Writes the number of data units to be transferred on the DMA Stream.
  539. * @param __HANDLE__ DMA handle
  540. * @param __COUNTER__ Number of data units to be transferred (from 0 to 65535)
  541. * Number of data items depends only on the Peripheral data format.
  542. *
  543. * @note If Peripheral data format is Bytes: number of data units is equal
  544. * to total number of bytes to be transferred.
  545. *
  546. * @note If Peripheral data format is Half-Word: number of data units is
  547. * equal to total number of bytes to be transferred / 2.
  548. *
  549. * @note If Peripheral data format is Word: number of data units is equal
  550. * to total number of bytes to be transferred / 4.
  551. *
  552. * @retval The number of remaining data units in the current DMAy Streamx transfer.
  553. */
  554. #define __HAL_DMA_SET_COUNTER(__HANDLE__, __COUNTER__) ((__HANDLE__)->Instance->NDTR = (uint16_t)(__COUNTER__))
  555. /**
  556. * @brief Returns the number of remaining data units in the current DMAy Streamx transfer.
  557. * @param __HANDLE__ DMA handle
  558. *
  559. * @retval The number of remaining data units in the current DMA Stream transfer.
  560. */
  561. #define __HAL_DMA_GET_COUNTER(__HANDLE__) ((__HANDLE__)->Instance->NDTR)
  562. /* Include DMA HAL Extension module */
  563. #include "stm32f4xx_hal_dma_ex.h"
  564. /* Exported functions --------------------------------------------------------*/
  565. /** @defgroup DMA_Exported_Functions DMA Exported Functions
  566. * @brief DMA Exported functions
  567. * @{
  568. */
  569. /** @defgroup DMA_Exported_Functions_Group1 Initialization and de-initialization functions
  570. * @brief Initialization and de-initialization functions
  571. * @{
  572. */
  573. HAL_StatusTypeDef HAL_DMA_Init(DMA_HandleTypeDef *hdma);
  574. HAL_StatusTypeDef HAL_DMA_DeInit(DMA_HandleTypeDef *hdma);
  575. /**
  576. * @}
  577. */
  578. /** @defgroup DMA_Exported_Functions_Group2 I/O operation functions
  579. * @brief I/O operation functions
  580. * @{
  581. */
  582. HAL_StatusTypeDef HAL_DMA_Start (DMA_HandleTypeDef *hdma, uint32_t SrcAddress, uint32_t DstAddress, uint32_t DataLength);
  583. HAL_StatusTypeDef HAL_DMA_Start_IT(DMA_HandleTypeDef *hdma, uint32_t SrcAddress, uint32_t DstAddress, uint32_t DataLength);
  584. HAL_StatusTypeDef HAL_DMA_Abort(DMA_HandleTypeDef *hdma);
  585. HAL_StatusTypeDef HAL_DMA_Abort_IT(DMA_HandleTypeDef *hdma);
  586. HAL_StatusTypeDef HAL_DMA_PollForTransfer(DMA_HandleTypeDef *hdma, HAL_DMA_LevelCompleteTypeDef CompleteLevel, uint32_t Timeout);
  587. void HAL_DMA_IRQHandler(DMA_HandleTypeDef *hdma);
  588. HAL_StatusTypeDef HAL_DMA_CleanCallbacks(DMA_HandleTypeDef *hdma);
  589. HAL_StatusTypeDef HAL_DMA_RegisterCallback(DMA_HandleTypeDef *hdma, HAL_DMA_CallbackIDTypeDef CallbackID, void (* pCallback)(DMA_HandleTypeDef *_hdma));
  590. HAL_StatusTypeDef HAL_DMA_UnRegisterCallback(DMA_HandleTypeDef *hdma, HAL_DMA_CallbackIDTypeDef CallbackID);
  591. /**
  592. * @}
  593. */
  594. /** @defgroup DMA_Exported_Functions_Group3 Peripheral State functions
  595. * @brief Peripheral State functions
  596. * @{
  597. */
  598. HAL_DMA_StateTypeDef HAL_DMA_GetState(DMA_HandleTypeDef *hdma);
  599. uint32_t HAL_DMA_GetError(DMA_HandleTypeDef *hdma);
  600. /**
  601. * @}
  602. */
  603. /**
  604. * @}
  605. */
  606. /* Private Constants -------------------------------------------------------------*/
  607. /** @defgroup DMA_Private_Constants DMA Private Constants
  608. * @brief DMA private defines and constants
  609. * @{
  610. */
  611. /**
  612. * @}
  613. */
  614. /* Private macros ------------------------------------------------------------*/
  615. /** @defgroup DMA_Private_Macros DMA Private Macros
  616. * @brief DMA private macros
  617. * @{
  618. */
  619. #if defined (DMA_SxCR_CHSEL_3)
  620. #define IS_DMA_CHANNEL(CHANNEL) (((CHANNEL) == DMA_CHANNEL_0) || \
  621. ((CHANNEL) == DMA_CHANNEL_1) || \
  622. ((CHANNEL) == DMA_CHANNEL_2) || \
  623. ((CHANNEL) == DMA_CHANNEL_3) || \
  624. ((CHANNEL) == DMA_CHANNEL_4) || \
  625. ((CHANNEL) == DMA_CHANNEL_5) || \
  626. ((CHANNEL) == DMA_CHANNEL_6) || \
  627. ((CHANNEL) == DMA_CHANNEL_7) || \
  628. ((CHANNEL) == DMA_CHANNEL_8) || \
  629. ((CHANNEL) == DMA_CHANNEL_9) || \
  630. ((CHANNEL) == DMA_CHANNEL_10)|| \
  631. ((CHANNEL) == DMA_CHANNEL_11)|| \
  632. ((CHANNEL) == DMA_CHANNEL_12)|| \
  633. ((CHANNEL) == DMA_CHANNEL_13)|| \
  634. ((CHANNEL) == DMA_CHANNEL_14)|| \
  635. ((CHANNEL) == DMA_CHANNEL_15))
  636. #else
  637. #define IS_DMA_CHANNEL(CHANNEL) (((CHANNEL) == DMA_CHANNEL_0) || \
  638. ((CHANNEL) == DMA_CHANNEL_1) || \
  639. ((CHANNEL) == DMA_CHANNEL_2) || \
  640. ((CHANNEL) == DMA_CHANNEL_3) || \
  641. ((CHANNEL) == DMA_CHANNEL_4) || \
  642. ((CHANNEL) == DMA_CHANNEL_5) || \
  643. ((CHANNEL) == DMA_CHANNEL_6) || \
  644. ((CHANNEL) == DMA_CHANNEL_7))
  645. #endif /* DMA_SxCR_CHSEL_3 */
  646. #define IS_DMA_DIRECTION(DIRECTION) (((DIRECTION) == DMA_PERIPH_TO_MEMORY ) || \
  647. ((DIRECTION) == DMA_MEMORY_TO_PERIPH) || \
  648. ((DIRECTION) == DMA_MEMORY_TO_MEMORY))
  649. #define IS_DMA_BUFFER_SIZE(SIZE) (((SIZE) >= 0x01U) && ((SIZE) < 0x10000U))
  650. #define IS_DMA_PERIPHERAL_INC_STATE(STATE) (((STATE) == DMA_PINC_ENABLE) || \
  651. ((STATE) == DMA_PINC_DISABLE))
  652. #define IS_DMA_MEMORY_INC_STATE(STATE) (((STATE) == DMA_MINC_ENABLE) || \
  653. ((STATE) == DMA_MINC_DISABLE))
  654. #define IS_DMA_PERIPHERAL_DATA_SIZE(SIZE) (((SIZE) == DMA_PDATAALIGN_BYTE) || \
  655. ((SIZE) == DMA_PDATAALIGN_HALFWORD) || \
  656. ((SIZE) == DMA_PDATAALIGN_WORD))
  657. #define IS_DMA_MEMORY_DATA_SIZE(SIZE) (((SIZE) == DMA_MDATAALIGN_BYTE) || \
  658. ((SIZE) == DMA_MDATAALIGN_HALFWORD) || \
  659. ((SIZE) == DMA_MDATAALIGN_WORD ))
  660. #define IS_DMA_MODE(MODE) (((MODE) == DMA_NORMAL ) || \
  661. ((MODE) == DMA_CIRCULAR) || \
  662. ((MODE) == DMA_PFCTRL))
  663. #define IS_DMA_PRIORITY(PRIORITY) (((PRIORITY) == DMA_PRIORITY_LOW ) || \
  664. ((PRIORITY) == DMA_PRIORITY_MEDIUM) || \
  665. ((PRIORITY) == DMA_PRIORITY_HIGH) || \
  666. ((PRIORITY) == DMA_PRIORITY_VERY_HIGH))
  667. #define IS_DMA_FIFO_MODE_STATE(STATE) (((STATE) == DMA_FIFOMODE_DISABLE ) || \
  668. ((STATE) == DMA_FIFOMODE_ENABLE))
  669. #define IS_DMA_FIFO_THRESHOLD(THRESHOLD) (((THRESHOLD) == DMA_FIFO_THRESHOLD_1QUARTERFULL ) || \
  670. ((THRESHOLD) == DMA_FIFO_THRESHOLD_HALFFULL) || \
  671. ((THRESHOLD) == DMA_FIFO_THRESHOLD_3QUARTERSFULL) || \
  672. ((THRESHOLD) == DMA_FIFO_THRESHOLD_FULL))
  673. #define IS_DMA_MEMORY_BURST(BURST) (((BURST) == DMA_MBURST_SINGLE) || \
  674. ((BURST) == DMA_MBURST_INC4) || \
  675. ((BURST) == DMA_MBURST_INC8) || \
  676. ((BURST) == DMA_MBURST_INC16))
  677. #define IS_DMA_PERIPHERAL_BURST(BURST) (((BURST) == DMA_PBURST_SINGLE) || \
  678. ((BURST) == DMA_PBURST_INC4) || \
  679. ((BURST) == DMA_PBURST_INC8) || \
  680. ((BURST) == DMA_PBURST_INC16))
  681. /**
  682. * @}
  683. */
  684. /* Private functions ---------------------------------------------------------*/
  685. /** @defgroup DMA_Private_Functions DMA Private Functions
  686. * @brief DMA private functions
  687. * @{
  688. */
  689. /**
  690. * @}
  691. */
  692. /**
  693. * @}
  694. */
  695. /**
  696. * @}
  697. */
  698. #ifdef __cplusplus
  699. }
  700. #endif
  701. #endif /* __STM32F4xx_HAL_DMA_H */
  702. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/