Fork of the official mbed C/C SDK provides the software platform and libraries to build your applications for RenBED.

Dependents:   1-RenBuggyTimed RenBED_RGB RenBED_RGB_PWM RenBED_RGB

Fork of mbed by mbed official

Committer:
elijahorr
Date:
Thu Apr 14 07:28:54 2016 +0000
Revision:
121:672067c3ada4
Parent:
116:c0f6e94411f5
.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Kojto 115:87f2f5183dfb 1 /**
Kojto 115:87f2f5183dfb 2 ******************************************************************************
Kojto 115:87f2f5183dfb 3 * @file stm32f7xx_hal_dma.h
Kojto 115:87f2f5183dfb 4 * @author MCD Application Team
Kojto 116:c0f6e94411f5 5 * @version V1.0.4
Kojto 116:c0f6e94411f5 6 * @date 09-December-2015
Kojto 115:87f2f5183dfb 7 * @brief Header file of DMA HAL module.
Kojto 115:87f2f5183dfb 8 ******************************************************************************
Kojto 115:87f2f5183dfb 9 * @attention
Kojto 115:87f2f5183dfb 10 *
Kojto 115:87f2f5183dfb 11 * <h2><center>&copy; COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
Kojto 115:87f2f5183dfb 12 *
Kojto 115:87f2f5183dfb 13 * Redistribution and use in source and binary forms, with or without modification,
Kojto 115:87f2f5183dfb 14 * are permitted provided that the following conditions are met:
Kojto 115:87f2f5183dfb 15 * 1. Redistributions of source code must retain the above copyright notice,
Kojto 115:87f2f5183dfb 16 * this list of conditions and the following disclaimer.
Kojto 115:87f2f5183dfb 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
Kojto 115:87f2f5183dfb 18 * this list of conditions and the following disclaimer in the documentation
Kojto 115:87f2f5183dfb 19 * and/or other materials provided with the distribution.
Kojto 115:87f2f5183dfb 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
Kojto 115:87f2f5183dfb 21 * may be used to endorse or promote products derived from this software
Kojto 115:87f2f5183dfb 22 * without specific prior written permission.
Kojto 115:87f2f5183dfb 23 *
Kojto 115:87f2f5183dfb 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
Kojto 115:87f2f5183dfb 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Kojto 115:87f2f5183dfb 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Kojto 115:87f2f5183dfb 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
Kojto 115:87f2f5183dfb 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Kojto 115:87f2f5183dfb 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
Kojto 115:87f2f5183dfb 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
Kojto 115:87f2f5183dfb 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
Kojto 115:87f2f5183dfb 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Kojto 115:87f2f5183dfb 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Kojto 115:87f2f5183dfb 34 *
Kojto 115:87f2f5183dfb 35 ******************************************************************************
Kojto 115:87f2f5183dfb 36 */
Kojto 115:87f2f5183dfb 37
Kojto 115:87f2f5183dfb 38 /* Define to prevent recursive inclusion -------------------------------------*/
Kojto 115:87f2f5183dfb 39 #ifndef __STM32F7xx_HAL_DMA_H
Kojto 115:87f2f5183dfb 40 #define __STM32F7xx_HAL_DMA_H
Kojto 115:87f2f5183dfb 41
Kojto 115:87f2f5183dfb 42 #ifdef __cplusplus
Kojto 115:87f2f5183dfb 43 extern "C" {
Kojto 115:87f2f5183dfb 44 #endif
Kojto 115:87f2f5183dfb 45
Kojto 115:87f2f5183dfb 46 /* Includes ------------------------------------------------------------------*/
Kojto 115:87f2f5183dfb 47 #include "stm32f7xx_hal_def.h"
Kojto 115:87f2f5183dfb 48
Kojto 115:87f2f5183dfb 49 /** @addtogroup STM32F7xx_HAL_Driver
Kojto 115:87f2f5183dfb 50 * @{
Kojto 115:87f2f5183dfb 51 */
Kojto 115:87f2f5183dfb 52
Kojto 115:87f2f5183dfb 53 /** @addtogroup DMA
Kojto 115:87f2f5183dfb 54 * @{
Kojto 115:87f2f5183dfb 55 */
Kojto 115:87f2f5183dfb 56
Kojto 115:87f2f5183dfb 57 /* Exported types ------------------------------------------------------------*/
Kojto 115:87f2f5183dfb 58
Kojto 115:87f2f5183dfb 59 /** @defgroup DMA_Exported_Types DMA Exported Types
Kojto 115:87f2f5183dfb 60 * @brief DMA Exported Types
Kojto 115:87f2f5183dfb 61 * @{
Kojto 115:87f2f5183dfb 62 */
Kojto 115:87f2f5183dfb 63
Kojto 115:87f2f5183dfb 64 /**
Kojto 115:87f2f5183dfb 65 * @brief DMA Configuration Structure definition
Kojto 115:87f2f5183dfb 66 */
Kojto 115:87f2f5183dfb 67 typedef struct
Kojto 115:87f2f5183dfb 68 {
Kojto 115:87f2f5183dfb 69 uint32_t Channel; /*!< Specifies the channel used for the specified stream.
Kojto 115:87f2f5183dfb 70 This parameter can be a value of @ref DMA_Channel_selection */
Kojto 115:87f2f5183dfb 71
Kojto 115:87f2f5183dfb 72 uint32_t Direction; /*!< Specifies if the data will be transferred from memory to peripheral,
Kojto 115:87f2f5183dfb 73 from memory to memory or from peripheral to memory.
Kojto 115:87f2f5183dfb 74 This parameter can be a value of @ref DMA_Data_transfer_direction */
Kojto 115:87f2f5183dfb 75
Kojto 115:87f2f5183dfb 76 uint32_t PeriphInc; /*!< Specifies whether the Peripheral address register should be incremented or not.
Kojto 115:87f2f5183dfb 77 This parameter can be a value of @ref DMA_Peripheral_incremented_mode */
Kojto 115:87f2f5183dfb 78
Kojto 115:87f2f5183dfb 79 uint32_t MemInc; /*!< Specifies whether the memory address register should be incremented or not.
Kojto 115:87f2f5183dfb 80 This parameter can be a value of @ref DMA_Memory_incremented_mode */
Kojto 115:87f2f5183dfb 81
Kojto 115:87f2f5183dfb 82 uint32_t PeriphDataAlignment; /*!< Specifies the Peripheral data width.
Kojto 115:87f2f5183dfb 83 This parameter can be a value of @ref DMA_Peripheral_data_size */
Kojto 115:87f2f5183dfb 84
Kojto 115:87f2f5183dfb 85 uint32_t MemDataAlignment; /*!< Specifies the Memory data width.
Kojto 115:87f2f5183dfb 86 This parameter can be a value of @ref DMA_Memory_data_size */
Kojto 115:87f2f5183dfb 87
Kojto 115:87f2f5183dfb 88 uint32_t Mode; /*!< Specifies the operation mode of the DMAy Streamx.
Kojto 115:87f2f5183dfb 89 This parameter can be a value of @ref DMA_mode
Kojto 115:87f2f5183dfb 90 @note The circular buffer mode cannot be used if the memory-to-memory
Kojto 115:87f2f5183dfb 91 data transfer is configured on the selected Stream */
Kojto 115:87f2f5183dfb 92
Kojto 115:87f2f5183dfb 93 uint32_t Priority; /*!< Specifies the software priority for the DMAy Streamx.
Kojto 115:87f2f5183dfb 94 This parameter can be a value of @ref DMA_Priority_level */
Kojto 115:87f2f5183dfb 95
Kojto 115:87f2f5183dfb 96 uint32_t FIFOMode; /*!< Specifies if the FIFO mode or Direct mode will be used for the specified stream.
Kojto 115:87f2f5183dfb 97 This parameter can be a value of @ref DMA_FIFO_direct_mode
Kojto 115:87f2f5183dfb 98 @note The Direct mode (FIFO mode disabled) cannot be used if the
Kojto 115:87f2f5183dfb 99 memory-to-memory data transfer is configured on the selected stream */
Kojto 115:87f2f5183dfb 100
Kojto 115:87f2f5183dfb 101 uint32_t FIFOThreshold; /*!< Specifies the FIFO threshold level.
Kojto 115:87f2f5183dfb 102 This parameter can be a value of @ref DMA_FIFO_threshold_level */
Kojto 115:87f2f5183dfb 103
Kojto 115:87f2f5183dfb 104 uint32_t MemBurst; /*!< Specifies the Burst transfer configuration for the memory transfers.
Kojto 115:87f2f5183dfb 105 It specifies the amount of data to be transferred in a single non interruptible
Kojto 115:87f2f5183dfb 106 transaction.
Kojto 115:87f2f5183dfb 107 This parameter can be a value of @ref DMA_Memory_burst
Kojto 115:87f2f5183dfb 108 @note The burst mode is possible only if the address Increment mode is enabled. */
Kojto 115:87f2f5183dfb 109
Kojto 115:87f2f5183dfb 110 uint32_t PeriphBurst; /*!< Specifies the Burst transfer configuration for the peripheral transfers.
Kojto 115:87f2f5183dfb 111 It specifies the amount of data to be transferred in a single non interruptible
Kojto 115:87f2f5183dfb 112 transaction.
Kojto 115:87f2f5183dfb 113 This parameter can be a value of @ref DMA_Peripheral_burst
Kojto 115:87f2f5183dfb 114 @note The burst mode is possible only if the address Increment mode is enabled. */
Kojto 115:87f2f5183dfb 115 }DMA_InitTypeDef;
Kojto 115:87f2f5183dfb 116
Kojto 115:87f2f5183dfb 117 /**
Kojto 115:87f2f5183dfb 118 * @brief HAL DMA State structures definition
Kojto 115:87f2f5183dfb 119 */
Kojto 115:87f2f5183dfb 120 typedef enum
Kojto 115:87f2f5183dfb 121 {
Kojto 115:87f2f5183dfb 122 HAL_DMA_STATE_RESET = 0x00, /*!< DMA not yet initialized or disabled */
Kojto 115:87f2f5183dfb 123 HAL_DMA_STATE_READY = 0x01, /*!< DMA initialized and ready for use */
Kojto 115:87f2f5183dfb 124 HAL_DMA_STATE_READY_MEM0 = 0x11, /*!< DMA Mem0 process success */
Kojto 115:87f2f5183dfb 125 HAL_DMA_STATE_READY_MEM1 = 0x21, /*!< DMA Mem1 process success */
Kojto 115:87f2f5183dfb 126 HAL_DMA_STATE_READY_HALF_MEM0 = 0x31, /*!< DMA Mem0 Half process success */
Kojto 115:87f2f5183dfb 127 HAL_DMA_STATE_READY_HALF_MEM1 = 0x41, /*!< DMA Mem1 Half process success */
Kojto 115:87f2f5183dfb 128 HAL_DMA_STATE_BUSY = 0x02, /*!< DMA process is ongoing */
Kojto 115:87f2f5183dfb 129 HAL_DMA_STATE_BUSY_MEM0 = 0x12, /*!< DMA Mem0 process is ongoing */
Kojto 115:87f2f5183dfb 130 HAL_DMA_STATE_BUSY_MEM1 = 0x22, /*!< DMA Mem1 process is ongoing */
Kojto 115:87f2f5183dfb 131 HAL_DMA_STATE_TIMEOUT = 0x03, /*!< DMA timeout state */
Kojto 115:87f2f5183dfb 132 HAL_DMA_STATE_ERROR = 0x04, /*!< DMA error state */
Kojto 115:87f2f5183dfb 133 }HAL_DMA_StateTypeDef;
Kojto 115:87f2f5183dfb 134
Kojto 115:87f2f5183dfb 135 /**
Kojto 115:87f2f5183dfb 136 * @brief HAL DMA Error Code structure definition
Kojto 115:87f2f5183dfb 137 */
Kojto 115:87f2f5183dfb 138 typedef enum
Kojto 115:87f2f5183dfb 139 {
Kojto 115:87f2f5183dfb 140 HAL_DMA_FULL_TRANSFER = 0x00, /*!< Full transfer */
Kojto 115:87f2f5183dfb 141 HAL_DMA_HALF_TRANSFER = 0x01, /*!< Half Transfer */
Kojto 115:87f2f5183dfb 142 }HAL_DMA_LevelCompleteTypeDef;
Kojto 115:87f2f5183dfb 143
Kojto 115:87f2f5183dfb 144 /**
Kojto 115:87f2f5183dfb 145 * @brief DMA handle Structure definition
Kojto 115:87f2f5183dfb 146 */
Kojto 115:87f2f5183dfb 147 typedef struct __DMA_HandleTypeDef
Kojto 115:87f2f5183dfb 148 {
Kojto 115:87f2f5183dfb 149 DMA_Stream_TypeDef *Instance; /*!< Register base address */
Kojto 115:87f2f5183dfb 150
Kojto 115:87f2f5183dfb 151 DMA_InitTypeDef Init; /*!< DMA communication parameters */
Kojto 115:87f2f5183dfb 152
Kojto 115:87f2f5183dfb 153 HAL_LockTypeDef Lock; /*!< DMA locking object */
Kojto 115:87f2f5183dfb 154
Kojto 115:87f2f5183dfb 155 __IO HAL_DMA_StateTypeDef State; /*!< DMA transfer state */
Kojto 115:87f2f5183dfb 156
Kojto 115:87f2f5183dfb 157 void *Parent; /*!< Parent object state */
Kojto 115:87f2f5183dfb 158
Kojto 115:87f2f5183dfb 159 void (* XferCpltCallback)( struct __DMA_HandleTypeDef * hdma); /*!< DMA transfer complete callback */
Kojto 115:87f2f5183dfb 160
Kojto 115:87f2f5183dfb 161 void (* XferHalfCpltCallback)( struct __DMA_HandleTypeDef * hdma); /*!< DMA Half transfer complete callback */
Kojto 115:87f2f5183dfb 162
Kojto 115:87f2f5183dfb 163 void (* XferM1CpltCallback)( struct __DMA_HandleTypeDef * hdma); /*!< DMA transfer complete Memory1 callback */
Kojto 115:87f2f5183dfb 164
Kojto 115:87f2f5183dfb 165 void (* XferErrorCallback)( struct __DMA_HandleTypeDef * hdma); /*!< DMA transfer error callback */
Kojto 115:87f2f5183dfb 166
Kojto 115:87f2f5183dfb 167 __IO uint32_t ErrorCode; /*!< DMA Error code */
Kojto 116:c0f6e94411f5 168
Kojto 116:c0f6e94411f5 169 uint32_t StreamBaseAddress; /*!< DMA Stream Base Address */
Kojto 116:c0f6e94411f5 170
Kojto 116:c0f6e94411f5 171 uint32_t StreamIndex; /*!< DMA Stream Index */
Kojto 116:c0f6e94411f5 172
Kojto 115:87f2f5183dfb 173 }DMA_HandleTypeDef;
Kojto 115:87f2f5183dfb 174
Kojto 115:87f2f5183dfb 175 /**
Kojto 115:87f2f5183dfb 176 * @}
Kojto 115:87f2f5183dfb 177 */
Kojto 115:87f2f5183dfb 178
Kojto 115:87f2f5183dfb 179
Kojto 115:87f2f5183dfb 180 /* Exported constants --------------------------------------------------------*/
Kojto 115:87f2f5183dfb 181
Kojto 115:87f2f5183dfb 182 /** @defgroup DMA_Exported_Constants DMA Exported Constants
Kojto 115:87f2f5183dfb 183 * @brief DMA Exported constants
Kojto 115:87f2f5183dfb 184 * @{
Kojto 115:87f2f5183dfb 185 */
Kojto 115:87f2f5183dfb 186
Kojto 115:87f2f5183dfb 187 /** @defgroup DMA_Error_Code DMA Error Code
Kojto 115:87f2f5183dfb 188 * @brief DMA Error Code
Kojto 115:87f2f5183dfb 189 * @{
Kojto 115:87f2f5183dfb 190 */
Kojto 115:87f2f5183dfb 191 #define HAL_DMA_ERROR_NONE ((uint32_t)0x00000000) /*!< No error */
Kojto 115:87f2f5183dfb 192 #define HAL_DMA_ERROR_TE ((uint32_t)0x00000001) /*!< Transfer error */
Kojto 115:87f2f5183dfb 193 #define HAL_DMA_ERROR_FE ((uint32_t)0x00000002) /*!< FIFO error */
Kojto 115:87f2f5183dfb 194 #define HAL_DMA_ERROR_DME ((uint32_t)0x00000004) /*!< Direct Mode error */
Kojto 115:87f2f5183dfb 195 #define HAL_DMA_ERROR_TIMEOUT ((uint32_t)0x00000020) /*!< Timeout error */
Kojto 115:87f2f5183dfb 196 /**
Kojto 115:87f2f5183dfb 197 * @}
Kojto 115:87f2f5183dfb 198 */
Kojto 115:87f2f5183dfb 199
Kojto 115:87f2f5183dfb 200 /** @defgroup DMA_Channel_selection DMA Channel selection
Kojto 115:87f2f5183dfb 201 * @brief DMA channel selection
Kojto 115:87f2f5183dfb 202 * @{
Kojto 115:87f2f5183dfb 203 */
Kojto 115:87f2f5183dfb 204 #define DMA_CHANNEL_0 ((uint32_t)0x00000000) /*!< DMA Channel 0 */
Kojto 115:87f2f5183dfb 205 #define DMA_CHANNEL_1 ((uint32_t)0x02000000) /*!< DMA Channel 1 */
Kojto 115:87f2f5183dfb 206 #define DMA_CHANNEL_2 ((uint32_t)0x04000000) /*!< DMA Channel 2 */
Kojto 115:87f2f5183dfb 207 #define DMA_CHANNEL_3 ((uint32_t)0x06000000) /*!< DMA Channel 3 */
Kojto 115:87f2f5183dfb 208 #define DMA_CHANNEL_4 ((uint32_t)0x08000000) /*!< DMA Channel 4 */
Kojto 115:87f2f5183dfb 209 #define DMA_CHANNEL_5 ((uint32_t)0x0A000000) /*!< DMA Channel 5 */
Kojto 115:87f2f5183dfb 210 #define DMA_CHANNEL_6 ((uint32_t)0x0C000000) /*!< DMA Channel 6 */
Kojto 115:87f2f5183dfb 211 #define DMA_CHANNEL_7 ((uint32_t)0x0E000000) /*!< DMA Channel 7 */
Kojto 115:87f2f5183dfb 212 /**
Kojto 115:87f2f5183dfb 213 * @}
Kojto 115:87f2f5183dfb 214 */
Kojto 115:87f2f5183dfb 215
Kojto 115:87f2f5183dfb 216 /** @defgroup DMA_Data_transfer_direction DMA Data transfer direction
Kojto 115:87f2f5183dfb 217 * @brief DMA data transfer direction
Kojto 115:87f2f5183dfb 218 * @{
Kojto 115:87f2f5183dfb 219 */
Kojto 115:87f2f5183dfb 220 #define DMA_PERIPH_TO_MEMORY ((uint32_t)0x00000000) /*!< Peripheral to memory direction */
Kojto 115:87f2f5183dfb 221 #define DMA_MEMORY_TO_PERIPH ((uint32_t)DMA_SxCR_DIR_0) /*!< Memory to peripheral direction */
Kojto 115:87f2f5183dfb 222 #define DMA_MEMORY_TO_MEMORY ((uint32_t)DMA_SxCR_DIR_1) /*!< Memory to memory direction */
Kojto 115:87f2f5183dfb 223 /**
Kojto 115:87f2f5183dfb 224 * @}
Kojto 115:87f2f5183dfb 225 */
Kojto 115:87f2f5183dfb 226
Kojto 115:87f2f5183dfb 227 /** @defgroup DMA_Peripheral_incremented_mode DMA Peripheral incremented mode
Kojto 115:87f2f5183dfb 228 * @brief DMA peripheral incremented mode
Kojto 115:87f2f5183dfb 229 * @{
Kojto 115:87f2f5183dfb 230 */
Kojto 115:87f2f5183dfb 231 #define DMA_PINC_ENABLE ((uint32_t)DMA_SxCR_PINC) /*!< Peripheral increment mode enable */
Kojto 115:87f2f5183dfb 232 #define DMA_PINC_DISABLE ((uint32_t)0x00000000) /*!< Peripheral increment mode disable */
Kojto 115:87f2f5183dfb 233 /**
Kojto 115:87f2f5183dfb 234 * @}
Kojto 115:87f2f5183dfb 235 */
Kojto 115:87f2f5183dfb 236
Kojto 115:87f2f5183dfb 237 /** @defgroup DMA_Memory_incremented_mode DMA Memory incremented mode
Kojto 115:87f2f5183dfb 238 * @brief DMA memory incremented mode
Kojto 115:87f2f5183dfb 239 * @{
Kojto 115:87f2f5183dfb 240 */
Kojto 115:87f2f5183dfb 241 #define DMA_MINC_ENABLE ((uint32_t)DMA_SxCR_MINC) /*!< Memory increment mode enable */
Kojto 115:87f2f5183dfb 242 #define DMA_MINC_DISABLE ((uint32_t)0x00000000) /*!< Memory increment mode disable */
Kojto 115:87f2f5183dfb 243 /**
Kojto 115:87f2f5183dfb 244 * @}
Kojto 115:87f2f5183dfb 245 */
Kojto 115:87f2f5183dfb 246
Kojto 115:87f2f5183dfb 247
Kojto 115:87f2f5183dfb 248 /** @defgroup DMA_Peripheral_data_size DMA Peripheral data size
Kojto 115:87f2f5183dfb 249 * @brief DMA peripheral data size
Kojto 115:87f2f5183dfb 250 * @{
Kojto 115:87f2f5183dfb 251 */
Kojto 115:87f2f5183dfb 252 #define DMA_PDATAALIGN_BYTE ((uint32_t)0x00000000) /*!< Peripheral data alignment: Byte */
Kojto 115:87f2f5183dfb 253 #define DMA_PDATAALIGN_HALFWORD ((uint32_t)DMA_SxCR_PSIZE_0) /*!< Peripheral data alignment: HalfWord */
Kojto 115:87f2f5183dfb 254 #define DMA_PDATAALIGN_WORD ((uint32_t)DMA_SxCR_PSIZE_1) /*!< Peripheral data alignment: Word */
Kojto 115:87f2f5183dfb 255 /**
Kojto 115:87f2f5183dfb 256 * @}
Kojto 115:87f2f5183dfb 257 */
Kojto 115:87f2f5183dfb 258
Kojto 115:87f2f5183dfb 259
Kojto 115:87f2f5183dfb 260 /** @defgroup DMA_Memory_data_size DMA Memory data size
Kojto 115:87f2f5183dfb 261 * @brief DMA memory data size
Kojto 115:87f2f5183dfb 262 * @{
Kojto 115:87f2f5183dfb 263 */
Kojto 115:87f2f5183dfb 264 #define DMA_MDATAALIGN_BYTE ((uint32_t)0x00000000) /*!< Memory data alignment: Byte */
Kojto 115:87f2f5183dfb 265 #define DMA_MDATAALIGN_HALFWORD ((uint32_t)DMA_SxCR_MSIZE_0) /*!< Memory data alignment: HalfWord */
Kojto 115:87f2f5183dfb 266 #define DMA_MDATAALIGN_WORD ((uint32_t)DMA_SxCR_MSIZE_1) /*!< Memory data alignment: Word */
Kojto 115:87f2f5183dfb 267 /**
Kojto 115:87f2f5183dfb 268 * @}
Kojto 115:87f2f5183dfb 269 */
Kojto 115:87f2f5183dfb 270
Kojto 115:87f2f5183dfb 271 /** @defgroup DMA_mode DMA mode
Kojto 115:87f2f5183dfb 272 * @brief DMA mode
Kojto 115:87f2f5183dfb 273 * @{
Kojto 115:87f2f5183dfb 274 */
Kojto 115:87f2f5183dfb 275 #define DMA_NORMAL ((uint32_t)0x00000000) /*!< Normal mode */
Kojto 115:87f2f5183dfb 276 #define DMA_CIRCULAR ((uint32_t)DMA_SxCR_CIRC) /*!< Circular mode */
Kojto 115:87f2f5183dfb 277 #define DMA_PFCTRL ((uint32_t)DMA_SxCR_PFCTRL) /*!< Peripheral flow control mode */
Kojto 115:87f2f5183dfb 278 /**
Kojto 115:87f2f5183dfb 279 * @}
Kojto 115:87f2f5183dfb 280 */
Kojto 115:87f2f5183dfb 281
Kojto 115:87f2f5183dfb 282
Kojto 115:87f2f5183dfb 283 /** @defgroup DMA_Priority_level DMA Priority level
Kojto 115:87f2f5183dfb 284 * @brief DMA priority levels
Kojto 115:87f2f5183dfb 285 * @{
Kojto 115:87f2f5183dfb 286 */
Kojto 115:87f2f5183dfb 287 #define DMA_PRIORITY_LOW ((uint32_t)0x00000000) /*!< Priority level: Low */
Kojto 115:87f2f5183dfb 288 #define DMA_PRIORITY_MEDIUM ((uint32_t)DMA_SxCR_PL_0) /*!< Priority level: Medium */
Kojto 115:87f2f5183dfb 289 #define DMA_PRIORITY_HIGH ((uint32_t)DMA_SxCR_PL_1) /*!< Priority level: High */
Kojto 115:87f2f5183dfb 290 #define DMA_PRIORITY_VERY_HIGH ((uint32_t)DMA_SxCR_PL) /*!< Priority level: Very High */
Kojto 115:87f2f5183dfb 291 /**
Kojto 115:87f2f5183dfb 292 * @}
Kojto 115:87f2f5183dfb 293 */
Kojto 115:87f2f5183dfb 294
Kojto 115:87f2f5183dfb 295
Kojto 115:87f2f5183dfb 296 /** @defgroup DMA_FIFO_direct_mode DMA FIFO direct mode
Kojto 115:87f2f5183dfb 297 * @brief DMA FIFO direct mode
Kojto 115:87f2f5183dfb 298 * @{
Kojto 115:87f2f5183dfb 299 */
Kojto 115:87f2f5183dfb 300 #define DMA_FIFOMODE_DISABLE ((uint32_t)0x00000000) /*!< FIFO mode disable */
Kojto 115:87f2f5183dfb 301 #define DMA_FIFOMODE_ENABLE ((uint32_t)DMA_SxFCR_DMDIS) /*!< FIFO mode enable */
Kojto 115:87f2f5183dfb 302 /**
Kojto 115:87f2f5183dfb 303 * @}
Kojto 115:87f2f5183dfb 304 */
Kojto 115:87f2f5183dfb 305
Kojto 115:87f2f5183dfb 306 /** @defgroup DMA_FIFO_threshold_level DMA FIFO threshold level
Kojto 115:87f2f5183dfb 307 * @brief DMA FIFO level
Kojto 115:87f2f5183dfb 308 * @{
Kojto 115:87f2f5183dfb 309 */
Kojto 115:87f2f5183dfb 310 #define DMA_FIFO_THRESHOLD_1QUARTERFULL ((uint32_t)0x00000000) /*!< FIFO threshold 1 quart full configuration */
Kojto 115:87f2f5183dfb 311 #define DMA_FIFO_THRESHOLD_HALFFULL ((uint32_t)DMA_SxFCR_FTH_0) /*!< FIFO threshold half full configuration */
Kojto 115:87f2f5183dfb 312 #define DMA_FIFO_THRESHOLD_3QUARTERSFULL ((uint32_t)DMA_SxFCR_FTH_1) /*!< FIFO threshold 3 quarts full configuration */
Kojto 115:87f2f5183dfb 313 #define DMA_FIFO_THRESHOLD_FULL ((uint32_t)DMA_SxFCR_FTH) /*!< FIFO threshold full configuration */
Kojto 115:87f2f5183dfb 314 /**
Kojto 115:87f2f5183dfb 315 * @}
Kojto 115:87f2f5183dfb 316 */
Kojto 115:87f2f5183dfb 317
Kojto 115:87f2f5183dfb 318 /** @defgroup DMA_Memory_burst DMA Memory burst
Kojto 115:87f2f5183dfb 319 * @brief DMA memory burst
Kojto 115:87f2f5183dfb 320 * @{
Kojto 115:87f2f5183dfb 321 */
Kojto 115:87f2f5183dfb 322 #define DMA_MBURST_SINGLE ((uint32_t)0x00000000)
Kojto 115:87f2f5183dfb 323 #define DMA_MBURST_INC4 ((uint32_t)DMA_SxCR_MBURST_0)
Kojto 115:87f2f5183dfb 324 #define DMA_MBURST_INC8 ((uint32_t)DMA_SxCR_MBURST_1)
Kojto 115:87f2f5183dfb 325 #define DMA_MBURST_INC16 ((uint32_t)DMA_SxCR_MBURST)
Kojto 115:87f2f5183dfb 326 /**
Kojto 115:87f2f5183dfb 327 * @}
Kojto 115:87f2f5183dfb 328 */
Kojto 115:87f2f5183dfb 329
Kojto 115:87f2f5183dfb 330
Kojto 115:87f2f5183dfb 331 /** @defgroup DMA_Peripheral_burst DMA Peripheral burst
Kojto 115:87f2f5183dfb 332 * @brief DMA peripheral burst
Kojto 115:87f2f5183dfb 333 * @{
Kojto 115:87f2f5183dfb 334 */
Kojto 115:87f2f5183dfb 335 #define DMA_PBURST_SINGLE ((uint32_t)0x00000000)
Kojto 115:87f2f5183dfb 336 #define DMA_PBURST_INC4 ((uint32_t)DMA_SxCR_PBURST_0)
Kojto 115:87f2f5183dfb 337 #define DMA_PBURST_INC8 ((uint32_t)DMA_SxCR_PBURST_1)
Kojto 115:87f2f5183dfb 338 #define DMA_PBURST_INC16 ((uint32_t)DMA_SxCR_PBURST)
Kojto 115:87f2f5183dfb 339 /**
Kojto 115:87f2f5183dfb 340 * @}
Kojto 115:87f2f5183dfb 341 */
Kojto 115:87f2f5183dfb 342
Kojto 115:87f2f5183dfb 343 /** @defgroup DMA_interrupt_enable_definitions DMA interrupt enable definitions
Kojto 115:87f2f5183dfb 344 * @brief DMA interrupts definition
Kojto 115:87f2f5183dfb 345 * @{
Kojto 115:87f2f5183dfb 346 */
Kojto 115:87f2f5183dfb 347 #define DMA_IT_TC ((uint32_t)DMA_SxCR_TCIE)
Kojto 115:87f2f5183dfb 348 #define DMA_IT_HT ((uint32_t)DMA_SxCR_HTIE)
Kojto 115:87f2f5183dfb 349 #define DMA_IT_TE ((uint32_t)DMA_SxCR_TEIE)
Kojto 115:87f2f5183dfb 350 #define DMA_IT_DME ((uint32_t)DMA_SxCR_DMEIE)
Kojto 115:87f2f5183dfb 351 #define DMA_IT_FE ((uint32_t)0x00000080)
Kojto 115:87f2f5183dfb 352 /**
Kojto 115:87f2f5183dfb 353 * @}
Kojto 115:87f2f5183dfb 354 */
Kojto 115:87f2f5183dfb 355
Kojto 115:87f2f5183dfb 356 /** @defgroup DMA_flag_definitions DMA flag definitions
Kojto 115:87f2f5183dfb 357 * @brief DMA flag definitions
Kojto 115:87f2f5183dfb 358 * @{
Kojto 115:87f2f5183dfb 359 */
Kojto 115:87f2f5183dfb 360 #define DMA_FLAG_FEIF0_4 ((uint32_t)0x00800001)
Kojto 115:87f2f5183dfb 361 #define DMA_FLAG_DMEIF0_4 ((uint32_t)0x00800004)
Kojto 115:87f2f5183dfb 362 #define DMA_FLAG_TEIF0_4 ((uint32_t)0x00000008)
Kojto 115:87f2f5183dfb 363 #define DMA_FLAG_HTIF0_4 ((uint32_t)0x00000010)
Kojto 115:87f2f5183dfb 364 #define DMA_FLAG_TCIF0_4 ((uint32_t)0x00000020)
Kojto 115:87f2f5183dfb 365 #define DMA_FLAG_FEIF1_5 ((uint32_t)0x00000040)
Kojto 115:87f2f5183dfb 366 #define DMA_FLAG_DMEIF1_5 ((uint32_t)0x00000100)
Kojto 115:87f2f5183dfb 367 #define DMA_FLAG_TEIF1_5 ((uint32_t)0x00000200)
Kojto 115:87f2f5183dfb 368 #define DMA_FLAG_HTIF1_5 ((uint32_t)0x00000400)
Kojto 115:87f2f5183dfb 369 #define DMA_FLAG_TCIF1_5 ((uint32_t)0x00000800)
Kojto 115:87f2f5183dfb 370 #define DMA_FLAG_FEIF2_6 ((uint32_t)0x00010000)
Kojto 115:87f2f5183dfb 371 #define DMA_FLAG_DMEIF2_6 ((uint32_t)0x00040000)
Kojto 115:87f2f5183dfb 372 #define DMA_FLAG_TEIF2_6 ((uint32_t)0x00080000)
Kojto 115:87f2f5183dfb 373 #define DMA_FLAG_HTIF2_6 ((uint32_t)0x00100000)
Kojto 115:87f2f5183dfb 374 #define DMA_FLAG_TCIF2_6 ((uint32_t)0x00200000)
Kojto 115:87f2f5183dfb 375 #define DMA_FLAG_FEIF3_7 ((uint32_t)0x00400000)
Kojto 115:87f2f5183dfb 376 #define DMA_FLAG_DMEIF3_7 ((uint32_t)0x01000000)
Kojto 115:87f2f5183dfb 377 #define DMA_FLAG_TEIF3_7 ((uint32_t)0x02000000)
Kojto 115:87f2f5183dfb 378 #define DMA_FLAG_HTIF3_7 ((uint32_t)0x04000000)
Kojto 115:87f2f5183dfb 379 #define DMA_FLAG_TCIF3_7 ((uint32_t)0x08000000)
Kojto 115:87f2f5183dfb 380 /**
Kojto 115:87f2f5183dfb 381 * @}
Kojto 115:87f2f5183dfb 382 */
Kojto 115:87f2f5183dfb 383
Kojto 115:87f2f5183dfb 384 /**
Kojto 115:87f2f5183dfb 385 * @}
Kojto 115:87f2f5183dfb 386 */
Kojto 115:87f2f5183dfb 387
Kojto 115:87f2f5183dfb 388 /* Exported macro ------------------------------------------------------------*/
Kojto 115:87f2f5183dfb 389
Kojto 115:87f2f5183dfb 390 /** @brief Reset DMA handle state
Kojto 115:87f2f5183dfb 391 * @param __HANDLE__: specifies the DMA handle.
Kojto 115:87f2f5183dfb 392 * @retval None
Kojto 115:87f2f5183dfb 393 */
Kojto 115:87f2f5183dfb 394 #define __HAL_DMA_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_DMA_STATE_RESET)
Kojto 115:87f2f5183dfb 395
Kojto 115:87f2f5183dfb 396 /**
Kojto 115:87f2f5183dfb 397 * @brief Return the current DMA Stream FIFO filled level.
Kojto 115:87f2f5183dfb 398 * @param __HANDLE__: DMA handle
Kojto 115:87f2f5183dfb 399 * @retval The FIFO filling state.
Kojto 115:87f2f5183dfb 400 * - DMA_FIFOStatus_Less1QuarterFull: when FIFO is less than 1 quarter-full
Kojto 115:87f2f5183dfb 401 * and not empty.
Kojto 115:87f2f5183dfb 402 * - DMA_FIFOStatus_1QuarterFull: if more than 1 quarter-full.
Kojto 115:87f2f5183dfb 403 * - DMA_FIFOStatus_HalfFull: if more than 1 half-full.
Kojto 115:87f2f5183dfb 404 * - DMA_FIFOStatus_3QuartersFull: if more than 3 quarters-full.
Kojto 115:87f2f5183dfb 405 * - DMA_FIFOStatus_Empty: when FIFO is empty
Kojto 115:87f2f5183dfb 406 * - DMA_FIFOStatus_Full: when FIFO is full
Kojto 115:87f2f5183dfb 407 */
Kojto 115:87f2f5183dfb 408 #define __HAL_DMA_GET_FS(__HANDLE__) (((__HANDLE__)->Instance->FCR & (DMA_SxFCR_FS)))
Kojto 115:87f2f5183dfb 409
Kojto 115:87f2f5183dfb 410 /**
Kojto 115:87f2f5183dfb 411 * @brief Enable the specified DMA Stream.
Kojto 115:87f2f5183dfb 412 * @param __HANDLE__: DMA handle
Kojto 115:87f2f5183dfb 413 * @retval None
Kojto 115:87f2f5183dfb 414 */
Kojto 115:87f2f5183dfb 415 #define __HAL_DMA_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= DMA_SxCR_EN)
Kojto 115:87f2f5183dfb 416
Kojto 115:87f2f5183dfb 417 /**
Kojto 115:87f2f5183dfb 418 * @brief Disable the specified DMA Stream.
Kojto 115:87f2f5183dfb 419 * @param __HANDLE__: DMA handle
Kojto 115:87f2f5183dfb 420 * @retval None
Kojto 115:87f2f5183dfb 421 */
Kojto 115:87f2f5183dfb 422 #define __HAL_DMA_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~DMA_SxCR_EN)
Kojto 115:87f2f5183dfb 423
Kojto 115:87f2f5183dfb 424 /* Interrupt & Flag management */
Kojto 115:87f2f5183dfb 425
Kojto 115:87f2f5183dfb 426 /**
Kojto 115:87f2f5183dfb 427 * @brief Return the current DMA Stream transfer complete flag.
Kojto 115:87f2f5183dfb 428 * @param __HANDLE__: DMA handle
Kojto 115:87f2f5183dfb 429 * @retval The specified transfer complete flag index.
Kojto 115:87f2f5183dfb 430 */
Kojto 115:87f2f5183dfb 431 #define __HAL_DMA_GET_TC_FLAG_INDEX(__HANDLE__) \
Kojto 115:87f2f5183dfb 432 (((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream0))? DMA_FLAG_TCIF0_4 :\
Kojto 115:87f2f5183dfb 433 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream0))? DMA_FLAG_TCIF0_4 :\
Kojto 115:87f2f5183dfb 434 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream4))? DMA_FLAG_TCIF0_4 :\
Kojto 115:87f2f5183dfb 435 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream4))? DMA_FLAG_TCIF0_4 :\
Kojto 115:87f2f5183dfb 436 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream1))? DMA_FLAG_TCIF1_5 :\
Kojto 115:87f2f5183dfb 437 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream1))? DMA_FLAG_TCIF1_5 :\
Kojto 115:87f2f5183dfb 438 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream5))? DMA_FLAG_TCIF1_5 :\
Kojto 115:87f2f5183dfb 439 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream5))? DMA_FLAG_TCIF1_5 :\
Kojto 115:87f2f5183dfb 440 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream2))? DMA_FLAG_TCIF2_6 :\
Kojto 115:87f2f5183dfb 441 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream2))? DMA_FLAG_TCIF2_6 :\
Kojto 115:87f2f5183dfb 442 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream6))? DMA_FLAG_TCIF2_6 :\
Kojto 115:87f2f5183dfb 443 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream6))? DMA_FLAG_TCIF2_6 :\
Kojto 115:87f2f5183dfb 444 DMA_FLAG_TCIF3_7)
Kojto 115:87f2f5183dfb 445
Kojto 115:87f2f5183dfb 446 /**
Kojto 115:87f2f5183dfb 447 * @brief Return the current DMA Stream half transfer complete flag.
Kojto 115:87f2f5183dfb 448 * @param __HANDLE__: DMA handle
Kojto 115:87f2f5183dfb 449 * @retval The specified half transfer complete flag index.
Kojto 115:87f2f5183dfb 450 */
Kojto 115:87f2f5183dfb 451 #define __HAL_DMA_GET_HT_FLAG_INDEX(__HANDLE__)\
Kojto 115:87f2f5183dfb 452 (((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream0))? DMA_FLAG_HTIF0_4 :\
Kojto 115:87f2f5183dfb 453 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream0))? DMA_FLAG_HTIF0_4 :\
Kojto 115:87f2f5183dfb 454 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream4))? DMA_FLAG_HTIF0_4 :\
Kojto 115:87f2f5183dfb 455 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream4))? DMA_FLAG_HTIF0_4 :\
Kojto 115:87f2f5183dfb 456 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream1))? DMA_FLAG_HTIF1_5 :\
Kojto 115:87f2f5183dfb 457 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream1))? DMA_FLAG_HTIF1_5 :\
Kojto 115:87f2f5183dfb 458 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream5))? DMA_FLAG_HTIF1_5 :\
Kojto 115:87f2f5183dfb 459 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream5))? DMA_FLAG_HTIF1_5 :\
Kojto 115:87f2f5183dfb 460 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream2))? DMA_FLAG_HTIF2_6 :\
Kojto 115:87f2f5183dfb 461 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream2))? DMA_FLAG_HTIF2_6 :\
Kojto 115:87f2f5183dfb 462 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream6))? DMA_FLAG_HTIF2_6 :\
Kojto 115:87f2f5183dfb 463 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream6))? DMA_FLAG_HTIF2_6 :\
Kojto 115:87f2f5183dfb 464 DMA_FLAG_HTIF3_7)
Kojto 115:87f2f5183dfb 465
Kojto 115:87f2f5183dfb 466 /**
Kojto 115:87f2f5183dfb 467 * @brief Return the current DMA Stream transfer error flag.
Kojto 115:87f2f5183dfb 468 * @param __HANDLE__: DMA handle
Kojto 115:87f2f5183dfb 469 * @retval The specified transfer error flag index.
Kojto 115:87f2f5183dfb 470 */
Kojto 115:87f2f5183dfb 471 #define __HAL_DMA_GET_TE_FLAG_INDEX(__HANDLE__)\
Kojto 115:87f2f5183dfb 472 (((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream0))? DMA_FLAG_TEIF0_4 :\
Kojto 115:87f2f5183dfb 473 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream0))? DMA_FLAG_TEIF0_4 :\
Kojto 115:87f2f5183dfb 474 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream4))? DMA_FLAG_TEIF0_4 :\
Kojto 115:87f2f5183dfb 475 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream4))? DMA_FLAG_TEIF0_4 :\
Kojto 115:87f2f5183dfb 476 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream1))? DMA_FLAG_TEIF1_5 :\
Kojto 115:87f2f5183dfb 477 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream1))? DMA_FLAG_TEIF1_5 :\
Kojto 115:87f2f5183dfb 478 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream5))? DMA_FLAG_TEIF1_5 :\
Kojto 115:87f2f5183dfb 479 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream5))? DMA_FLAG_TEIF1_5 :\
Kojto 115:87f2f5183dfb 480 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream2))? DMA_FLAG_TEIF2_6 :\
Kojto 115:87f2f5183dfb 481 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream2))? DMA_FLAG_TEIF2_6 :\
Kojto 115:87f2f5183dfb 482 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream6))? DMA_FLAG_TEIF2_6 :\
Kojto 115:87f2f5183dfb 483 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream6))? DMA_FLAG_TEIF2_6 :\
Kojto 115:87f2f5183dfb 484 DMA_FLAG_TEIF3_7)
Kojto 115:87f2f5183dfb 485
Kojto 115:87f2f5183dfb 486 /**
Kojto 115:87f2f5183dfb 487 * @brief Return the current DMA Stream FIFO error flag.
Kojto 115:87f2f5183dfb 488 * @param __HANDLE__: DMA handle
Kojto 115:87f2f5183dfb 489 * @retval The specified FIFO error flag index.
Kojto 115:87f2f5183dfb 490 */
Kojto 115:87f2f5183dfb 491 #define __HAL_DMA_GET_FE_FLAG_INDEX(__HANDLE__)\
Kojto 115:87f2f5183dfb 492 (((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream0))? DMA_FLAG_FEIF0_4 :\
Kojto 115:87f2f5183dfb 493 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream0))? DMA_FLAG_FEIF0_4 :\
Kojto 115:87f2f5183dfb 494 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream4))? DMA_FLAG_FEIF0_4 :\
Kojto 115:87f2f5183dfb 495 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream4))? DMA_FLAG_FEIF0_4 :\
Kojto 115:87f2f5183dfb 496 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream1))? DMA_FLAG_FEIF1_5 :\
Kojto 115:87f2f5183dfb 497 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream1))? DMA_FLAG_FEIF1_5 :\
Kojto 115:87f2f5183dfb 498 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream5))? DMA_FLAG_FEIF1_5 :\
Kojto 115:87f2f5183dfb 499 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream5))? DMA_FLAG_FEIF1_5 :\
Kojto 115:87f2f5183dfb 500 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream2))? DMA_FLAG_FEIF2_6 :\
Kojto 115:87f2f5183dfb 501 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream2))? DMA_FLAG_FEIF2_6 :\
Kojto 115:87f2f5183dfb 502 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream6))? DMA_FLAG_FEIF2_6 :\
Kojto 115:87f2f5183dfb 503 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream6))? DMA_FLAG_FEIF2_6 :\
Kojto 115:87f2f5183dfb 504 DMA_FLAG_FEIF3_7)
Kojto 115:87f2f5183dfb 505
Kojto 115:87f2f5183dfb 506 /**
Kojto 115:87f2f5183dfb 507 * @brief Return the current DMA Stream direct mode error flag.
Kojto 115:87f2f5183dfb 508 * @param __HANDLE__: DMA handle
Kojto 115:87f2f5183dfb 509 * @retval The specified direct mode error flag index.
Kojto 115:87f2f5183dfb 510 */
Kojto 115:87f2f5183dfb 511 #define __HAL_DMA_GET_DME_FLAG_INDEX(__HANDLE__)\
Kojto 115:87f2f5183dfb 512 (((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream0))? DMA_FLAG_DMEIF0_4 :\
Kojto 115:87f2f5183dfb 513 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream0))? DMA_FLAG_DMEIF0_4 :\
Kojto 115:87f2f5183dfb 514 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream4))? DMA_FLAG_DMEIF0_4 :\
Kojto 115:87f2f5183dfb 515 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream4))? DMA_FLAG_DMEIF0_4 :\
Kojto 115:87f2f5183dfb 516 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream1))? DMA_FLAG_DMEIF1_5 :\
Kojto 115:87f2f5183dfb 517 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream1))? DMA_FLAG_DMEIF1_5 :\
Kojto 115:87f2f5183dfb 518 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream5))? DMA_FLAG_DMEIF1_5 :\
Kojto 115:87f2f5183dfb 519 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream5))? DMA_FLAG_DMEIF1_5 :\
Kojto 115:87f2f5183dfb 520 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream2))? DMA_FLAG_DMEIF2_6 :\
Kojto 115:87f2f5183dfb 521 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream2))? DMA_FLAG_DMEIF2_6 :\
Kojto 115:87f2f5183dfb 522 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream6))? DMA_FLAG_DMEIF2_6 :\
Kojto 115:87f2f5183dfb 523 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream6))? DMA_FLAG_DMEIF2_6 :\
Kojto 115:87f2f5183dfb 524 DMA_FLAG_DMEIF3_7)
Kojto 115:87f2f5183dfb 525
Kojto 115:87f2f5183dfb 526 /**
Kojto 115:87f2f5183dfb 527 * @brief Get the DMA Stream pending flags.
Kojto 115:87f2f5183dfb 528 * @param __HANDLE__: DMA handle
Kojto 115:87f2f5183dfb 529 * @param __FLAG__: Get the specified flag.
Kojto 115:87f2f5183dfb 530 * This parameter can be any combination of the following values:
Kojto 115:87f2f5183dfb 531 * @arg DMA_FLAG_TCIFx: Transfer complete flag.
Kojto 115:87f2f5183dfb 532 * @arg DMA_FLAG_HTIFx: Half transfer complete flag.
Kojto 115:87f2f5183dfb 533 * @arg DMA_FLAG_TEIFx: Transfer error flag.
Kojto 115:87f2f5183dfb 534 * @arg DMA_FLAG_DMEIFx: Direct mode error flag.
Kojto 115:87f2f5183dfb 535 * @arg DMA_FLAG_FEIFx: FIFO error flag.
Kojto 115:87f2f5183dfb 536 * Where x can be 0_4, 1_5, 2_6 or 3_7 to select the DMA Stream flag.
Kojto 115:87f2f5183dfb 537 * @retval The state of FLAG (SET or RESET).
Kojto 115:87f2f5183dfb 538 */
Kojto 115:87f2f5183dfb 539 #define __HAL_DMA_GET_FLAG(__HANDLE__, __FLAG__)\
Kojto 115:87f2f5183dfb 540 (((uint32_t)((__HANDLE__)->Instance) > (uint32_t)DMA2_Stream3)? (DMA2->HISR & (__FLAG__)) :\
Kojto 115:87f2f5183dfb 541 ((uint32_t)((__HANDLE__)->Instance) > (uint32_t)DMA1_Stream7)? (DMA2->LISR & (__FLAG__)) :\
Kojto 115:87f2f5183dfb 542 ((uint32_t)((__HANDLE__)->Instance) > (uint32_t)DMA1_Stream3)? (DMA1->HISR & (__FLAG__)) : (DMA1->LISR & (__FLAG__)))
Kojto 115:87f2f5183dfb 543
Kojto 115:87f2f5183dfb 544 /**
Kojto 115:87f2f5183dfb 545 * @brief Clear the DMA Stream pending flags.
Kojto 115:87f2f5183dfb 546 * @param __HANDLE__: DMA handle
Kojto 115:87f2f5183dfb 547 * @param __FLAG__: specifies the flag to clear.
Kojto 115:87f2f5183dfb 548 * This parameter can be any combination of the following values:
Kojto 115:87f2f5183dfb 549 * @arg DMA_FLAG_TCIFx: Transfer complete flag.
Kojto 115:87f2f5183dfb 550 * @arg DMA_FLAG_HTIFx: Half transfer complete flag.
Kojto 115:87f2f5183dfb 551 * @arg DMA_FLAG_TEIFx: Transfer error flag.
Kojto 115:87f2f5183dfb 552 * @arg DMA_FLAG_DMEIFx: Direct mode error flag.
Kojto 115:87f2f5183dfb 553 * @arg DMA_FLAG_FEIFx: FIFO error flag.
Kojto 115:87f2f5183dfb 554 * Where x can be 0_4, 1_5, 2_6 or 3_7 to select the DMA Stream flag.
Kojto 115:87f2f5183dfb 555 * @retval None
Kojto 115:87f2f5183dfb 556 */
Kojto 115:87f2f5183dfb 557 #define __HAL_DMA_CLEAR_FLAG(__HANDLE__, __FLAG__) \
Kojto 115:87f2f5183dfb 558 (((uint32_t)((__HANDLE__)->Instance) > (uint32_t)DMA2_Stream3)? (DMA2->HIFCR = (__FLAG__)) :\
Kojto 115:87f2f5183dfb 559 ((uint32_t)((__HANDLE__)->Instance) > (uint32_t)DMA1_Stream7)? (DMA2->LIFCR = (__FLAG__)) :\
Kojto 115:87f2f5183dfb 560 ((uint32_t)((__HANDLE__)->Instance) > (uint32_t)DMA1_Stream3)? (DMA1->HIFCR = (__FLAG__)) : (DMA1->LIFCR = (__FLAG__)))
Kojto 115:87f2f5183dfb 561
Kojto 115:87f2f5183dfb 562 /**
Kojto 115:87f2f5183dfb 563 * @brief Enable the specified DMA Stream interrupts.
Kojto 115:87f2f5183dfb 564 * @param __HANDLE__: DMA handle
Kojto 115:87f2f5183dfb 565 * @param __INTERRUPT__: specifies the DMA interrupt sources to be enabled or disabled.
Kojto 115:87f2f5183dfb 566 * This parameter can be any combination of the following values:
Kojto 115:87f2f5183dfb 567 * @arg DMA_IT_TC: Transfer complete interrupt mask.
Kojto 115:87f2f5183dfb 568 * @arg DMA_IT_HT: Half transfer complete interrupt mask.
Kojto 115:87f2f5183dfb 569 * @arg DMA_IT_TE: Transfer error interrupt mask.
Kojto 115:87f2f5183dfb 570 * @arg DMA_IT_FE: FIFO error interrupt mask.
Kojto 115:87f2f5183dfb 571 * @arg DMA_IT_DME: Direct mode error interrupt.
Kojto 115:87f2f5183dfb 572 * @retval None
Kojto 115:87f2f5183dfb 573 */
Kojto 115:87f2f5183dfb 574 #define __HAL_DMA_ENABLE_IT(__HANDLE__, __INTERRUPT__) (((__INTERRUPT__) != DMA_IT_FE)? \
Kojto 115:87f2f5183dfb 575 ((__HANDLE__)->Instance->CR |= (__INTERRUPT__)) : ((__HANDLE__)->Instance->FCR |= (__INTERRUPT__)))
Kojto 115:87f2f5183dfb 576
Kojto 115:87f2f5183dfb 577 /**
Kojto 115:87f2f5183dfb 578 * @brief Disable the specified DMA Stream interrupts.
Kojto 115:87f2f5183dfb 579 * @param __HANDLE__: DMA handle
Kojto 115:87f2f5183dfb 580 * @param __INTERRUPT__: specifies the DMA interrupt sources to be enabled or disabled.
Kojto 115:87f2f5183dfb 581 * This parameter can be any combination of the following values:
Kojto 115:87f2f5183dfb 582 * @arg DMA_IT_TC: Transfer complete interrupt mask.
Kojto 115:87f2f5183dfb 583 * @arg DMA_IT_HT: Half transfer complete interrupt mask.
Kojto 115:87f2f5183dfb 584 * @arg DMA_IT_TE: Transfer error interrupt mask.
Kojto 115:87f2f5183dfb 585 * @arg DMA_IT_FE: FIFO error interrupt mask.
Kojto 115:87f2f5183dfb 586 * @arg DMA_IT_DME: Direct mode error interrupt.
Kojto 115:87f2f5183dfb 587 * @retval None
Kojto 115:87f2f5183dfb 588 */
Kojto 115:87f2f5183dfb 589 #define __HAL_DMA_DISABLE_IT(__HANDLE__, __INTERRUPT__) (((__INTERRUPT__) != DMA_IT_FE)? \
Kojto 115:87f2f5183dfb 590 ((__HANDLE__)->Instance->CR &= ~(__INTERRUPT__)) : ((__HANDLE__)->Instance->FCR &= ~(__INTERRUPT__)))
Kojto 115:87f2f5183dfb 591
Kojto 115:87f2f5183dfb 592 /**
Kojto 115:87f2f5183dfb 593 * @brief Check whether the specified DMA Stream interrupt is enabled or not.
Kojto 115:87f2f5183dfb 594 * @param __HANDLE__: DMA handle
Kojto 115:87f2f5183dfb 595 * @param __INTERRUPT__: specifies the DMA interrupt source to check.
Kojto 115:87f2f5183dfb 596 * This parameter can be one of the following values:
Kojto 115:87f2f5183dfb 597 * @arg DMA_IT_TC: Transfer complete interrupt mask.
Kojto 115:87f2f5183dfb 598 * @arg DMA_IT_HT: Half transfer complete interrupt mask.
Kojto 115:87f2f5183dfb 599 * @arg DMA_IT_TE: Transfer error interrupt mask.
Kojto 115:87f2f5183dfb 600 * @arg DMA_IT_FE: FIFO error interrupt mask.
Kojto 115:87f2f5183dfb 601 * @arg DMA_IT_DME: Direct mode error interrupt.
Kojto 115:87f2f5183dfb 602 * @retval The state of DMA_IT.
Kojto 115:87f2f5183dfb 603 */
Kojto 115:87f2f5183dfb 604 #define __HAL_DMA_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((__INTERRUPT__) != DMA_IT_FE)? \
Kojto 115:87f2f5183dfb 605 ((__HANDLE__)->Instance->CR & (__INTERRUPT__)) : \
Kojto 115:87f2f5183dfb 606 ((__HANDLE__)->Instance->FCR & (__INTERRUPT__)))
Kojto 115:87f2f5183dfb 607
Kojto 115:87f2f5183dfb 608 /**
Kojto 115:87f2f5183dfb 609 * @brief Writes the number of data units to be transferred on the DMA Stream.
Kojto 115:87f2f5183dfb 610 * @param __HANDLE__: DMA handle
Kojto 115:87f2f5183dfb 611 * @param __COUNTER__: Number of data units to be transferred (from 0 to 65535)
Kojto 115:87f2f5183dfb 612 * Number of data items depends only on the Peripheral data format.
Kojto 115:87f2f5183dfb 613 *
Kojto 115:87f2f5183dfb 614 * @note If Peripheral data format is Bytes: number of data units is equal
Kojto 115:87f2f5183dfb 615 * to total number of bytes to be transferred.
Kojto 115:87f2f5183dfb 616 *
Kojto 115:87f2f5183dfb 617 * @note If Peripheral data format is Half-Word: number of data units is
Kojto 115:87f2f5183dfb 618 * equal to total number of bytes to be transferred / 2.
Kojto 115:87f2f5183dfb 619 *
Kojto 115:87f2f5183dfb 620 * @note If Peripheral data format is Word: number of data units is equal
Kojto 115:87f2f5183dfb 621 * to total number of bytes to be transferred / 4.
Kojto 115:87f2f5183dfb 622 *
Kojto 115:87f2f5183dfb 623 * @retval The number of remaining data units in the current DMAy Streamx transfer.
Kojto 115:87f2f5183dfb 624 */
Kojto 115:87f2f5183dfb 625 #define __HAL_DMA_SET_COUNTER(__HANDLE__, __COUNTER__) ((__HANDLE__)->Instance->NDTR = (uint16_t)(__COUNTER__))
Kojto 115:87f2f5183dfb 626
Kojto 115:87f2f5183dfb 627 /**
Kojto 115:87f2f5183dfb 628 * @brief Returns the number of remaining data units in the current DMAy Streamx transfer.
Kojto 115:87f2f5183dfb 629 * @param __HANDLE__: DMA handle
Kojto 115:87f2f5183dfb 630 *
Kojto 115:87f2f5183dfb 631 * @retval The number of remaining data units in the current DMA Stream transfer.
Kojto 115:87f2f5183dfb 632 */
Kojto 115:87f2f5183dfb 633 #define __HAL_DMA_GET_COUNTER(__HANDLE__) ((__HANDLE__)->Instance->NDTR)
Kojto 115:87f2f5183dfb 634
Kojto 115:87f2f5183dfb 635
Kojto 115:87f2f5183dfb 636 /* Include DMA HAL Extension module */
Kojto 115:87f2f5183dfb 637 #include "stm32f7xx_hal_dma_ex.h"
Kojto 115:87f2f5183dfb 638
Kojto 115:87f2f5183dfb 639 /* Exported functions --------------------------------------------------------*/
Kojto 115:87f2f5183dfb 640
Kojto 115:87f2f5183dfb 641 /** @defgroup DMA_Exported_Functions DMA Exported Functions
Kojto 115:87f2f5183dfb 642 * @brief DMA Exported functions
Kojto 115:87f2f5183dfb 643 * @{
Kojto 115:87f2f5183dfb 644 */
Kojto 115:87f2f5183dfb 645
Kojto 115:87f2f5183dfb 646 /** @defgroup DMA_Exported_Functions_Group1 Initialization and de-initialization functions
Kojto 115:87f2f5183dfb 647 * @brief Initialization and de-initialization functions
Kojto 115:87f2f5183dfb 648 * @{
Kojto 115:87f2f5183dfb 649 */
Kojto 115:87f2f5183dfb 650 HAL_StatusTypeDef HAL_DMA_Init(DMA_HandleTypeDef *hdma);
Kojto 115:87f2f5183dfb 651 HAL_StatusTypeDef HAL_DMA_DeInit(DMA_HandleTypeDef *hdma);
Kojto 115:87f2f5183dfb 652 /**
Kojto 115:87f2f5183dfb 653 * @}
Kojto 115:87f2f5183dfb 654 */
Kojto 115:87f2f5183dfb 655
Kojto 115:87f2f5183dfb 656 /** @defgroup DMA_Exported_Functions_Group2 I/O operation functions
Kojto 115:87f2f5183dfb 657 * @brief I/O operation functions
Kojto 115:87f2f5183dfb 658 * @{
Kojto 115:87f2f5183dfb 659 */
Kojto 115:87f2f5183dfb 660 HAL_StatusTypeDef HAL_DMA_Start (DMA_HandleTypeDef *hdma, uint32_t SrcAddress, uint32_t DstAddress, uint32_t DataLength);
Kojto 115:87f2f5183dfb 661 HAL_StatusTypeDef HAL_DMA_Start_IT(DMA_HandleTypeDef *hdma, uint32_t SrcAddress, uint32_t DstAddress, uint32_t DataLength);
Kojto 115:87f2f5183dfb 662 HAL_StatusTypeDef HAL_DMA_Abort(DMA_HandleTypeDef *hdma);
Kojto 115:87f2f5183dfb 663 HAL_StatusTypeDef HAL_DMA_PollForTransfer(DMA_HandleTypeDef *hdma, uint32_t CompleteLevel, uint32_t Timeout);
Kojto 115:87f2f5183dfb 664 void HAL_DMA_IRQHandler(DMA_HandleTypeDef *hdma);
Kojto 115:87f2f5183dfb 665 /**
Kojto 115:87f2f5183dfb 666 * @}
Kojto 115:87f2f5183dfb 667 */
Kojto 115:87f2f5183dfb 668
Kojto 115:87f2f5183dfb 669 /** @defgroup DMA_Exported_Functions_Group3 Peripheral State functions
Kojto 115:87f2f5183dfb 670 * @brief Peripheral State functions
Kojto 115:87f2f5183dfb 671 * @{
Kojto 115:87f2f5183dfb 672 */
Kojto 115:87f2f5183dfb 673 HAL_DMA_StateTypeDef HAL_DMA_GetState(DMA_HandleTypeDef *hdma);
Kojto 115:87f2f5183dfb 674 uint32_t HAL_DMA_GetError(DMA_HandleTypeDef *hdma);
Kojto 115:87f2f5183dfb 675 /**
Kojto 115:87f2f5183dfb 676 * @}
Kojto 115:87f2f5183dfb 677 */
Kojto 115:87f2f5183dfb 678 /**
Kojto 115:87f2f5183dfb 679 * @}
Kojto 115:87f2f5183dfb 680 */
Kojto 115:87f2f5183dfb 681 /* Private Constants -------------------------------------------------------------*/
Kojto 115:87f2f5183dfb 682 /** @defgroup DMA_Private_Constants DMA Private Constants
Kojto 115:87f2f5183dfb 683 * @brief DMA private defines and constants
Kojto 115:87f2f5183dfb 684 * @{
Kojto 115:87f2f5183dfb 685 */
Kojto 115:87f2f5183dfb 686 /**
Kojto 115:87f2f5183dfb 687 * @}
Kojto 115:87f2f5183dfb 688 */
Kojto 115:87f2f5183dfb 689
Kojto 115:87f2f5183dfb 690 /* Private macros ------------------------------------------------------------*/
Kojto 115:87f2f5183dfb 691 /** @defgroup DMA_Private_Macros DMA Private Macros
Kojto 115:87f2f5183dfb 692 * @brief DMA private macros
Kojto 115:87f2f5183dfb 693 * @{
Kojto 115:87f2f5183dfb 694 */
Kojto 115:87f2f5183dfb 695 #define IS_DMA_CHANNEL(CHANNEL) (((CHANNEL) == DMA_CHANNEL_0) || \
Kojto 115:87f2f5183dfb 696 ((CHANNEL) == DMA_CHANNEL_1) || \
Kojto 115:87f2f5183dfb 697 ((CHANNEL) == DMA_CHANNEL_2) || \
Kojto 115:87f2f5183dfb 698 ((CHANNEL) == DMA_CHANNEL_3) || \
Kojto 115:87f2f5183dfb 699 ((CHANNEL) == DMA_CHANNEL_4) || \
Kojto 115:87f2f5183dfb 700 ((CHANNEL) == DMA_CHANNEL_5) || \
Kojto 115:87f2f5183dfb 701 ((CHANNEL) == DMA_CHANNEL_6) || \
Kojto 115:87f2f5183dfb 702 ((CHANNEL) == DMA_CHANNEL_7))
Kojto 115:87f2f5183dfb 703
Kojto 115:87f2f5183dfb 704 #define IS_DMA_DIRECTION(DIRECTION) (((DIRECTION) == DMA_PERIPH_TO_MEMORY ) || \
Kojto 115:87f2f5183dfb 705 ((DIRECTION) == DMA_MEMORY_TO_PERIPH) || \
Kojto 115:87f2f5183dfb 706 ((DIRECTION) == DMA_MEMORY_TO_MEMORY))
Kojto 115:87f2f5183dfb 707
Kojto 115:87f2f5183dfb 708 #define IS_DMA_BUFFER_SIZE(SIZE) (((SIZE) >= 0x1) && ((SIZE) < 0x10000))
Kojto 115:87f2f5183dfb 709
Kojto 115:87f2f5183dfb 710 #define IS_DMA_PERIPHERAL_INC_STATE(STATE) (((STATE) == DMA_PINC_ENABLE) || \
Kojto 115:87f2f5183dfb 711 ((STATE) == DMA_PINC_DISABLE))
Kojto 115:87f2f5183dfb 712
Kojto 115:87f2f5183dfb 713 #define IS_DMA_MEMORY_INC_STATE(STATE) (((STATE) == DMA_MINC_ENABLE) || \
Kojto 115:87f2f5183dfb 714 ((STATE) == DMA_MINC_DISABLE))
Kojto 115:87f2f5183dfb 715
Kojto 115:87f2f5183dfb 716 #define IS_DMA_PERIPHERAL_DATA_SIZE(SIZE) (((SIZE) == DMA_PDATAALIGN_BYTE) || \
Kojto 115:87f2f5183dfb 717 ((SIZE) == DMA_PDATAALIGN_HALFWORD) || \
Kojto 115:87f2f5183dfb 718 ((SIZE) == DMA_PDATAALIGN_WORD))
Kojto 115:87f2f5183dfb 719
Kojto 115:87f2f5183dfb 720 #define IS_DMA_MEMORY_DATA_SIZE(SIZE) (((SIZE) == DMA_MDATAALIGN_BYTE) || \
Kojto 115:87f2f5183dfb 721 ((SIZE) == DMA_MDATAALIGN_HALFWORD) || \
Kojto 115:87f2f5183dfb 722 ((SIZE) == DMA_MDATAALIGN_WORD ))
Kojto 115:87f2f5183dfb 723
Kojto 115:87f2f5183dfb 724 #define IS_DMA_MODE(MODE) (((MODE) == DMA_NORMAL ) || \
Kojto 115:87f2f5183dfb 725 ((MODE) == DMA_CIRCULAR) || \
Kojto 115:87f2f5183dfb 726 ((MODE) == DMA_PFCTRL))
Kojto 115:87f2f5183dfb 727
Kojto 115:87f2f5183dfb 728 #define IS_DMA_PRIORITY(PRIORITY) (((PRIORITY) == DMA_PRIORITY_LOW ) || \
Kojto 115:87f2f5183dfb 729 ((PRIORITY) == DMA_PRIORITY_MEDIUM) || \
Kojto 115:87f2f5183dfb 730 ((PRIORITY) == DMA_PRIORITY_HIGH) || \
Kojto 115:87f2f5183dfb 731 ((PRIORITY) == DMA_PRIORITY_VERY_HIGH))
Kojto 115:87f2f5183dfb 732
Kojto 115:87f2f5183dfb 733 #define IS_DMA_FIFO_MODE_STATE(STATE) (((STATE) == DMA_FIFOMODE_DISABLE ) || \
Kojto 115:87f2f5183dfb 734 ((STATE) == DMA_FIFOMODE_ENABLE))
Kojto 115:87f2f5183dfb 735
Kojto 115:87f2f5183dfb 736 #define IS_DMA_FIFO_THRESHOLD(THRESHOLD) (((THRESHOLD) == DMA_FIFO_THRESHOLD_1QUARTERFULL ) || \
Kojto 115:87f2f5183dfb 737 ((THRESHOLD) == DMA_FIFO_THRESHOLD_HALFFULL) || \
Kojto 115:87f2f5183dfb 738 ((THRESHOLD) == DMA_FIFO_THRESHOLD_3QUARTERSFULL) || \
Kojto 115:87f2f5183dfb 739 ((THRESHOLD) == DMA_FIFO_THRESHOLD_FULL))
Kojto 115:87f2f5183dfb 740
Kojto 115:87f2f5183dfb 741 #define IS_DMA_MEMORY_BURST(BURST) (((BURST) == DMA_MBURST_SINGLE) || \
Kojto 115:87f2f5183dfb 742 ((BURST) == DMA_MBURST_INC4) || \
Kojto 115:87f2f5183dfb 743 ((BURST) == DMA_MBURST_INC8) || \
Kojto 115:87f2f5183dfb 744 ((BURST) == DMA_MBURST_INC16))
Kojto 115:87f2f5183dfb 745
Kojto 115:87f2f5183dfb 746 #define IS_DMA_PERIPHERAL_BURST(BURST) (((BURST) == DMA_PBURST_SINGLE) || \
Kojto 115:87f2f5183dfb 747 ((BURST) == DMA_PBURST_INC4) || \
Kojto 115:87f2f5183dfb 748 ((BURST) == DMA_PBURST_INC8) || \
Kojto 115:87f2f5183dfb 749 ((BURST) == DMA_PBURST_INC16))
Kojto 115:87f2f5183dfb 750 /**
Kojto 115:87f2f5183dfb 751 * @}
Kojto 115:87f2f5183dfb 752 */
Kojto 115:87f2f5183dfb 753
Kojto 115:87f2f5183dfb 754 /* Private functions ---------------------------------------------------------*/
Kojto 115:87f2f5183dfb 755 /** @defgroup DMA_Private_Functions DMA Private Functions
Kojto 115:87f2f5183dfb 756 * @brief DMA private functions
Kojto 115:87f2f5183dfb 757 * @{
Kojto 115:87f2f5183dfb 758 */
Kojto 115:87f2f5183dfb 759 /**
Kojto 115:87f2f5183dfb 760 * @}
Kojto 115:87f2f5183dfb 761 */
Kojto 115:87f2f5183dfb 762
Kojto 115:87f2f5183dfb 763 /**
Kojto 115:87f2f5183dfb 764 * @}
Kojto 115:87f2f5183dfb 765 */
Kojto 115:87f2f5183dfb 766
Kojto 115:87f2f5183dfb 767 /**
Kojto 115:87f2f5183dfb 768 * @}
Kojto 115:87f2f5183dfb 769 */
Kojto 115:87f2f5183dfb 770
Kojto 115:87f2f5183dfb 771 #ifdef __cplusplus
Kojto 115:87f2f5183dfb 772 }
Kojto 115:87f2f5183dfb 773 #endif
Kojto 115:87f2f5183dfb 774
Kojto 115:87f2f5183dfb 775 #endif /* __STM32F7xx_HAL_DMA_H */
Kojto 115:87f2f5183dfb 776
Kojto 115:87f2f5183dfb 777 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/