stm32f7xx_hal_dma_ex.h 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. /**
  2. ******************************************************************************
  3. * @file stm32f7xx_hal_dma_ex.h
  4. * @author MCD Application Team
  5. * @brief Header file of DMA HAL extension module.
  6. ******************************************************************************
  7. * @attention
  8. *
  9. * Copyright (c) 2017 STMicroelectronics.
  10. * All rights reserved.
  11. *
  12. * This software is licensed under terms that can be found in the LICENSE file in
  13. * the root directory of this software component.
  14. * If no LICENSE file comes with this software, it is provided AS-IS.
  15. *
  16. ******************************************************************************
  17. */
  18. /* Define to prevent recursive inclusion -------------------------------------*/
  19. #ifndef __STM32F7xx_HAL_DMA_EX_H
  20. #define __STM32F7xx_HAL_DMA_EX_H
  21. #ifdef __cplusplus
  22. extern "C" {
  23. #endif
  24. /* Includes ------------------------------------------------------------------*/
  25. #include "stm32f7xx_hal_def.h"
  26. /** @addtogroup STM32F7xx_HAL_Driver
  27. * @{
  28. */
  29. /** @addtogroup DMAEx
  30. * @{
  31. */
  32. /* Exported types ------------------------------------------------------------*/
  33. /** @defgroup DMAEx_Exported_Types DMAEx Exported Types
  34. * @brief DMAEx Exported types
  35. * @{
  36. */
  37. /**
  38. * @brief HAL DMA Memory definition
  39. */
  40. typedef enum
  41. {
  42. MEMORY0 = 0x00U, /*!< Memory 0 */
  43. MEMORY1 = 0x01U, /*!< Memory 1 */
  44. }HAL_DMA_MemoryTypeDef;
  45. /**
  46. * @}
  47. */
  48. /* Exported constants --------------------------------------------------------*/
  49. /** @defgroup DMA_Exported_Constants DMA Exported Constants
  50. * @brief DMA Exported constants
  51. * @{
  52. */
  53. /** @defgroup DMAEx_Channel_selection DMA Channel selection
  54. * @brief DMAEx channel selection
  55. * @{
  56. */
  57. #define DMA_CHANNEL_0 0x00000000U /*!< DMA Channel 0 */
  58. #define DMA_CHANNEL_1 0x02000000U /*!< DMA Channel 1 */
  59. #define DMA_CHANNEL_2 0x04000000U /*!< DMA Channel 2 */
  60. #define DMA_CHANNEL_3 0x06000000U /*!< DMA Channel 3 */
  61. #define DMA_CHANNEL_4 0x08000000U /*!< DMA Channel 4 */
  62. #define DMA_CHANNEL_5 0x0A000000U /*!< DMA Channel 5 */
  63. #define DMA_CHANNEL_6 0x0C000000U /*!< DMA Channel 6 */
  64. #define DMA_CHANNEL_7 0x0E000000U /*!< DMA Channel 7 */
  65. #if defined (STM32F722xx) || defined (STM32F723xx) || defined (STM32F732xx) || defined (STM32F733xx) ||\
  66. defined (STM32F765xx) || defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) ||\
  67. defined (STM32F779xx) || defined (STM32F730xx)
  68. #define DMA_CHANNEL_8 0x10000000U /*!< DMA Channel 8 */
  69. #define DMA_CHANNEL_9 0x12000000U /*!< DMA Channel 9 */
  70. #define DMA_CHANNEL_10 0x14000000U /*!< DMA Channel 10*/
  71. #define DMA_CHANNEL_11 0x16000000U /*!< DMA Channel 11*/
  72. #define DMA_CHANNEL_12 0x18000000U /*!< DMA Channel 12*/
  73. #define DMA_CHANNEL_13 0x1A000000U /*!< DMA Channel 13*/
  74. #define DMA_CHANNEL_14 0x1C000000U /*!< DMA Channel 14*/
  75. #define DMA_CHANNEL_15 0x1E000000U /*!< DMA Channel 15*/
  76. #endif /* STM32F722xx || STM32F723xx || STM32F732xx || STM32F733xx || STM32F765xx || STM32F767xx ||
  77. STM32F769xx || STM32F777xx || STM32F779xx || STM32F730xx */
  78. /**
  79. * @}
  80. */
  81. /**
  82. * @}
  83. */
  84. /* Exported functions --------------------------------------------------------*/
  85. /** @defgroup DMAEx_Exported_Functions DMAEx Exported Functions
  86. * @brief DMAEx Exported functions
  87. * @{
  88. */
  89. /** @defgroup DMAEx_Exported_Functions_Group1 Extended features functions
  90. * @brief Extended features functions
  91. * @{
  92. */
  93. /* IO operation functions *******************************************************/
  94. HAL_StatusTypeDef HAL_DMAEx_MultiBufferStart(DMA_HandleTypeDef *hdma, uint32_t SrcAddress, uint32_t DstAddress, uint32_t SecondMemAddress, uint32_t DataLength);
  95. HAL_StatusTypeDef HAL_DMAEx_MultiBufferStart_IT(DMA_HandleTypeDef *hdma, uint32_t SrcAddress, uint32_t DstAddress, uint32_t SecondMemAddress, uint32_t DataLength);
  96. HAL_StatusTypeDef HAL_DMAEx_ChangeMemory(DMA_HandleTypeDef *hdma, uint32_t Address, HAL_DMA_MemoryTypeDef memory);
  97. /**
  98. * @}
  99. */
  100. /**
  101. * @}
  102. */
  103. /* Private macros ------------------------------------------------------------*/
  104. /** @defgroup DMAEx_Private_Macros DMA Private Macros
  105. * @brief DMAEx private macros
  106. * @{
  107. */
  108. #if defined (STM32F722xx) || defined (STM32F723xx) || defined (STM32F732xx) || defined (STM32F733xx) ||\
  109. defined (STM32F765xx) || defined (STM32F767xx) || defined (STM32F769xx) || defined (STM32F777xx) ||\
  110. defined (STM32F779xx) || defined (STM32F730xx)
  111. #define IS_DMA_CHANNEL(CHANNEL) (((CHANNEL) == DMA_CHANNEL_0) || \
  112. ((CHANNEL) == DMA_CHANNEL_1) || \
  113. ((CHANNEL) == DMA_CHANNEL_2) || \
  114. ((CHANNEL) == DMA_CHANNEL_3) || \
  115. ((CHANNEL) == DMA_CHANNEL_4) || \
  116. ((CHANNEL) == DMA_CHANNEL_5) || \
  117. ((CHANNEL) == DMA_CHANNEL_6) || \
  118. ((CHANNEL) == DMA_CHANNEL_7) || \
  119. ((CHANNEL) == DMA_CHANNEL_8) || \
  120. ((CHANNEL) == DMA_CHANNEL_9) || \
  121. ((CHANNEL) == DMA_CHANNEL_10) || \
  122. ((CHANNEL) == DMA_CHANNEL_11) || \
  123. ((CHANNEL) == DMA_CHANNEL_12) || \
  124. ((CHANNEL) == DMA_CHANNEL_13) || \
  125. ((CHANNEL) == DMA_CHANNEL_14) || \
  126. ((CHANNEL) == DMA_CHANNEL_15))
  127. #else
  128. #define IS_DMA_CHANNEL(CHANNEL) (((CHANNEL) == DMA_CHANNEL_0) || \
  129. ((CHANNEL) == DMA_CHANNEL_1) || \
  130. ((CHANNEL) == DMA_CHANNEL_2) || \
  131. ((CHANNEL) == DMA_CHANNEL_3) || \
  132. ((CHANNEL) == DMA_CHANNEL_4) || \
  133. ((CHANNEL) == DMA_CHANNEL_5) || \
  134. ((CHANNEL) == DMA_CHANNEL_6) || \
  135. ((CHANNEL) == DMA_CHANNEL_7))
  136. #endif /* STM32F722xx || STM32F723xx || STM32F732xx || STM32F733xx || STM32F765xx || STM32F767xx ||
  137. STM32F769xx || STM32F777xx || STM32F779xx || STM32F730xx*/
  138. /**
  139. * @}
  140. */
  141. /* Private functions ---------------------------------------------------------*/
  142. /** @defgroup DMAEx_Private_Functions DMAEx Private Functions
  143. * @brief DMAEx Private functions
  144. * @{
  145. */
  146. /**
  147. * @}
  148. */
  149. /**
  150. * @}
  151. */
  152. /**
  153. * @}
  154. */
  155. #ifdef __cplusplus
  156. }
  157. #endif
  158. #endif /* __STM32F7xx_HAL_DMA_H */