stm32f0xx_dma.h 55 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805
  1. /**
  2. ******************************************************************************
  3. * @file stm32f0xx_dma.h
  4. * @author MCD Application Team
  5. * @version V1.5.0
  6. * @date 05-December-2014
  7. * @brief This file contains all the functions prototypes for the DMA firmware
  8. * library.
  9. ******************************************************************************
  10. * @attention
  11. *
  12. * <h2><center>&copy; COPYRIGHT 2014 STMicroelectronics</center></h2>
  13. *
  14. * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
  15. * You may not use this file except in compliance with the License.
  16. * You may obtain a copy of the License at:
  17. *
  18. * http://www.st.com/software_license_agreement_liberty_v2
  19. *
  20. * Unless required by applicable law or agreed to in writing, software
  21. * distributed under the License is distributed on an "AS IS" BASIS,
  22. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  23. * See the License for the specific language governing permissions and
  24. * limitations under the License.
  25. *
  26. ******************************************************************************
  27. */
  28. /* Define to prevent recursive inclusion -------------------------------------*/
  29. #ifndef __STM32F0XX_DMA_H
  30. #define __STM32F0XX_DMA_H
  31. #ifdef __cplusplus
  32. extern "C" {
  33. #endif
  34. /* Includes ------------------------------------------------------------------*/
  35. #include "stm32f0xx.h"
  36. /** @addtogroup STM32F0xx_StdPeriph_Driver
  37. * @{
  38. */
  39. /** @addtogroup DMA
  40. * @{
  41. */
  42. /* Exported types ------------------------------------------------------------*/
  43. /**
  44. * @brief DMA Init structures definition
  45. */
  46. typedef struct
  47. {
  48. uint32_t DMA_PeripheralBaseAddr; /*!< Specifies the peripheral base address for DMAy Channelx. */
  49. uint32_t DMA_MemoryBaseAddr; /*!< Specifies the memory base address for DMAy Channelx. */
  50. uint32_t DMA_DIR; /*!< Specifies if the peripheral is the source or destination.
  51. This parameter can be a value of @ref DMA_data_transfer_direction */
  52. uint32_t DMA_BufferSize; /*!< Specifies the buffer size, in data unit, of the specified Channel.
  53. The data unit is equal to the configuration set in DMA_PeripheralDataSize
  54. or DMA_MemoryDataSize members depending in the transfer direction */
  55. uint32_t DMA_PeripheralInc; /*!< Specifies whether the Peripheral address register is incremented or not.
  56. This parameter can be a value of @ref DMA_peripheral_incremented_mode */
  57. uint32_t DMA_MemoryInc; /*!< Specifies whether the memory address register is incremented or not.
  58. This parameter can be a value of @ref DMA_memory_incremented_mode */
  59. uint32_t DMA_PeripheralDataSize; /*!< Specifies the Peripheral data width.
  60. This parameter can be a value of @ref DMA_peripheral_data_size */
  61. uint32_t DMA_MemoryDataSize; /*!< Specifies the Memory data width.
  62. This parameter can be a value of @ref DMA_memory_data_size */
  63. uint32_t DMA_Mode; /*!< Specifies the operation mode of the DMAy Channelx.
  64. This parameter can be a value of @ref DMA_circular_normal_mode
  65. @note: The circular buffer mode cannot be used if the memory-to-memory
  66. data transfer is configured on the selected Channel */
  67. uint32_t DMA_Priority; /*!< Specifies the software priority for the DMAy Channelx.
  68. This parameter can be a value of @ref DMA_priority_level */
  69. uint32_t DMA_M2M; /*!< Specifies if the DMAy Channelx will be used in memory-to-memory transfer.
  70. This parameter can be a value of @ref DMA_memory_to_memory */
  71. }DMA_InitTypeDef;
  72. /* Exported constants --------------------------------------------------------*/
  73. /** @defgroup DMA_Exported_Constants
  74. * @{
  75. */
  76. #define IS_DMA_ALL_PERIPH(PERIPH) (((PERIPH) == DMA1_Channel1) || \
  77. ((PERIPH) == DMA1_Channel2) || \
  78. ((PERIPH) == DMA1_Channel3) || \
  79. ((PERIPH) == DMA1_Channel4) || \
  80. ((PERIPH) == DMA1_Channel5) || \
  81. ((PERIPH) == DMA1_Channel6) || \
  82. ((PERIPH) == DMA1_Channel7) || \
  83. ((PERIPH) == DMA2_Channel1) || \
  84. ((PERIPH) == DMA2_Channel2) || \
  85. ((PERIPH) == DMA2_Channel3) || \
  86. ((PERIPH) == DMA2_Channel4) || \
  87. ((PERIPH) == DMA2_Channel5))
  88. /** @defgroup DMA_data_transfer_direction
  89. * @{
  90. */
  91. #define DMA_DIR_PeripheralSRC ((uint32_t)0x00000000)
  92. #define DMA_DIR_PeripheralDST DMA_CCR_DIR
  93. #define IS_DMA_DIR(DIR) (((DIR) == DMA_DIR_PeripheralSRC) || \
  94. ((DIR) == DMA_DIR_PeripheralDST))
  95. /**
  96. * @}
  97. */
  98. /** @defgroup DMA_peripheral_incremented_mode
  99. * @{
  100. */
  101. #define DMA_PeripheralInc_Disable ((uint32_t)0x00000000)
  102. #define DMA_PeripheralInc_Enable DMA_CCR_PINC
  103. #define IS_DMA_PERIPHERAL_INC_STATE(STATE) (((STATE) == DMA_PeripheralInc_Disable) || \
  104. ((STATE) == DMA_PeripheralInc_Enable))
  105. /**
  106. * @}
  107. */
  108. /** @defgroup DMA_memory_incremented_mode
  109. * @{
  110. */
  111. #define DMA_MemoryInc_Disable ((uint32_t)0x00000000)
  112. #define DMA_MemoryInc_Enable DMA_CCR_MINC
  113. #define IS_DMA_MEMORY_INC_STATE(STATE) (((STATE) == DMA_MemoryInc_Disable) || \
  114. ((STATE) == DMA_MemoryInc_Enable))
  115. /**
  116. * @}
  117. */
  118. /** @defgroup DMA_peripheral_data_size
  119. * @{
  120. */
  121. #define DMA_PeripheralDataSize_Byte ((uint32_t)0x00000000)
  122. #define DMA_PeripheralDataSize_HalfWord DMA_CCR_PSIZE_0
  123. #define DMA_PeripheralDataSize_Word DMA_CCR_PSIZE_1
  124. #define IS_DMA_PERIPHERAL_DATA_SIZE(SIZE) (((SIZE) == DMA_PeripheralDataSize_Byte) || \
  125. ((SIZE) == DMA_PeripheralDataSize_HalfWord) || \
  126. ((SIZE) == DMA_PeripheralDataSize_Word))
  127. /**
  128. * @}
  129. */
  130. /** @defgroup DMA_memory_data_size
  131. * @{
  132. */
  133. #define DMA_MemoryDataSize_Byte ((uint32_t)0x00000000)
  134. #define DMA_MemoryDataSize_HalfWord DMA_CCR_MSIZE_0
  135. #define DMA_MemoryDataSize_Word DMA_CCR_MSIZE_1
  136. #define IS_DMA_MEMORY_DATA_SIZE(SIZE) (((SIZE) == DMA_MemoryDataSize_Byte) || \
  137. ((SIZE) == DMA_MemoryDataSize_HalfWord) || \
  138. ((SIZE) == DMA_MemoryDataSize_Word))
  139. /**
  140. * @}
  141. */
  142. /** @defgroup DMA_circular_normal_mode
  143. * @{
  144. */
  145. #define DMA_Mode_Normal ((uint32_t)0x00000000)
  146. #define DMA_Mode_Circular DMA_CCR_CIRC
  147. #define IS_DMA_MODE(MODE) (((MODE) == DMA_Mode_Normal) || ((MODE) == DMA_Mode_Circular))
  148. /**
  149. * @}
  150. */
  151. /** @defgroup DMA_priority_level
  152. * @{
  153. */
  154. #define DMA_Priority_VeryHigh DMA_CCR_PL
  155. #define DMA_Priority_High DMA_CCR_PL_1
  156. #define DMA_Priority_Medium DMA_CCR_PL_0
  157. #define DMA_Priority_Low ((uint32_t)0x00000000)
  158. #define IS_DMA_PRIORITY(PRIORITY) (((PRIORITY) == DMA_Priority_VeryHigh) || \
  159. ((PRIORITY) == DMA_Priority_High) || \
  160. ((PRIORITY) == DMA_Priority_Medium) || \
  161. ((PRIORITY) == DMA_Priority_Low))
  162. /**
  163. * @}
  164. */
  165. /** @defgroup DMA_memory_to_memory
  166. * @{
  167. */
  168. #define DMA_M2M_Disable ((uint32_t)0x00000000)
  169. #define DMA_M2M_Enable DMA_CCR_MEM2MEM
  170. #define IS_DMA_M2M_STATE(STATE) (((STATE) == DMA_M2M_Disable) || ((STATE) == DMA_M2M_Enable))
  171. /**
  172. * @}
  173. */
  174. /** @defgroup DMA_Remap_Config
  175. * @{
  176. */
  177. #define DMAx_CHANNEL1_RMP 0x00000000
  178. #define DMAx_CHANNEL2_RMP 0x10000000
  179. #define DMAx_CHANNEL3_RMP 0x20000000
  180. #define DMAx_CHANNEL4_RMP 0x30000000
  181. #define DMAx_CHANNEL5_RMP 0x40000000
  182. #define DMAx_CHANNEL6_RMP 0x50000000
  183. #define DMAx_CHANNEL7_RMP 0x60000000
  184. #define IS_DMA_ALL_LIST(LIST) (((LIST) == DMA1) || \
  185. ((LIST) == DMA2))
  186. /****************** DMA1 remap bit field definition********************/
  187. /* DMA1 - Channel 1 */
  188. #define DMA1_CH1_DEFAULT (uint32_t) (DMAx_CHANNEL1_RMP | DMA_RMPCR1_DEFAULT) /*!< Default remap position for DMA1 */
  189. #define DMA1_CH1_ADC (uint32_t) (DMAx_CHANNEL1_RMP | DMA_RMPCR1_CH1_ADC) /*!< Remap ADC on DMA1 Channel 1*/
  190. #define DMA1_CH1_TIM17_CH1 (uint32_t) (DMAx_CHANNEL1_RMP | DMA_RMPCR1_CH1_TIM17_CH1) /*!< Remap TIM17 channel 1 on DMA1 channel 1 */
  191. #define DMA1_CH1_TIM17_UP (uint32_t) (DMAx_CHANNEL1_RMP | DMA_RMPCR1_CH1_TIM17_UP) /*!< Remap TIM17 up on DMA1 channel 1 */
  192. #define DMA1_CH1_USART1_RX (uint32_t) (DMAx_CHANNEL1_RMP | DMA_RMPCR1_CH1_USART1_RX) /*!< Remap USART1 Rx on DMA1 channel 1 */
  193. #define DMA1_CH1_USART2_RX (uint32_t) (DMAx_CHANNEL1_RMP | DMA_RMPCR1_CH1_USART2_RX) /*!< Remap USART2 Rx on DMA1 channel 1 */
  194. #define DMA1_CH1_USART3_RX (uint32_t) (DMAx_CHANNEL1_RMP | DMA_RMPCR1_CH1_USART3_RX) /*!< Remap USART3 Rx on DMA1 channel 1 */
  195. #define DMA1_CH1_USART4_RX (uint32_t) (DMAx_CHANNEL1_RMP | DMA_RMPCR1_CH1_USART4_RX) /*!< Remap USART4 Rx on DMA1 channel 1 */
  196. #define DMA1_CH1_USART5_RX (uint32_t) (DMAx_CHANNEL1_RMP | DMA_RMPCR1_CH1_USART5_RX) /*!< Remap USART5 Rx on DMA1 channel 1 */
  197. #define DMA1_CH1_USART6_RX (uint32_t) (DMAx_CHANNEL1_RMP | DMA_RMPCR1_CH1_USART6_RX) /*!< Remap USART6 Rx on DMA1 channel 1 */
  198. #define DMA1_CH1_USART7_RX (uint32_t) (DMAx_CHANNEL1_RMP | DMA_RMPCR1_CH1_USART7_RX) /*!< Remap USART7 Rx on DMA1 channel 1 */
  199. #define DMA1_CH1_USART8_RX (uint32_t) (DMAx_CHANNEL1_RMP | DMA_RMPCR1_CH1_USART8_RX) /*!< Remap USART8 Rx on DMA1 channel 1 */
  200. /* DMA1 - Channel 2 */
  201. #define DMA1_CH2_DEFAULT (uint32_t) (DMAx_CHANNEL2_RMP | DMA_RMPCR1_DEFAULT) /*!< Default remap position for DMA1 */
  202. #define DMA1_CH2_ADC (uint32_t) (DMAx_CHANNEL2_RMP | DMA_RMPCR1_CH2_ADC) /*!< Remap ADC on DMA1 channel 2 */
  203. #define DMA1_CH2_I2C1_TX (uint32_t) (DMAx_CHANNEL2_RMP | DMA_RMPCR1_CH2_I2C1_TX) /*!< Remap I2C1 Tx on DMA1 channel 2 */
  204. #define DMA1_CH2_SPI1_RX (uint32_t) (DMAx_CHANNEL2_RMP | DMA_RMPCR1_CH2_SPI_1RX) /*!< Remap SPI1 Rx on DMA1 channel 2 */
  205. #define DMA1_CH2_TIM1_CH1 (uint32_t) (DMAx_CHANNEL2_RMP | DMA_RMPCR1_CH2_TIM1_CH1) /*!< Remap TIM1 channel 1 on DMA1 channel 2 */
  206. #define DMA1_CH2_TIM17_CH1 (uint32_t) (DMAx_CHANNEL2_RMP | DMA_RMPCR1_CH2_TIM17_CH1) /*!< Remap TIM17 channel 1 on DMA1 channel 2 */
  207. #define DMA1_CH2_TIM17_UP (uint32_t) (DMAx_CHANNEL2_RMP | DMA_RMPCR1_CH2_TIM17_UP) /*!< Remap TIM17 up on DMA1 channel 2 */
  208. #define DMA1_CH2_USART1_TX (uint32_t) (DMAx_CHANNEL2_RMP | DMA_RMPCR1_CH2_USART1_TX) /*!< Remap USART1 Tx on DMA1 channel 2 */
  209. #define DMA1_CH2_USART2_TX (uint32_t) (DMAx_CHANNEL2_RMP | DMA_RMPCR1_CH2_USART2_TX) /*!< Remap USART2 Tx on DMA1 channel 2 */
  210. #define DMA1_CH2_USART3_TX (uint32_t) (DMAx_CHANNEL2_RMP | DMA_RMPCR1_CH2_USART3_TX) /*!< Remap USART3 Tx on DMA1 channel 2 */
  211. #define DMA1_CH2_USART4_TX (uint32_t) (DMAx_CHANNEL2_RMP | DMA_RMPCR1_CH2_USART4_TX) /*!< Remap USART4 Tx on DMA1 channel 2 */
  212. #define DMA1_CH2_USART5_TX (uint32_t) (DMAx_CHANNEL2_RMP | DMA_RMPCR1_CH2_USART5_TX) /*!< Remap USART5 Tx on DMA1 channel 2 */
  213. #define DMA1_CH2_USART6_TX (uint32_t) (DMAx_CHANNEL2_RMP | DMA_RMPCR1_CH2_USART6_TX) /*!< Remap USART6 Tx on DMA1 channel 2 */
  214. #define DMA1_CH2_USART7_TX (uint32_t) (DMAx_CHANNEL2_RMP | DMA_RMPCR1_CH2_USART7_TX) /*!< Remap USART7 Tx on DMA1 channel 2 */
  215. #define DMA1_CH2_USART8_TX (uint32_t) (DMAx_CHANNEL2_RMP | DMA_RMPCR1_CH2_USART8_TX) /*!< Remap USART8 Tx on DMA1 channel 2 */
  216. /* DMA1 - Channel 3 */
  217. #define DMA1_CH3_DEFAULT (uint32_t) (DMAx_CHANNEL3_RMP | DMA_RMPCR1_DEFAULT) /*!< Default remap position for DMAx */
  218. #define DMA1_CH3_TIM6_UP (uint32_t) (DMAx_CHANNEL3_RMP | DMA_RMPCR1_CH3_TIM6_UP) /*!< Remap TIM6 up on DMA1 channel 3 */
  219. #define DMA1_CH3_DAC_CH1 (uint32_t) (DMAx_CHANNEL3_RMP | DMA_RMPCR1_CH3_DAC_CH1) /*!< Remap DAC Channel 1on DMA1 channel 3 */
  220. #define DMA1_CH3_I2C1_RX (uint32_t) (DMAx_CHANNEL3_RMP | DMA_RMPCR1_CH3_I2C1_RX) /*!< Remap I2C1 Rx on DMA1 channel 3 */
  221. #define DMA1_CH3_SPI1_TX (uint32_t) (DMAx_CHANNEL3_RMP | DMA_RMPCR1_CH3_SPI1_TX) /*!< Remap SPI1 Tx on DMA1 channel 3 */
  222. #define DMA1_CH3_TIM1_CH2 (uint32_t) (DMAx_CHANNEL3_RMP | DMA_RMPCR1_CH3_TIM1_CH2) /*!< Remap TIM1 channel 2 on DMA1 channel 3 */
  223. #define DMA1_CH3_TIM2_CH2 (uint32_t) (DMAx_CHANNEL3_RMP | DMA_RMPCR1_CH3_TIM2_CH2) /*!< Remap TIM2 channel 2 on DMA1 channel 3 */
  224. #define DMA1_CH3_TIM16_CH1 (uint32_t) (DMAx_CHANNEL3_RMP | DMA_RMPCR1_CH3_TIM16_CH1) /*!< Remap TIM16 channel 1 on DMA1 channel 3 */
  225. #define DMA1_CH3_TIM16_UP (uint32_t) (DMAx_CHANNEL3_RMP | DMA_RMPCR1_CH3_TIM16_UP) /*!< Remap TIM16 up on DMA1 channel 3 */
  226. #define DMA1_CH3_USART1_RX (uint32_t) (DMAx_CHANNEL3_RMP | DMA_RMPCR1_CH3_USART1_RX) /*!< Remap USART1 Rx on DMA1 channel 3 */
  227. #define DMA1_CH3_USART2_RX (uint32_t) (DMAx_CHANNEL3_RMP | DMA_RMPCR1_CH3_USART2_RX) /*!< Remap USART2 Rx on DMA1 channel 3 */
  228. #define DMA1_CH3_USART3_RX (uint32_t) (DMAx_CHANNEL3_RMP | DMA_RMPCR1_CH3_USART3_RX) /*!< Remap USART3 Rx on DMA1 channel 3 */
  229. #define DMA1_CH3_USART4_RX (uint32_t) (DMAx_CHANNEL3_RMP | DMA_RMPCR1_CH3_USART4_RX) /*!< Remap USART4 Rx on DMA1 channel 3 */
  230. #define DMA1_CH3_USART5_RX (uint32_t) (DMAx_CHANNEL3_RMP | DMA_RMPCR1_CH3_USART5_RX) /*!< Remap USART5 Rx on DMA1 channel 3 */
  231. #define DMA1_CH3_USART6_RX (uint32_t) (DMAx_CHANNEL3_RMP | DMA_RMPCR1_CH3_USART6_RX) /*!< Remap USART6 Rx on DMA1 channel 3 */
  232. #define DMA1_CH3_USART7_RX (uint32_t) (DMAx_CHANNEL3_RMP | DMA_RMPCR1_CH3_USART7_RX) /*!< Remap USART7 Rx on DMA1 channel 3 */
  233. #define DMA1_CH3_USART8_RX (uint32_t) (DMAx_CHANNEL3_RMP | DMA_RMPCR1_CH3_USART8_RX) /*!< Remap USART8 Rx on DMA1 channel 3 */
  234. /* DMA1 - Channel 4 */
  235. #define DMA1_CH4_DEFAULT (uint32_t) (DMAx_CHANNEL4_RMP | DMA_RMPCR1_DEFAULT) /*!< Default remap position for DMA1 */
  236. #define DMA1_CH4_TIM7_UP (uint32_t) (DMAx_CHANNEL4_RMP | DMA_RMPCR1_CH4_TIM7_UP) /*!< Remap TIM7 up on DMA1 channel 4 */
  237. #define DMA1_CH4_DAC_CH2 (uint32_t) (DMAx_CHANNEL4_RMP | DMA_RMPCR1_CH4_DAC_CH2) /*!< Remap DAC Channel 2 on DMA1 channel 4 */
  238. #define DMA1_CH4_I2C2_TX (uint32_t) (DMAx_CHANNEL4_RMP | DMA_RMPCR1_CH4_I2C2_TX) /*!< Remap I2C2 Tx on DMA1 channel 4 */
  239. #define DMA1_CH4_SPI2_RX (uint32_t) (DMAx_CHANNEL4_RMP | DMA_RMPCR1_CH4_SPI2_RX) /*!< Remap SPI2 Rx on DMA1 channel 4 */
  240. #define DMA1_CH4_TIM2_CH4 (uint32_t) (DMAx_CHANNEL4_RMP | DMA_RMPCR1_CH4_TIM2_CH4) /*!< Remap TIM2 channel 4 on DMA1 channel 4 */
  241. #define DMA1_CH4_TIM3_CH1 (uint32_t) (DMAx_CHANNEL4_RMP | DMA_RMPCR1_CH4_TIM3_CH1) /*!< Remap TIM3 channel 1 on DMA1 channel 4 */
  242. #define DMA1_CH4_TIM3_TRIG (uint32_t) (DMAx_CHANNEL4_RMP | DMA_RMPCR1_CH4_TIM3_TRIG) /*!< Remap TIM3 Trig on DMA1 channel 4 */
  243. #define DMA1_CH4_TIM16_CH1 (uint32_t) (DMAx_CHANNEL4_RMP | DMA_RMPCR1_CH4_TIM16_CH1) /*!< Remap TIM16 channel 1 on DMA1 channel 4 */
  244. #define DMA1_CH4_TIM16_UP (uint32_t) (DMAx_CHANNEL4_RMP | DMA_RMPCR1_CH4_TIM16_UP) /*!< Remap TIM16 up on DMA1 channel 4 */
  245. #define DMA1_CH4_USART1_TX (uint32_t) (DMAx_CHANNEL4_RMP | DMA_RMPCR1_CH4_USART1_TX) /*!< Remap USART1 Tx on DMA1 channel 4 */
  246. #define DMA1_CH4_USART2_TX (uint32_t) (DMAx_CHANNEL4_RMP | DMA_RMPCR1_CH4_USART2_TX) /*!< Remap USART2 Tx on DMA1 channel 4 */
  247. #define DMA1_CH4_USART3_TX (uint32_t) (DMAx_CHANNEL4_RMP | DMA_RMPCR1_CH4_USART3_TX) /*!< Remap USART3 Tx on DMA1 channel 4 */
  248. #define DMA1_CH4_USART4_TX (uint32_t) (DMAx_CHANNEL4_RMP | DMA_RMPCR1_CH4_USART4_TX) /*!< Remap USART4 Tx on DMA1 channel 4 */
  249. #define DMA1_CH4_USART5_TX (uint32_t) (DMAx_CHANNEL4_RMP | DMA_RMPCR1_CH4_USART5_TX) /*!< Remap USART5 Tx on DMA1 channel 4 */
  250. #define DMA1_CH4_USART6_TX (uint32_t) (DMAx_CHANNEL4_RMP | DMA_RMPCR1_CH4_USART6_TX) /*!< Remap USART6 Tx on DMA1 channel 4 */
  251. #define DMA1_CH4_USART7_TX (uint32_t) (DMAx_CHANNEL4_RMP | DMA_RMPCR1_CH4_USART7_TX) /*!< Remap USART7 Tx on DMA1 channel 4 */
  252. #define DMA1_CH4_USART8_TX (uint32_t) (DMAx_CHANNEL4_RMP | DMA_RMPCR1_CH4_USART8_TX) /*!< Remap USART8 Tx on DMA1 channel 4 */
  253. /* DMA1 - Channel 5 */
  254. #define DMA1_CH5_DEFAULT (uint32_t) (DMAx_CHANNEL5_RMP | DMA_RMPCR1_DEFAULT) /*!< Default remap position for DMA1 */
  255. #define DMA1_CH5_I2C2_RX (uint32_t) (DMAx_CHANNEL5_RMP | DMA_RMPCR1_CH5_I2C2_RX) /*!< Remap I2C2 Rx on DMA1 channel 5 */
  256. #define DMA1_CH5_SPI2_TX (uint32_t) (DMAx_CHANNEL5_RMP | DMA_RMPCR1_CH5_SPI2_TX) /*!< Remap SPI1 Tx on DMA1 channel 5 */
  257. #define DMA1_CH5_TIM1_CH3 (uint32_t) (DMAx_CHANNEL5_RMP | DMA_RMPCR1_CH5_TIM1_CH3) /*!< Remap TIM1 channel 3 on DMA1 channel 5 */
  258. #define DMA1_CH5_USART1_RX (uint32_t) (DMAx_CHANNEL5_RMP | DMA_RMPCR1_CH5_USART1_RX) /*!< Remap USART1 Rx on DMA1 channel 5 */
  259. #define DMA1_CH5_USART2_RX (uint32_t) (DMAx_CHANNEL5_RMP | DMA_RMPCR1_CH5_USART2_RX) /*!< Remap USART2 Rx on DMA1 channel 5 */
  260. #define DMA1_CH5_USART3_RX (uint32_t) (DMAx_CHANNEL5_RMP | DMA_RMPCR1_CH5_USART3_RX) /*!< Remap USART3 Rx on DMA1 channel 5 */
  261. #define DMA1_CH5_USART4_RX (uint32_t) (DMAx_CHANNEL5_RMP | DMA_RMPCR1_CH5_USART4_RX) /*!< Remap USART4 Rx on DMA1 channel 5 */
  262. #define DMA1_CH5_USART5_RX (uint32_t) (DMAx_CHANNEL5_RMP | DMA_RMPCR1_CH5_USART5_RX) /*!< Remap USART5 Rx on DMA1 channel 5 */
  263. #define DMA1_CH5_USART6_RX (uint32_t) (DMAx_CHANNEL5_RMP | DMA_RMPCR1_CH5_USART6_RX) /*!< Remap USART6 Rx on DMA1 channel 5 */
  264. #define DMA1_CH5_USART7_RX (uint32_t) (DMAx_CHANNEL5_RMP | DMA_RMPCR1_CH5_USART7_RX) /*!< Remap USART7 Rx on DMA1 channel 5 */
  265. #define DMA1_CH5_USART8_RX (uint32_t) (DMAx_CHANNEL5_RMP | DMA_RMPCR1_CH5_USART8_RX) /*!< Remap USART8 Rx on DMA1 channel 5 */
  266. /* DMA1 - Channel 6 */
  267. #define DMA1_CH6_DEFAULT (uint32_t) (DMAx_CHANNEL6_RMP | DMA_RMPCR1_DEFAULT) /*!< Default remap position for DMA1 */
  268. #define DMA1_CH6_I2C1_TX (uint32_t) (DMAx_CHANNEL6_RMP | DMA_RMPCR1_CH6_I2C1_TX) /*!< Remap I2C1 Tx on DMA1 channel 6 */
  269. #define DMA1_CH6_SPI2_RX (uint32_t) (DMAx_CHANNEL6_RMP | DMA_RMPCR1_CH6_SPI2_RX) /*!< Remap SPI2 Rx on DMA1 channel 6 */
  270. #define DMA1_CH6_TIM1_CH1 (uint32_t) (DMAx_CHANNEL6_RMP | DMA_RMPCR1_CH6_TIM1_CH1) /*!< Remap TIM1 channel 1 on DMA1 channel 6 */
  271. #define DMA1_CH6_TIM1_CH2 (uint32_t) (DMAx_CHANNEL6_RMP | DMA_RMPCR1_CH6_TIM1_CH2) /*!< Remap TIM1 channel 2 on DMA1 channel 6 */
  272. #define DMA1_CH6_TIM1_CH3 (uint32_t) (DMAx_CHANNEL6_RMP | DMA_RMPCR1_CH6_TIM1_CH3) /*!< Remap TIM1 channel 3 on DMA1 channel 6 */
  273. #define DMA1_CH6_TIM3_CH1 (uint32_t) (DMAx_CHANNEL6_RMP | DMA_RMPCR1_CH6_TIM3_CH1) /*!< Remap TIM3 channel 1 on DMA1 channel 6 */
  274. #define DMA1_CH6_TIM3_TRIG (uint32_t) (DMAx_CHANNEL6_RMP | DMA_RMPCR1_CH6_TIM3_TRIG) /*!< Remap TIM3 Trig on DMA1 channel 6 */
  275. #define DMA1_CH6_TIM16_CH1 (uint32_t) (DMAx_CHANNEL6_RMP | DMA_RMPCR1_CH6_TIM16_CH1) /*!< Remap TIM16 channel 1 on DMA1 channel 6 */
  276. #define DMA1_CH6_TIM16_UP (uint32_t) (DMAx_CHANNEL6_RMP | DMA_RMPCR1_CH6_TIM16_UP) /*!< Remap TIM16 up on DMA1 channel 6 */
  277. #define DMA1_CH6_USART1_RX (uint32_t) (DMAx_CHANNEL6_RMP | DMA_RMPCR1_CH6_USART1_RX) /*!< Remap USART1 Rx on DMA1 channel 6 */
  278. #define DMA1_CH6_USART2_RX (uint32_t) (DMAx_CHANNEL6_RMP | DMA_RMPCR1_CH6_USART2_RX) /*!< Remap USART2 Rx on DMA1 channel 6 */
  279. #define DMA1_CH6_USART3_RX (uint32_t) (DMAx_CHANNEL6_RMP | DMA_RMPCR1_CH6_USART3_RX) /*!< Remap USART3 Rx on DMA1 channel 6 */
  280. #define DMA1_CH6_USART4_RX (uint32_t) (DMAx_CHANNEL6_RMP | DMA_RMPCR1_CH6_USART4_RX) /*!< Remap USART4 Rx on DMA1 channel 6 */
  281. #define DMA1_CH6_USART5_RX (uint32_t) (DMAx_CHANNEL6_RMP | DMA_RMPCR1_CH6_USART5_RX) /*!< Remap USART5 Rx on DMA1 channel 6 */
  282. #define DMA1_CH6_USART6_RX (uint32_t) (DMAx_CHANNEL6_RMP | DMA_RMPCR1_CH6_USART6_RX) /*!< Remap USART6 Rx on DMA1 channel 6 */
  283. #define DMA1_CH6_USART7_RX (uint32_t) (DMAx_CHANNEL6_RMP | DMA_RMPCR1_CH6_USART7_RX) /*!< Remap USART7 Rx on DMA1 channel 6 */
  284. #define DMA1_CH6_USART8_RX (uint32_t) (DMAx_CHANNEL6_RMP | DMA_RMPCR1_CH6_USART8_RX) /*!< Remap USART8 Rx on DMA1 channel 6 */
  285. /* DMA1 - Channel 7 */
  286. #define DMA1_CH7_DEFAULT (uint32_t) (DMAx_CHANNEL7_RMP | DMA_RMPCR1_DEFAULT) /*!< Default remap position for DMA1 */
  287. #define DMA1_CH7_I2C1_RX (uint32_t) (DMAx_CHANNEL7_RMP | DMA_RMPCR1_CH7_I2C1_RX) /*!< Remap I2C1 Rx on DMA1 channel 7 */
  288. #define DMA1_CH7_SPI2_TX (uint32_t) (DMAx_CHANNEL7_RMP | DMA_RMPCR1_CH7_SPI2_TX) /*!< Remap SPI2 Tx on DMA1 channel 7 */
  289. #define DMA1_CH7_TIM2_CH2 (uint32_t) (DMAx_CHANNEL7_RMP | DMA_RMPCR1_CH7_TIM2_CH2) /*!< Remap TIM2 channel 2 on DMA1 channel 7 */
  290. #define DMA1_CH7_TIM2_CH4 (uint32_t) (DMAx_CHANNEL7_RMP | DMA_RMPCR1_CH7_TIM2_CH4) /*!< Remap TIM2 channel 4 on DMA1 channel 7 */
  291. #define DMA1_CH7_TIM17_CH1 (uint32_t) (DMAx_CHANNEL7_RMP | DMA_RMPCR1_CH7_TIM17_CH1) /*!< Remap TIM17 channel 1 on DMA1 channel 7 */
  292. #define DMA1_CH7_TIM17_UP (uint32_t) (DMAx_CHANNEL7_RMP | DMA_RMPCR1_CH7_TIM17_UP) /*!< Remap TIM17 up on DMA1 channel 7 */
  293. #define DMA1_CH7_USART1_TX (uint32_t) (DMAx_CHANNEL7_RMP | DMA_RMPCR1_CH7_USART1_TX) /*!< Remap USART1 Tx on DMA1 channel 7 */
  294. #define DMA1_CH7_USART2_TX (uint32_t) (DMAx_CHANNEL7_RMP | DMA_RMPCR1_CH7_USART2_TX) /*!< Remap USART2 Tx on DMA1 channel 7 */
  295. #define DMA1_CH7_USART3_TX (uint32_t) (DMAx_CHANNEL7_RMP | DMA_RMPCR1_CH7_USART3_TX) /*!< Remap USART3 Tx on DMA1 channel 7 */
  296. #define DMA1_CH7_USART4_TX (uint32_t) (DMAx_CHANNEL7_RMP | DMA_RMPCR1_CH7_USART4_TX) /*!< Remap USART4 Tx on DMA1 channel 7 */
  297. #define DMA1_CH7_USART5_TX (uint32_t) (DMAx_CHANNEL7_RMP | DMA_RMPCR1_CH7_USART5_TX) /*!< Remap USART5 Tx on DMA1 channel 7 */
  298. #define DMA1_CH7_USART6_TX (uint32_t) (DMAx_CHANNEL7_RMP | DMA_RMPCR1_CH7_USART6_TX) /*!< Remap USART6 Tx on DMA1 channel 7 */
  299. #define DMA1_CH7_USART7_TX (uint32_t) (DMAx_CHANNEL7_RMP | DMA_RMPCR1_CH7_USART7_TX) /*!< Remap USART7 Tx on DMA1 channel 7 */
  300. #define DMA1_CH7_USART8_TX (uint32_t) (DMAx_CHANNEL7_RMP | DMA_RMPCR1_CH7_USART8_TX) /*!< Remap USART8 Tx on DMA1 channel 7 */
  301. #define IS_DMA1_REMAP(REMAP) ((REMAP == DMA1_CH1_DEFAULT) ||\
  302. (REMAP == DMA1_CH1_ADC) ||\
  303. (REMAP == DMA1_CH1_TIM17_CH1) ||\
  304. (REMAP == DMA1_CH1_TIM17_UP) ||\
  305. (REMAP == DMA1_CH1_USART1_RX) ||\
  306. (REMAP == DMA1_CH1_USART2_RX) ||\
  307. (REMAP == DMA1_CH1_USART3_RX) ||\
  308. (REMAP == DMA1_CH1_USART4_RX) ||\
  309. (REMAP == DMA1_CH1_USART5_RX) ||\
  310. (REMAP == DMA1_CH1_USART6_RX) ||\
  311. (REMAP == DMA1_CH1_USART7_RX) ||\
  312. (REMAP == DMA1_CH1_USART8_RX) ||\
  313. (REMAP == DMA1_CH2_DEFAULT) ||\
  314. (REMAP == DMA1_CH2_ADC) ||\
  315. (REMAP == DMA1_CH2_I2C1_TX) ||\
  316. (REMAP == DMA1_CH2_SPI1_RX) ||\
  317. (REMAP == DMA1_CH2_TIM1_CH1) ||\
  318. (REMAP == DMA1_CH2_I2C1_TX) ||\
  319. (REMAP == DMA1_CH2_TIM17_CH1) ||\
  320. (REMAP == DMA1_CH2_TIM17_UP) ||\
  321. (REMAP == DMA1_CH2_USART1_TX) ||\
  322. (REMAP == DMA1_CH2_USART2_TX) ||\
  323. (REMAP == DMA1_CH2_USART3_TX) ||\
  324. (REMAP == DMA1_CH2_USART4_TX) ||\
  325. (REMAP == DMA1_CH2_USART5_TX) ||\
  326. (REMAP == DMA1_CH2_USART6_TX) ||\
  327. (REMAP == DMA1_CH2_USART7_TX) ||\
  328. (REMAP == DMA1_CH2_USART8_TX) ||\
  329. (REMAP == DMA1_CH3_DEFAULT) ||\
  330. (REMAP == DMA1_CH3_TIM6_UP) ||\
  331. (REMAP == DMA1_CH3_DAC_CH1) ||\
  332. (REMAP == DMA1_CH3_I2C1_RX) ||\
  333. (REMAP == DMA1_CH3_SPI1_TX) ||\
  334. (REMAP == DMA1_CH3_TIM1_CH2) ||\
  335. (REMAP == DMA1_CH3_TIM2_CH2) ||\
  336. (REMAP == DMA1_CH3_TIM16_CH1) ||\
  337. (REMAP == DMA1_CH3_TIM16_UP) ||\
  338. (REMAP == DMA1_CH3_USART1_RX) ||\
  339. (REMAP == DMA1_CH3_USART2_RX) ||\
  340. (REMAP == DMA1_CH3_USART3_RX) ||\
  341. (REMAP == DMA1_CH3_USART4_RX) ||\
  342. (REMAP == DMA1_CH3_USART5_RX) ||\
  343. (REMAP == DMA1_CH3_USART6_RX) ||\
  344. (REMAP == DMA1_CH3_USART7_RX) ||\
  345. (REMAP == DMA1_CH3_USART8_RX) ||\
  346. (REMAP == DMA1_CH4_DEFAULT) ||\
  347. (REMAP == DMA1_CH4_TIM7_UP) ||\
  348. (REMAP == DMA1_CH4_DAC_CH2) ||\
  349. (REMAP == DMA1_CH4_I2C2_TX) ||\
  350. (REMAP == DMA1_CH4_SPI2_RX) ||\
  351. (REMAP == DMA1_CH4_TIM2_CH4) ||\
  352. (REMAP == DMA1_CH4_TIM3_CH1) ||\
  353. (REMAP == DMA1_CH4_TIM3_TRIG) ||\
  354. (REMAP == DMA1_CH4_TIM16_CH1) ||\
  355. (REMAP == DMA1_CH4_TIM16_UP) ||\
  356. (REMAP == DMA1_CH4_USART1_TX) ||\
  357. (REMAP == DMA1_CH4_USART2_TX) ||\
  358. (REMAP == DMA1_CH4_USART3_TX) ||\
  359. (REMAP == DMA1_CH4_USART4_TX) ||\
  360. (REMAP == DMA1_CH4_USART5_TX) ||\
  361. (REMAP == DMA1_CH4_USART6_TX) ||\
  362. (REMAP == DMA1_CH4_USART7_TX) ||\
  363. (REMAP == DMA1_CH4_USART8_TX) ||\
  364. (REMAP == DMA1_CH5_DEFAULT) ||\
  365. (REMAP == DMA1_CH5_I2C2_RX) ||\
  366. (REMAP == DMA1_CH5_SPI2_TX) ||\
  367. (REMAP == DMA1_CH5_TIM1_CH3) ||\
  368. (REMAP == DMA1_CH5_USART1_RX) ||\
  369. (REMAP == DMA1_CH5_USART2_RX) ||\
  370. (REMAP == DMA1_CH5_USART3_RX) ||\
  371. (REMAP == DMA1_CH5_USART4_RX) ||\
  372. (REMAP == DMA1_CH5_USART5_RX) ||\
  373. (REMAP == DMA1_CH5_USART6_RX) ||\
  374. (REMAP == DMA1_CH5_USART7_RX) ||\
  375. (REMAP == DMA1_CH5_USART8_RX) ||\
  376. (REMAP == DMA1_CH6_DEFAULT) ||\
  377. (REMAP == DMA1_CH6_I2C1_TX) ||\
  378. (REMAP == DMA1_CH6_SPI2_RX) ||\
  379. (REMAP == DMA1_CH6_TIM1_CH1) ||\
  380. (REMAP == DMA1_CH6_TIM1_CH2) ||\
  381. (REMAP == DMA1_CH6_TIM1_CH3) ||\
  382. (REMAP == DMA1_CH6_TIM3_CH1) ||\
  383. (REMAP == DMA1_CH6_TIM3_TRIG) ||\
  384. (REMAP == DMA1_CH6_TIM16_CH1) ||\
  385. (REMAP == DMA1_CH6_TIM16_UP) ||\
  386. (REMAP == DMA1_CH6_USART1_RX) ||\
  387. (REMAP == DMA1_CH6_USART2_RX) ||\
  388. (REMAP == DMA1_CH6_USART3_RX) ||\
  389. (REMAP == DMA1_CH6_USART4_RX) ||\
  390. (REMAP == DMA1_CH6_USART5_RX) ||\
  391. (REMAP == DMA1_CH6_USART6_RX) ||\
  392. (REMAP == DMA1_CH6_USART7_RX) ||\
  393. (REMAP == DMA1_CH6_USART8_RX) ||\
  394. (REMAP == DMA1_CH7_DEFAULT) ||\
  395. (REMAP == DMA1_CH7_I2C1_RX) ||\
  396. (REMAP == DMA1_CH7_SPI2_TX) ||\
  397. (REMAP == DMA1_CH7_TIM2_CH2) ||\
  398. (REMAP == DMA1_CH7_TIM2_CH4) ||\
  399. (REMAP == DMA1_CH7_TIM17_CH1) ||\
  400. (REMAP == DMA1_CH7_TIM17_UP) ||\
  401. (REMAP == DMA1_CH7_USART1_TX) ||\
  402. (REMAP == DMA1_CH7_USART2_TX) ||\
  403. (REMAP == DMA1_CH7_USART3_TX) ||\
  404. (REMAP == DMA1_CH7_USART4_TX) ||\
  405. (REMAP == DMA1_CH7_USART5_TX) ||\
  406. (REMAP == DMA1_CH7_USART6_TX) ||\
  407. (REMAP == DMA1_CH7_USART7_TX) ||\
  408. (REMAP == DMA1_CH7_USART8_TX))
  409. /****************** DMA2 remap bit field definition********************/
  410. /* DMA2 - Channel 1 */
  411. #define DMA2_CH1_DEFAULT (uint32_t) (DMAx_CHANNEL1_RMP | DMA_RMPCR2_DEFAULT) /*!< Default remap position for DMA2 */
  412. #define DMA2_CH1_I2C2_TX (uint32_t) (DMAx_CHANNEL1_RMP | DMA_RMPCR2_CH1_I2C2_TX) /*!< Remap I2C2 TX on DMA2 channel 1 */
  413. #define DMA2_CH1_USART1_TX (uint32_t) (DMAx_CHANNEL1_RMP | DMA_RMPCR2_CH1_USART1_TX) /*!< Remap USART1 Tx on DMA2 channel 1 */
  414. #define DMA2_CH1_USART2_TX (uint32_t) (DMAx_CHANNEL1_RMP | DMA_RMPCR2_CH1_USART2_TX) /*!< Remap USART2 Tx on DMA2 channel 1 */
  415. #define DMA2_CH1_USART3_TX (uint32_t) (DMAx_CHANNEL1_RMP | DMA_RMPCR2_CH1_USART3_TX) /*!< Remap USART3 Tx on DMA2 channel 1 */
  416. #define DMA2_CH1_USART4_TX (uint32_t) (DMAx_CHANNEL1_RMP | DMA_RMPCR2_CH1_USART4_TX) /*!< Remap USART4 Tx on DMA2 channel 1 */
  417. #define DMA2_CH1_USART5_TX (uint32_t) (DMAx_CHANNEL1_RMP | DMA_RMPCR2_CH1_USART5_TX) /*!< Remap USART5 Tx on DMA2 channel 1 */
  418. #define DMA2_CH1_USART6_TX (uint32_t) (DMAx_CHANNEL1_RMP | DMA_RMPCR2_CH1_USART6_TX) /*!< Remap USART6 Tx on DMA2 channel 1 */
  419. #define DMA2_CH1_USART7_TX (uint32_t) (DMAx_CHANNEL1_RMP | DMA_RMPCR2_CH1_USART7_TX) /*!< Remap USART7 Tx on DMA2 channel 1 */
  420. #define DMA2_CH1_USART8_TX (uint32_t) (DMAx_CHANNEL1_RMP | DMA_RMPCR2_CH1_USART8_TX) /*!< Remap USART8 Tx on DMA2 channel 1 */
  421. /* DMA2 - Channel 2 */
  422. #define DMA2_CH2_DEFAULT (uint32_t) (DMAx_CHANNEL2_RMP | DMA_RMPCR2_DEFAULT) /*!< Default remap position for DMA2 */
  423. #define DMA2_CH2_I2C2_RX (uint32_t) (DMAx_CHANNEL2_RMP | DMA_RMPCR2_CH2_I2C2_RX) /*!< Remap I2C2 Rx on DMA2 channel 2 */
  424. #define DMA2_CH2_USART1_RX (uint32_t) (DMAx_CHANNEL2_RMP | DMA_RMPCR2_CH2_USART1_RX) /*!< Remap USART1 Rx on DMA2 channel 2 */
  425. #define DMA2_CH2_USART2_RX (uint32_t) (DMAx_CHANNEL2_RMP | DMA_RMPCR2_CH2_USART2_RX) /*!< Remap USART2 Rx on DMA2 channel 2 */
  426. #define DMA2_CH2_USART3_RX (uint32_t) (DMAx_CHANNEL2_RMP | DMA_RMPCR2_CH2_USART3_RX) /*!< Remap USART3 Rx on DMA2 channel 2 */
  427. #define DMA2_CH2_USART4_RX (uint32_t) (DMAx_CHANNEL2_RMP | DMA_RMPCR2_CH2_USART4_RX) /*!< Remap USART4 Rx on DMA2 channel 2 */
  428. #define DMA2_CH2_USART5_RX (uint32_t) (DMAx_CHANNEL2_RMP | DMA_RMPCR2_CH2_USART5_RX) /*!< Remap USART5 Rx on DMA2 channel 2 */
  429. #define DMA2_CH2_USART6_RX (uint32_t) (DMAx_CHANNEL2_RMP | DMA_RMPCR2_CH2_USART6_RX) /*!< Remap USART6 Rx on DMA2 channel 2 */
  430. #define DMA2_CH2_USART7_RX (uint32_t) (DMAx_CHANNEL2_RMP | DMA_RMPCR2_CH2_USART7_RX) /*!< Remap USART7 Rx on DMA2 channel 2 */
  431. #define DMA2_CH2_USART8_RX (uint32_t) (DMAx_CHANNEL2_RMP | DMA_RMPCR2_CH2_USART8_RX) /*!< Remap USART8 Rx on DMA2 channel 2 */
  432. /* DMA2 - Channel 3 */
  433. #define DMA2_CH3_DEFAULT (uint32_t) (DMAx_CHANNEL3_RMP | DMA_RMPCR2_DEFAULT) /*!< Default remap position for DMA2 */
  434. #define DMA2_CH3_TIM6_UP (uint32_t) (DMAx_CHANNEL3_RMP | DMA_RMPCR2_CH3_TIM6_UP) /*!< Remap TIM6 up on DMA2 channel 3 */
  435. #define DMA2_CH3_DAC_CH1 (uint32_t) (DMAx_CHANNEL3_RMP | DMA_RMPCR2_CH3_DAC_CH1) /*!< Remap DAC channel 1 on DMA2 channel 3 */
  436. #define DMA2_CH3_SPI1_RX (uint32_t) (DMAx_CHANNEL3_RMP | DMA_RMPCR2_CH3_SPI1_RX) /*!< Remap SPI1 Rx on DMA2 channel 3 */
  437. #define DMA2_CH3_USART1_RX (uint32_t) (DMAx_CHANNEL3_RMP | DMA_RMPCR2_CH3_USART1_RX) /*!< Remap USART1 Rx on DMA2 channel 3 */
  438. #define DMA2_CH3_USART2_RX (uint32_t) (DMAx_CHANNEL3_RMP | DMA_RMPCR2_CH3_USART2_RX) /*!< Remap USART2 Rx on DMA2 channel 3 */
  439. #define DMA2_CH3_USART3_RX (uint32_t) (DMAx_CHANNEL3_RMP | DMA_RMPCR2_CH3_USART3_RX) /*!< Remap USART3 Rx on DMA2 channel 3 */
  440. #define DMA2_CH3_USART4_RX (uint32_t) (DMAx_CHANNEL3_RMP | DMA_RMPCR2_CH3_USART4_RX) /*!< Remap USART4 Rx on DMA2 channel 3 */
  441. #define DMA2_CH3_USART5_RX (uint32_t) (DMAx_CHANNEL3_RMP | DMA_RMPCR2_CH3_USART5_RX) /*!< Remap USART5 Rx on DMA2 channel 3 */
  442. #define DMA2_CH3_USART6_RX (uint32_t) (DMAx_CHANNEL3_RMP | DMA_RMPCR2_CH3_USART6_RX) /*!< Remap USART6 Rx on DMA2 channel 3 */
  443. #define DMA2_CH3_USART7_RX (uint32_t) (DMAx_CHANNEL3_RMP | DMA_RMPCR2_CH3_USART7_RX) /*!< Remap USART7 Rx on DMA2 channel 3 */
  444. #define DMA2_CH3_USART8_RX (uint32_t) (DMAx_CHANNEL3_RMP | DMA_RMPCR2_CH3_USART8_RX) /*!< Remap USART8 Rx on DMA2 channel 3 */
  445. /* DMA2 - Channel 4 */
  446. #define DMA2_CH4_DEFAULT (uint32_t) (DMAx_CHANNEL4_RMP | DMA_RMPCR2_DEFAULT) /*!< Default remap position for DMA2 */
  447. #define DMA2_CH4_TIM7_UP (uint32_t) (DMAx_CHANNEL4_RMP | DMA_RMPCR2_CH4_TIM7_UP) /*!< Remap TIM7 up on DMA2 channel 4 */
  448. #define DMA2_CH4_DAC_CH2 (uint32_t) (DMAx_CHANNEL4_RMP | DMA_RMPCR2_CH4_DAC_CH2) /*!< Remap DAC channel 2 on DMA2 channel 4 */
  449. #define DMA2_CH4_SPI1_TX (uint32_t) (DMAx_CHANNEL4_RMP | DMA_RMPCR2_CH4_SPI1_TX) /*!< Remap SPI1 Tx on DMA2 channel 4 */
  450. #define DMA2_CH4_USART1_TX (uint32_t) (DMAx_CHANNEL4_RMP | DMA_RMPCR2_CH4_USART1_TX) /*!< Remap USART1 Tx on DMA2 channel 4 */
  451. #define DMA2_CH4_USART2_TX (uint32_t) (DMAx_CHANNEL4_RMP | DMA_RMPCR2_CH4_USART2_TX) /*!< Remap USART2 Tx on DMA2 channel 4 */
  452. #define DMA2_CH4_USART3_TX (uint32_t) (DMAx_CHANNEL4_RMP | DMA_RMPCR2_CH4_USART3_TX) /*!< Remap USART3 Tx on DMA2 channel 4 */
  453. #define DMA2_CH4_USART4_TX (uint32_t) (DMAx_CHANNEL4_RMP | DMA_RMPCR2_CH4_USART4_TX) /*!< Remap USART4 Tx on DMA2 channel 4 */
  454. #define DMA2_CH4_USART5_TX (uint32_t) (DMAx_CHANNEL4_RMP | DMA_RMPCR2_CH4_USART5_TX) /*!< Remap USART5 Tx on DMA2 channel 4 */
  455. #define DMA2_CH4_USART6_TX (uint32_t) (DMAx_CHANNEL4_RMP | DMA_RMPCR2_CH4_USART6_TX) /*!< Remap USART6 Tx on DMA2 channel 4 */
  456. #define DMA2_CH4_USART7_TX (uint32_t) (DMAx_CHANNEL4_RMP | DMA_RMPCR2_CH4_USART7_TX) /*!< Remap USART7 Tx on DMA2 channel 4 */
  457. #define DMA2_CH4_USART8_TX (uint32_t) (DMAx_CHANNEL4_RMP | DMA_RMPCR2_CH4_USART8_TX) /*!< Remap USART8 Tx on DMA2 channel 4 */
  458. /* DMA2 - Channel 5 */
  459. #define DMA2_CH5_DEFAULT (uint32_t) (DMAx_CHANNEL5_RMP | DMA_RMPCR2_DEFAULT) /*!< Default remap position for DMA2 */
  460. #define DMA2_CH5_ADC (uint32_t) (DMAx_CHANNEL5_RMP | DMA_RMPCR2_CH5_ADC) /*!< Remap ADC on DMA2 channel 5 */
  461. #define DMA2_CH5_USART1_TX (uint32_t) (DMAx_CHANNEL5_RMP | DMA_RMPCR2_CH5_USART1_TX) /*!< Remap USART1 Tx on DMA2 channel 5 */
  462. #define DMA2_CH5_USART2_TX (uint32_t) (DMAx_CHANNEL5_RMP | DMA_RMPCR2_CH5_USART2_TX) /*!< Remap USART2 Tx on DMA2 channel 5 */
  463. #define DMA2_CH5_USART3_TX (uint32_t) (DMAx_CHANNEL5_RMP | DMA_RMPCR2_CH5_USART3_TX) /*!< Remap USART3 Tx on DMA2 channel 5 */
  464. #define DMA2_CH5_USART4_TX (uint32_t) (DMAx_CHANNEL5_RMP | DMA_RMPCR2_CH5_USART4_TX) /*!< Remap USART4 Tx on DMA2 channel 5 */
  465. #define DMA2_CH5_USART5_TX (uint32_t) (DMAx_CHANNEL5_RMP | DMA_RMPCR2_CH5_USART5_TX) /*!< Remap USART5 Tx on DMA2 channel 5 */
  466. #define DMA2_CH5_USART6_TX (uint32_t) (DMAx_CHANNEL5_RMP | DMA_RMPCR2_CH5_USART6_TX) /*!< Remap USART6 Tx on DMA2 channel 5 */
  467. #define DMA2_CH5_USART7_TX (uint32_t) (DMAx_CHANNEL5_RMP | DMA_RMPCR2_CH5_USART7_TX) /*!< Remap USART7 Tx on DMA2 channel 5 */
  468. #define DMA2_CH5_USART8_TX (uint32_t) (DMAx_CHANNEL5_RMP | DMA_RMPCR2_CH5_USART8_TX) /*!< Remap USART8 Tx on DMA2 channel 5 */
  469. #define IS_DMA2_REMAP(REMAP) ((REMAP == DMA2_CH1_DEFAULT) ||\
  470. (REMAP == DMA2_CH1_I2C2_TX) ||\
  471. (REMAP == DMA2_CH1_USART1_TX) ||\
  472. (REMAP == DMA2_CH1_USART2_TX) ||\
  473. (REMAP == DMA2_CH1_USART3_TX) ||\
  474. (REMAP == DMA2_CH1_USART4_TX) ||\
  475. (REMAP == DMA2_CH1_USART5_TX) ||\
  476. (REMAP == DMA2_CH1_USART6_TX) ||\
  477. (REMAP == DMA2_CH1_USART7_TX) ||\
  478. (REMAP == DMA2_CH1_USART8_TX) ||\
  479. (REMAP == DMA2_CH2_DEFAULT) ||\
  480. (REMAP == DMA2_CH2_I2C2_RX) ||\
  481. (REMAP == DMA2_CH2_USART1_RX) ||\
  482. (REMAP == DMA2_CH2_USART2_RX) ||\
  483. (REMAP == DMA2_CH2_USART3_RX) ||\
  484. (REMAP == DMA2_CH2_USART4_RX) ||\
  485. (REMAP == DMA2_CH2_USART5_RX) ||\
  486. (REMAP == DMA2_CH2_USART6_RX) ||\
  487. (REMAP == DMA2_CH2_USART7_RX) ||\
  488. (REMAP == DMA2_CH2_USART8_RX) ||\
  489. (REMAP == DMA2_CH3_DEFAULT) ||\
  490. (REMAP == DMA2_CH3_TIM6_UP) ||\
  491. (REMAP == DMA2_CH3_DAC_CH1) ||\
  492. (REMAP == DMA2_CH3_SPI1_RX) ||\
  493. (REMAP == DMA2_CH3_USART1_RX) ||\
  494. (REMAP == DMA2_CH3_USART2_RX) ||\
  495. (REMAP == DMA2_CH3_USART3_RX) ||\
  496. (REMAP == DMA2_CH3_USART4_RX) ||\
  497. (REMAP == DMA2_CH3_USART5_RX) ||\
  498. (REMAP == DMA2_CH3_USART6_RX) ||\
  499. (REMAP == DMA2_CH3_USART7_RX) ||\
  500. (REMAP == DMA2_CH3_USART8_RX) ||\
  501. (REMAP == DMA2_CH4_DEFAULT) ||\
  502. (REMAP == DMA2_CH4_TIM7_UP) ||\
  503. (REMAP == DMA2_CH4_DAC_CH2) ||\
  504. (REMAP == DMA2_CH4_SPI1_TX) ||\
  505. (REMAP == DMA2_CH4_USART1_TX) ||\
  506. (REMAP == DMA2_CH4_USART2_TX) ||\
  507. (REMAP == DMA2_CH4_USART3_TX) ||\
  508. (REMAP == DMA2_CH4_USART4_TX) ||\
  509. (REMAP == DMA2_CH4_USART5_TX) ||\
  510. (REMAP == DMA2_CH4_USART6_TX) ||\
  511. (REMAP == DMA2_CH4_USART7_TX) ||\
  512. (REMAP == DMA2_CH4_USART8_TX) ||\
  513. (REMAP == DMA2_CH5_DEFAULT) ||\
  514. (REMAP == DMA2_CH5_ADC) ||\
  515. (REMAP == DMA2_CH5_USART1_TX) ||\
  516. (REMAP == DMA2_CH5_USART2_TX) ||\
  517. (REMAP == DMA2_CH5_USART3_TX) ||\
  518. (REMAP == DMA2_CH5_USART4_TX) ||\
  519. (REMAP == DMA2_CH5_USART5_TX) ||\
  520. (REMAP == DMA2_CH5_USART6_TX) ||\
  521. (REMAP == DMA2_CH5_USART7_TX) ||\
  522. (REMAP == DMA2_CH5_USART8_TX ))
  523. /**
  524. * @}
  525. */
  526. /** @defgroup DMA_interrupts_definition
  527. * @{
  528. */
  529. #define DMA_IT_TC DMA_CCR_TCIE
  530. #define DMA_IT_HT DMA_CCR_HTIE
  531. #define DMA_IT_TE DMA_CCR_TEIE
  532. #define IS_DMA_CONFIG_IT(IT) ((((IT) & 0xFFFFFFF1) == 0x00) && ((IT) != 0x00))
  533. #define DMA1_IT_GL1 DMA_ISR_GIF1
  534. #define DMA1_IT_TC1 DMA_ISR_TCIF1
  535. #define DMA1_IT_HT1 DMA_ISR_HTIF1
  536. #define DMA1_IT_TE1 DMA_ISR_TEIF1
  537. #define DMA1_IT_GL2 DMA_ISR_GIF2
  538. #define DMA1_IT_TC2 DMA_ISR_TCIF2
  539. #define DMA1_IT_HT2 DMA_ISR_HTIF2
  540. #define DMA1_IT_TE2 DMA_ISR_TEIF2
  541. #define DMA1_IT_GL3 DMA_ISR_GIF3
  542. #define DMA1_IT_TC3 DMA_ISR_TCIF3
  543. #define DMA1_IT_HT3 DMA_ISR_HTIF3
  544. #define DMA1_IT_TE3 DMA_ISR_TEIF3
  545. #define DMA1_IT_GL4 DMA_ISR_GIF4
  546. #define DMA1_IT_TC4 DMA_ISR_TCIF4
  547. #define DMA1_IT_HT4 DMA_ISR_HTIF4
  548. #define DMA1_IT_TE4 DMA_ISR_TEIF4
  549. #define DMA1_IT_GL5 DMA_ISR_GIF5
  550. #define DMA1_IT_TC5 DMA_ISR_TCIF5
  551. #define DMA1_IT_HT5 DMA_ISR_HTIF5
  552. #define DMA1_IT_TE5 DMA_ISR_TEIF5
  553. #define DMA1_IT_GL6 DMA_ISR_GIF6 /*!< Only applicable for STM32F072 and STM32F091 devices */
  554. #define DMA1_IT_TC6 DMA_ISR_TCIF6 /*!< Only applicable for STM32F072 and STM32F091 devices */
  555. #define DMA1_IT_HT6 DMA_ISR_HTIF6 /*!< Only applicable for STM32F072 and STM32F091 devices */
  556. #define DMA1_IT_TE6 DMA_ISR_TEIF6 /*!< Only applicable for STM32F072 and STM32F091 devices */
  557. #define DMA1_IT_GL7 DMA_ISR_GIF7 /*!< Only applicable for STM32F072 and STM32F091 devices */
  558. #define DMA1_IT_TC7 DMA_ISR_TCIF7 /*!< Only applicable for STM32F072 and STM32F091 devices */
  559. #define DMA1_IT_HT7 DMA_ISR_HTIF7 /*!< Only applicable for STM32F072 and STM32F091 devices */
  560. #define DMA1_IT_TE7 DMA_ISR_TEIF7 /*!< Only applicable for STM32F072 and STM32F091 devices */
  561. #define DMA2_IT_GL1 ((uint32_t)0x10000001) /*!< Only applicable for STM32F091 devices */
  562. #define DMA2_IT_TC1 ((uint32_t)0x10000002) /*!< Only applicable for STM32F091 devices */
  563. #define DMA2_IT_HT1 ((uint32_t)0x10000004) /*!< Only applicable for STM32F091 devices */
  564. #define DMA2_IT_TE1 ((uint32_t)0x10000008) /*!< Only applicable for STM32F091 devices */
  565. #define DMA2_IT_GL2 ((uint32_t)0x10000010) /*!< Only applicable for STM32F091 devices */
  566. #define DMA2_IT_TC2 ((uint32_t)0x10000020) /*!< Only applicable for STM32F091 devices */
  567. #define DMA2_IT_HT2 ((uint32_t)0x10000040) /*!< Only applicable for STM32F091 devices */
  568. #define DMA2_IT_TE2 ((uint32_t)0x10000080) /*!< Only applicable for STM32F091 devices */
  569. #define DMA2_IT_GL3 ((uint32_t)0x10000100) /*!< Only applicable for STM32F091 devices */
  570. #define DMA2_IT_TC3 ((uint32_t)0x10000200) /*!< Only applicable for STM32F091 devices */
  571. #define DMA2_IT_HT3 ((uint32_t)0x10000400) /*!< Only applicable for STM32F091 devices */
  572. #define DMA2_IT_TE3 ((uint32_t)0x10000800) /*!< Only applicable for STM32F091 devices */
  573. #define DMA2_IT_GL4 ((uint32_t)0x10001000) /*!< Only applicable for STM32F091 devices */
  574. #define DMA2_IT_TC4 ((uint32_t)0x10002000) /*!< Only applicable for STM32F091 devices */
  575. #define DMA2_IT_HT4 ((uint32_t)0x10004000) /*!< Only applicable for STM32F091 devices */
  576. #define DMA2_IT_TE4 ((uint32_t)0x10008000) /*!< Only applicable for STM32F091 devices */
  577. #define DMA2_IT_GL5 ((uint32_t)0x10010000) /*!< Only applicable for STM32F091 devices */
  578. #define DMA2_IT_TC5 ((uint32_t)0x10020000) /*!< Only applicable for STM32F091 devices */
  579. #define DMA2_IT_HT5 ((uint32_t)0x10040000) /*!< Only applicable for STM32F091 devices */
  580. #define DMA2_IT_TE5 ((uint32_t)0x10080000) /*!< Only applicable for STM32F091 devices */
  581. #define IS_DMA_CLEAR_IT(IT) (((((IT) & 0xF0000000) == 0x00) || (((IT) & 0xEFF00000) == 0x00)) && ((IT) != 0x00))
  582. #define IS_DMA_GET_IT(IT) (((IT) == DMA1_IT_GL1) || ((IT) == DMA1_IT_TC1) || \
  583. ((IT) == DMA1_IT_HT1) || ((IT) == DMA1_IT_TE1) || \
  584. ((IT) == DMA1_IT_GL2) || ((IT) == DMA1_IT_TC2) || \
  585. ((IT) == DMA1_IT_HT2) || ((IT) == DMA1_IT_TE2) || \
  586. ((IT) == DMA1_IT_GL3) || ((IT) == DMA1_IT_TC3) || \
  587. ((IT) == DMA1_IT_HT3) || ((IT) == DMA1_IT_TE3) || \
  588. ((IT) == DMA1_IT_GL4) || ((IT) == DMA1_IT_TC4) || \
  589. ((IT) == DMA1_IT_HT4) || ((IT) == DMA1_IT_TE4) || \
  590. ((IT) == DMA1_IT_GL5) || ((IT) == DMA1_IT_TC5) || \
  591. ((IT) == DMA1_IT_HT5) || ((IT) == DMA1_IT_TE5) || \
  592. ((IT) == DMA1_IT_GL6) || ((IT) == DMA1_IT_TC6) || \
  593. ((IT) == DMA1_IT_HT6) || ((IT) == DMA1_IT_TE6) || \
  594. ((IT) == DMA1_IT_GL7) || ((IT) == DMA1_IT_TC7) || \
  595. ((IT) == DMA1_IT_HT7) || ((IT) == DMA1_IT_TE7) || \
  596. ((IT) == DMA2_IT_GL1) || ((IT) == DMA2_IT_TC1) || \
  597. ((IT) == DMA2_IT_HT1) || ((IT) == DMA2_IT_TE1) || \
  598. ((IT) == DMA2_IT_GL2) || ((IT) == DMA2_IT_TC2) || \
  599. ((IT) == DMA2_IT_HT2) || ((IT) == DMA2_IT_TE2) || \
  600. ((IT) == DMA2_IT_GL3) || ((IT) == DMA2_IT_TC3) || \
  601. ((IT) == DMA2_IT_HT3) || ((IT) == DMA2_IT_TE3) || \
  602. ((IT) == DMA2_IT_GL4) || ((IT) == DMA2_IT_TC4) || \
  603. ((IT) == DMA2_IT_HT4) || ((IT) == DMA2_IT_TE4) || \
  604. ((IT) == DMA2_IT_GL5) || ((IT) == DMA2_IT_TC5) || \
  605. ((IT) == DMA2_IT_HT5) || ((IT) == DMA2_IT_TE5))
  606. /**
  607. * @}
  608. */
  609. /** @defgroup DMA_flags_definition
  610. * @{
  611. */
  612. #define DMA1_FLAG_GL1 DMA_ISR_GIF1
  613. #define DMA1_FLAG_TC1 DMA_ISR_TCIF1
  614. #define DMA1_FLAG_HT1 DMA_ISR_HTIF1
  615. #define DMA1_FLAG_TE1 DMA_ISR_TEIF1
  616. #define DMA1_FLAG_GL2 DMA_ISR_GIF2
  617. #define DMA1_FLAG_TC2 DMA_ISR_TCIF2
  618. #define DMA1_FLAG_HT2 DMA_ISR_HTIF2
  619. #define DMA1_FLAG_TE2 DMA_ISR_TEIF2
  620. #define DMA1_FLAG_GL3 DMA_ISR_GIF3
  621. #define DMA1_FLAG_TC3 DMA_ISR_TCIF3
  622. #define DMA1_FLAG_HT3 DMA_ISR_HTIF3
  623. #define DMA1_FLAG_TE3 DMA_ISR_TEIF3
  624. #define DMA1_FLAG_GL4 DMA_ISR_GIF4
  625. #define DMA1_FLAG_TC4 DMA_ISR_TCIF4
  626. #define DMA1_FLAG_HT4 DMA_ISR_HTIF4
  627. #define DMA1_FLAG_TE4 DMA_ISR_TEIF4
  628. #define DMA1_FLAG_GL5 DMA_ISR_GIF5
  629. #define DMA1_FLAG_TC5 DMA_ISR_TCIF5
  630. #define DMA1_FLAG_HT5 DMA_ISR_HTIF5
  631. #define DMA1_FLAG_TE5 DMA_ISR_TEIF5
  632. #define DMA1_FLAG_GL6 DMA_ISR_GIF6 /*!< Only applicable for STM32F072 and STM32F091 devices */
  633. #define DMA1_FLAG_TC6 DMA_ISR_TCIF6 /*!< Only applicable for STM32F072 and STM32F091 devices */
  634. #define DMA1_FLAG_HT6 DMA_ISR_HTIF6 /*!< Only applicable for STM32F072 and STM32F091 devices */
  635. #define DMA1_FLAG_TE6 DMA_ISR_TEIF6 /*!< Only applicable for STM32F072 and STM32F091 devices */
  636. #define DMA1_FLAG_GL7 DMA_ISR_GIF7 /*!< Only applicable for STM32F072 and STM32F091 devices */
  637. #define DMA1_FLAG_TC7 DMA_ISR_TCIF7 /*!< Only applicable for STM32F072 and STM32F091 devices */
  638. #define DMA1_FLAG_HT7 DMA_ISR_HTIF7 /*!< Only applicable for STM32F072 and STM32F091 devices */
  639. #define DMA1_FLAG_TE7 DMA_ISR_TEIF7 /*!< Only applicable for STM32F072 and STM32F091 devices */
  640. #define DMA2_FLAG_GL1 ((uint32_t)0x10000001)
  641. #define DMA2_FLAG_TC1 ((uint32_t)0x10000002)
  642. #define DMA2_FLAG_HT1 ((uint32_t)0x10000004)
  643. #define DMA2_FLAG_TE1 ((uint32_t)0x10000008)
  644. #define DMA2_FLAG_GL2 ((uint32_t)0x10000010)
  645. #define DMA2_FLAG_TC2 ((uint32_t)0x10000020)
  646. #define DMA2_FLAG_HT2 ((uint32_t)0x10000040)
  647. #define DMA2_FLAG_TE2 ((uint32_t)0x10000080)
  648. #define DMA2_FLAG_GL3 ((uint32_t)0x10000100)
  649. #define DMA2_FLAG_TC3 ((uint32_t)0x10000200)
  650. #define DMA2_FLAG_HT3 ((uint32_t)0x10000400)
  651. #define DMA2_FLAG_TE3 ((uint32_t)0x10000800)
  652. #define DMA2_FLAG_GL4 ((uint32_t)0x10001000)
  653. #define DMA2_FLAG_TC4 ((uint32_t)0x10002000)
  654. #define DMA2_FLAG_HT4 ((uint32_t)0x10004000)
  655. #define DMA2_FLAG_TE4 ((uint32_t)0x10008000)
  656. #define DMA2_FLAG_GL5 ((uint32_t)0x10010000)
  657. #define DMA2_FLAG_TC5 ((uint32_t)0x10020000)
  658. #define DMA2_FLAG_HT5 ((uint32_t)0x10040000)
  659. #define DMA2_FLAG_TE5 ((uint32_t)0x10080000)
  660. #define IS_DMA_CLEAR_FLAG(FLAG) (((((FLAG) & 0xF0000000) == 0x00) || (((FLAG) & 0xEFF00000) == 0x00)) && ((FLAG) != 0x00))
  661. #define IS_DMA_GET_FLAG(FLAG) (((FLAG) == DMA1_FLAG_GL1) || ((FLAG) == DMA1_FLAG_TC1) || \
  662. ((FLAG) == DMA1_FLAG_HT1) || ((FLAG) == DMA1_FLAG_TE1) || \
  663. ((FLAG) == DMA1_FLAG_GL2) || ((FLAG) == DMA1_FLAG_TC2) || \
  664. ((FLAG) == DMA1_FLAG_HT2) || ((FLAG) == DMA1_FLAG_TE2) || \
  665. ((FLAG) == DMA1_FLAG_GL3) || ((FLAG) == DMA1_FLAG_TC3) || \
  666. ((FLAG) == DMA1_FLAG_HT3) || ((FLAG) == DMA1_FLAG_TE3) || \
  667. ((FLAG) == DMA1_FLAG_GL4) || ((FLAG) == DMA1_FLAG_TC4) || \
  668. ((FLAG) == DMA1_FLAG_HT4) || ((FLAG) == DMA1_FLAG_TE4) || \
  669. ((FLAG) == DMA1_FLAG_GL5) || ((FLAG) == DMA1_FLAG_TC5) || \
  670. ((FLAG) == DMA1_FLAG_HT5) || ((FLAG) == DMA1_FLAG_TE5) || \
  671. ((FLAG) == DMA1_FLAG_GL6) || ((FLAG) == DMA1_FLAG_TC6) || \
  672. ((FLAG) == DMA1_FLAG_HT6) || ((FLAG) == DMA1_FLAG_TE6) || \
  673. ((FLAG) == DMA1_FLAG_GL7) || ((FLAG) == DMA1_FLAG_TC7) || \
  674. ((FLAG) == DMA1_FLAG_HT7) || ((FLAG) == DMA1_FLAG_TE7) || \
  675. ((FLAG) == DMA2_FLAG_GL1) || ((FLAG) == DMA2_FLAG_TC1) || \
  676. ((FLAG) == DMA2_FLAG_HT1) || ((FLAG) == DMA2_FLAG_TE1) || \
  677. ((FLAG) == DMA2_FLAG_GL2) || ((FLAG) == DMA2_FLAG_TC2) || \
  678. ((FLAG) == DMA2_FLAG_HT2) || ((FLAG) == DMA2_FLAG_TE2) || \
  679. ((FLAG) == DMA2_FLAG_GL3) || ((FLAG) == DMA2_FLAG_TC3) || \
  680. ((FLAG) == DMA2_FLAG_HT3) || ((FLAG) == DMA2_FLAG_TE3) || \
  681. ((FLAG) == DMA2_FLAG_GL4) || ((FLAG) == DMA2_FLAG_TC4) || \
  682. ((FLAG) == DMA2_FLAG_HT4) || ((FLAG) == DMA2_FLAG_TE4) || \
  683. ((FLAG) == DMA2_FLAG_GL5) || ((FLAG) == DMA2_FLAG_TC5) || \
  684. ((FLAG) == DMA2_FLAG_HT5) || ((FLAG) == DMA2_FLAG_TE5))
  685. /**
  686. * @}
  687. */
  688. /** @defgroup DMA_Buffer_Size
  689. * @{
  690. */
  691. #define IS_DMA_BUFFER_SIZE(SIZE) (((SIZE) >= 0x1) && ((SIZE) < 0x10000))
  692. /**
  693. * @}
  694. */
  695. /**
  696. * @}
  697. */
  698. /* Exported macro ------------------------------------------------------------*/
  699. /* Exported functions ------------------------------------------------------- */
  700. /* Function used to set the DMA configuration to the default reset state ******/
  701. void DMA_DeInit(DMA_Channel_TypeDef* DMAy_Channelx);
  702. /* Initialization and Configuration functions *********************************/
  703. void DMA_Init(DMA_Channel_TypeDef* DMAy_Channelx, DMA_InitTypeDef* DMA_InitStruct);
  704. void DMA_StructInit(DMA_InitTypeDef* DMA_InitStruct);
  705. void DMA_Cmd(DMA_Channel_TypeDef* DMAy_Channelx, FunctionalState NewState);
  706. void DMA_RemapConfig(DMA_TypeDef* DMAy, uint32_t DMAx_CHy_RemapRequest);
  707. /* Data Counter functions******************************************************/
  708. void DMA_SetCurrDataCounter(DMA_Channel_TypeDef* DMAy_Channelx, uint16_t DataNumber);
  709. uint16_t DMA_GetCurrDataCounter(DMA_Channel_TypeDef* DMAy_Channelx);
  710. /* Interrupts and flags management functions **********************************/
  711. void DMA_ITConfig(DMA_Channel_TypeDef* DMAy_Channelx, uint32_t DMA_IT, FunctionalState NewState);
  712. FlagStatus DMA_GetFlagStatus(uint32_t DMAy_FLAG);
  713. void DMA_ClearFlag(uint32_t DMAy_FLAG);
  714. ITStatus DMA_GetITStatus(uint32_t DMAy_IT);
  715. void DMA_ClearITPendingBit(uint32_t DMAy_IT);
  716. #ifdef __cplusplus
  717. }
  718. #endif
  719. #endif /*__STM32F0XX_DMA_H */
  720. /**
  721. * @}
  722. */
  723. /**
  724. * @}
  725. */
  726. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/