cc y / mbed

Fork of mbed by mbed official

Committer:
Kojto
Date:
Thu Jul 07 14:34:11 2016 +0100
Revision:
122:f9eeca106725
Parent:
116:c0f6e94411f5
Release 122 of the mbed library

Changes:
- new targets - Nucleo L432KC, Beetle, Nucleo F446ZE, Nucleo L011K4
- Thread safety addition - mbed API should contain a statement about thread safety
- critical section API addition
- CAS API (core_util_atomic_incr/decr)
- DEVICE_ are generated from targets.json file, device.h deprecated
- Callback replaces FunctionPointer to provide std like interface
- mbed HAL API docs improvements
- toolchain - prexif attributes with MBED_
- add new attributes - packed, weak, forcedinline, align
- target.json - contains targets definitions
- ST - L1XX - Cube update to 1.5
- SPI clock selection fix (clock from APB domain)
- F7 - Cube update v1.4.0
- L0 - baudrate init fix
- L1 - Cube update v1.5
- F3 - baudrate init fix, 3 targets CAN support
- F4 - Cube update v1.12.0, 3 targets CAN support
- L4XX - Cube update v1.5.1
- F0 - update Cube to v1.5.0
- L4 - 2 targets (L476RG/VG) CAN support
- NXP - pwm clock fix for KSDK2 MCU
- LPC2368 - remove ARM toolchain support - due to regression
- KSDK2 - fix SPI , I2C address and repeat start
- Silabs - some fixes backported from mbed 3
- Renesas - RZ_A1H - SystemCoreClockUpdate addition

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 122:f9eeca106725 5 * @version V1.1.0
Kojto 122:f9eeca106725 6 * @date 22-April-2016
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 122:f9eeca106725 11 * <h2><center>&copy; COPYRIGHT(c) 2016 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 122:f9eeca106725 70 This parameter can be a value of @ref DMAEx_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 122:f9eeca106725 122 HAL_DMA_STATE_RESET = 0x00U, /*!< DMA not yet initialized or disabled */
Kojto 122:f9eeca106725 123 HAL_DMA_STATE_READY = 0x01U, /*!< DMA initialized and ready for use */
Kojto 122:f9eeca106725 124 HAL_DMA_STATE_BUSY = 0x02U, /*!< DMA process is ongoing */
Kojto 122:f9eeca106725 125 HAL_DMA_STATE_TIMEOUT = 0x03U, /*!< DMA timeout state */
Kojto 122:f9eeca106725 126 HAL_DMA_STATE_ERROR = 0x04U, /*!< DMA error state */
Kojto 122:f9eeca106725 127 HAL_DMA_STATE_ABORT = 0x05U, /*!< DMA Abort state */
Kojto 115:87f2f5183dfb 128 }HAL_DMA_StateTypeDef;
Kojto 115:87f2f5183dfb 129
Kojto 115:87f2f5183dfb 130 /**
Kojto 115:87f2f5183dfb 131 * @brief HAL DMA Error Code structure definition
Kojto 115:87f2f5183dfb 132 */
Kojto 115:87f2f5183dfb 133 typedef enum
Kojto 115:87f2f5183dfb 134 {
Kojto 122:f9eeca106725 135 HAL_DMA_FULL_TRANSFER = 0x00U, /*!< Full transfer */
Kojto 122:f9eeca106725 136 HAL_DMA_HALF_TRANSFER = 0x01U, /*!< Half Transfer */
Kojto 115:87f2f5183dfb 137 }HAL_DMA_LevelCompleteTypeDef;
Kojto 115:87f2f5183dfb 138
Kojto 115:87f2f5183dfb 139 /**
Kojto 122:f9eeca106725 140 * @brief HAL DMA Error Code structure definition
Kojto 122:f9eeca106725 141 */
Kojto 122:f9eeca106725 142 typedef enum
Kojto 122:f9eeca106725 143 {
Kojto 122:f9eeca106725 144 HAL_DMA_XFER_CPLT_CB_ID = 0x00U, /*!< Full transfer */
Kojto 122:f9eeca106725 145 HAL_DMA_XFER_HALFCPLT_CB_ID = 0x01U, /*!< Half Transfer */
Kojto 122:f9eeca106725 146 HAL_DMA_XFER_M1CPLT_CB_ID = 0x02U, /*!< M1 Full Transfer */
Kojto 122:f9eeca106725 147 HAL_DMA_XFER_M1HALFCPLT_CB_ID = 0x03U, /*!< M1 Half Transfer */
Kojto 122:f9eeca106725 148 HAL_DMA_XFER_ERROR_CB_ID = 0x04U, /*!< Error */
Kojto 122:f9eeca106725 149 HAL_DMA_XFER_ABORT_CB_ID = 0x05U, /*!< Abort */
Kojto 122:f9eeca106725 150 HAL_DMA_XFER_ALL_CB_ID = 0x06U /*!< All */
Kojto 122:f9eeca106725 151 }HAL_DMA_CallbackIDTypeDef;
Kojto 122:f9eeca106725 152
Kojto 122:f9eeca106725 153 /**
Kojto 115:87f2f5183dfb 154 * @brief DMA handle Structure definition
Kojto 115:87f2f5183dfb 155 */
Kojto 115:87f2f5183dfb 156 typedef struct __DMA_HandleTypeDef
Kojto 115:87f2f5183dfb 157 {
Kojto 115:87f2f5183dfb 158 DMA_Stream_TypeDef *Instance; /*!< Register base address */
Kojto 115:87f2f5183dfb 159
Kojto 115:87f2f5183dfb 160 DMA_InitTypeDef Init; /*!< DMA communication parameters */
Kojto 115:87f2f5183dfb 161
Kojto 115:87f2f5183dfb 162 HAL_LockTypeDef Lock; /*!< DMA locking object */
Kojto 115:87f2f5183dfb 163
Kojto 115:87f2f5183dfb 164 __IO HAL_DMA_StateTypeDef State; /*!< DMA transfer state */
Kojto 115:87f2f5183dfb 165
Kojto 122:f9eeca106725 166 void *Parent; /*!< Parent object state */
Kojto 115:87f2f5183dfb 167
Kojto 115:87f2f5183dfb 168 void (* XferCpltCallback)( struct __DMA_HandleTypeDef * hdma); /*!< DMA transfer complete callback */
Kojto 115:87f2f5183dfb 169
Kojto 115:87f2f5183dfb 170 void (* XferHalfCpltCallback)( struct __DMA_HandleTypeDef * hdma); /*!< DMA Half transfer complete callback */
Kojto 115:87f2f5183dfb 171
Kojto 115:87f2f5183dfb 172 void (* XferM1CpltCallback)( struct __DMA_HandleTypeDef * hdma); /*!< DMA transfer complete Memory1 callback */
Kojto 122:f9eeca106725 173
Kojto 122:f9eeca106725 174 void (* XferM1HalfCpltCallback)( struct __DMA_HandleTypeDef * hdma); /*!< DMA transfer Half complete Memory1 callback */
Kojto 122:f9eeca106725 175
Kojto 115:87f2f5183dfb 176 void (* XferErrorCallback)( struct __DMA_HandleTypeDef * hdma); /*!< DMA transfer error callback */
Kojto 122:f9eeca106725 177
Kojto 122:f9eeca106725 178 void (* XferAbortCallback)( struct __DMA_HandleTypeDef * hdma); /*!< DMA transfer Abort callback */
Kojto 115:87f2f5183dfb 179
Kojto 122:f9eeca106725 180 __IO uint32_t ErrorCode; /*!< DMA Error code */
Kojto 122:f9eeca106725 181
Kojto 116:c0f6e94411f5 182 uint32_t StreamBaseAddress; /*!< DMA Stream Base Address */
Kojto 116:c0f6e94411f5 183
Kojto 116:c0f6e94411f5 184 uint32_t StreamIndex; /*!< DMA Stream Index */
Kojto 116:c0f6e94411f5 185
Kojto 115:87f2f5183dfb 186 }DMA_HandleTypeDef;
Kojto 115:87f2f5183dfb 187
Kojto 115:87f2f5183dfb 188 /**
Kojto 115:87f2f5183dfb 189 * @}
Kojto 115:87f2f5183dfb 190 */
Kojto 115:87f2f5183dfb 191
Kojto 115:87f2f5183dfb 192
Kojto 115:87f2f5183dfb 193 /* Exported constants --------------------------------------------------------*/
Kojto 115:87f2f5183dfb 194
Kojto 115:87f2f5183dfb 195 /** @defgroup DMA_Exported_Constants DMA Exported Constants
Kojto 115:87f2f5183dfb 196 * @brief DMA Exported constants
Kojto 115:87f2f5183dfb 197 * @{
Kojto 115:87f2f5183dfb 198 */
Kojto 115:87f2f5183dfb 199
Kojto 115:87f2f5183dfb 200 /** @defgroup DMA_Error_Code DMA Error Code
Kojto 115:87f2f5183dfb 201 * @brief DMA Error Code
Kojto 115:87f2f5183dfb 202 * @{
Kojto 115:87f2f5183dfb 203 */
Kojto 122:f9eeca106725 204 #define HAL_DMA_ERROR_NONE ((uint32_t)0x00000000U) /*!< No error */
Kojto 122:f9eeca106725 205 #define HAL_DMA_ERROR_TE ((uint32_t)0x00000001U) /*!< Transfer error */
Kojto 122:f9eeca106725 206 #define HAL_DMA_ERROR_FE ((uint32_t)0x00000002U) /*!< FIFO error */
Kojto 122:f9eeca106725 207 #define HAL_DMA_ERROR_DME ((uint32_t)0x00000004U) /*!< Direct Mode error */
Kojto 122:f9eeca106725 208 #define HAL_DMA_ERROR_TIMEOUT ((uint32_t)0x00000020U) /*!< Timeout error */
Kojto 122:f9eeca106725 209 #define HAL_DMA_ERROR_PARAM ((uint32_t)0x00000040U) /*!< Parameter error */
Kojto 122:f9eeca106725 210 #define HAL_DMA_ERROR_NO_XFER ((uint32_t)0x00000080U) /*!< Abort requested with no Xfer ongoing */
Kojto 122:f9eeca106725 211 #define HAL_DMA_ERROR_NOT_SUPPORTED ((uint32_t)0x00000100U) /*!< Not supported mode */
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 122:f9eeca106725 220 #define DMA_PERIPH_TO_MEMORY ((uint32_t)0x00000000U) /*!< 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 122:f9eeca106725 232 #define DMA_PINC_DISABLE ((uint32_t)0x00000000U) /*!< 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 122:f9eeca106725 242 #define DMA_MINC_DISABLE ((uint32_t)0x00000000U) /*!< Memory increment mode disable */
Kojto 115:87f2f5183dfb 243 /**
Kojto 115:87f2f5183dfb 244 * @}
Kojto 115:87f2f5183dfb 245 */
Kojto 115:87f2f5183dfb 246
Kojto 115:87f2f5183dfb 247 /** @defgroup DMA_Peripheral_data_size DMA Peripheral data size
Kojto 115:87f2f5183dfb 248 * @brief DMA peripheral data size
Kojto 115:87f2f5183dfb 249 * @{
Kojto 115:87f2f5183dfb 250 */
Kojto 122:f9eeca106725 251 #define DMA_PDATAALIGN_BYTE ((uint32_t)0x00000000U) /*!< Peripheral data alignment: Byte */
Kojto 115:87f2f5183dfb 252 #define DMA_PDATAALIGN_HALFWORD ((uint32_t)DMA_SxCR_PSIZE_0) /*!< Peripheral data alignment: HalfWord */
Kojto 115:87f2f5183dfb 253 #define DMA_PDATAALIGN_WORD ((uint32_t)DMA_SxCR_PSIZE_1) /*!< Peripheral data alignment: Word */
Kojto 115:87f2f5183dfb 254 /**
Kojto 115:87f2f5183dfb 255 * @}
Kojto 115:87f2f5183dfb 256 */
Kojto 115:87f2f5183dfb 257
Kojto 115:87f2f5183dfb 258 /** @defgroup DMA_Memory_data_size DMA Memory data size
Kojto 115:87f2f5183dfb 259 * @brief DMA memory data size
Kojto 115:87f2f5183dfb 260 * @{
Kojto 115:87f2f5183dfb 261 */
Kojto 122:f9eeca106725 262 #define DMA_MDATAALIGN_BYTE ((uint32_t)0x00000000U) /*!< Memory data alignment: Byte */
Kojto 115:87f2f5183dfb 263 #define DMA_MDATAALIGN_HALFWORD ((uint32_t)DMA_SxCR_MSIZE_0) /*!< Memory data alignment: HalfWord */
Kojto 115:87f2f5183dfb 264 #define DMA_MDATAALIGN_WORD ((uint32_t)DMA_SxCR_MSIZE_1) /*!< Memory data alignment: Word */
Kojto 115:87f2f5183dfb 265 /**
Kojto 115:87f2f5183dfb 266 * @}
Kojto 115:87f2f5183dfb 267 */
Kojto 115:87f2f5183dfb 268
Kojto 115:87f2f5183dfb 269 /** @defgroup DMA_mode DMA mode
Kojto 115:87f2f5183dfb 270 * @brief DMA mode
Kojto 115:87f2f5183dfb 271 * @{
Kojto 115:87f2f5183dfb 272 */
Kojto 122:f9eeca106725 273 #define DMA_NORMAL ((uint32_t)0x00000000U) /*!< Normal mode */
Kojto 115:87f2f5183dfb 274 #define DMA_CIRCULAR ((uint32_t)DMA_SxCR_CIRC) /*!< Circular mode */
Kojto 115:87f2f5183dfb 275 #define DMA_PFCTRL ((uint32_t)DMA_SxCR_PFCTRL) /*!< Peripheral flow control mode */
Kojto 115:87f2f5183dfb 276 /**
Kojto 115:87f2f5183dfb 277 * @}
Kojto 115:87f2f5183dfb 278 */
Kojto 115:87f2f5183dfb 279
Kojto 115:87f2f5183dfb 280 /** @defgroup DMA_Priority_level DMA Priority level
Kojto 115:87f2f5183dfb 281 * @brief DMA priority levels
Kojto 115:87f2f5183dfb 282 * @{
Kojto 115:87f2f5183dfb 283 */
Kojto 122:f9eeca106725 284 #define DMA_PRIORITY_LOW ((uint32_t)0x00000000U) /*!< Priority level: Low */
Kojto 115:87f2f5183dfb 285 #define DMA_PRIORITY_MEDIUM ((uint32_t)DMA_SxCR_PL_0) /*!< Priority level: Medium */
Kojto 115:87f2f5183dfb 286 #define DMA_PRIORITY_HIGH ((uint32_t)DMA_SxCR_PL_1) /*!< Priority level: High */
Kojto 115:87f2f5183dfb 287 #define DMA_PRIORITY_VERY_HIGH ((uint32_t)DMA_SxCR_PL) /*!< Priority level: Very High */
Kojto 115:87f2f5183dfb 288 /**
Kojto 115:87f2f5183dfb 289 * @}
Kojto 115:87f2f5183dfb 290 */
Kojto 115:87f2f5183dfb 291
Kojto 115:87f2f5183dfb 292 /** @defgroup DMA_FIFO_direct_mode DMA FIFO direct mode
Kojto 115:87f2f5183dfb 293 * @brief DMA FIFO direct mode
Kojto 115:87f2f5183dfb 294 * @{
Kojto 115:87f2f5183dfb 295 */
Kojto 122:f9eeca106725 296 #define DMA_FIFOMODE_DISABLE ((uint32_t)0x00000000U) /*!< FIFO mode disable */
Kojto 115:87f2f5183dfb 297 #define DMA_FIFOMODE_ENABLE ((uint32_t)DMA_SxFCR_DMDIS) /*!< FIFO mode enable */
Kojto 115:87f2f5183dfb 298 /**
Kojto 115:87f2f5183dfb 299 * @}
Kojto 115:87f2f5183dfb 300 */
Kojto 115:87f2f5183dfb 301
Kojto 115:87f2f5183dfb 302 /** @defgroup DMA_FIFO_threshold_level DMA FIFO threshold level
Kojto 115:87f2f5183dfb 303 * @brief DMA FIFO level
Kojto 115:87f2f5183dfb 304 * @{
Kojto 115:87f2f5183dfb 305 */
Kojto 122:f9eeca106725 306 #define DMA_FIFO_THRESHOLD_1QUARTERFULL ((uint32_t)0x00000000U) /*!< FIFO threshold 1 quart full configuration */
Kojto 115:87f2f5183dfb 307 #define DMA_FIFO_THRESHOLD_HALFFULL ((uint32_t)DMA_SxFCR_FTH_0) /*!< FIFO threshold half full configuration */
Kojto 115:87f2f5183dfb 308 #define DMA_FIFO_THRESHOLD_3QUARTERSFULL ((uint32_t)DMA_SxFCR_FTH_1) /*!< FIFO threshold 3 quarts full configuration */
Kojto 115:87f2f5183dfb 309 #define DMA_FIFO_THRESHOLD_FULL ((uint32_t)DMA_SxFCR_FTH) /*!< FIFO threshold full configuration */
Kojto 115:87f2f5183dfb 310 /**
Kojto 115:87f2f5183dfb 311 * @}
Kojto 115:87f2f5183dfb 312 */
Kojto 115:87f2f5183dfb 313
Kojto 115:87f2f5183dfb 314 /** @defgroup DMA_Memory_burst DMA Memory burst
Kojto 115:87f2f5183dfb 315 * @brief DMA memory burst
Kojto 115:87f2f5183dfb 316 * @{
Kojto 115:87f2f5183dfb 317 */
Kojto 122:f9eeca106725 318 #define DMA_MBURST_SINGLE ((uint32_t)0x00000000U)
Kojto 115:87f2f5183dfb 319 #define DMA_MBURST_INC4 ((uint32_t)DMA_SxCR_MBURST_0)
Kojto 115:87f2f5183dfb 320 #define DMA_MBURST_INC8 ((uint32_t)DMA_SxCR_MBURST_1)
Kojto 115:87f2f5183dfb 321 #define DMA_MBURST_INC16 ((uint32_t)DMA_SxCR_MBURST)
Kojto 115:87f2f5183dfb 322 /**
Kojto 115:87f2f5183dfb 323 * @}
Kojto 115:87f2f5183dfb 324 */
Kojto 115:87f2f5183dfb 325
Kojto 115:87f2f5183dfb 326 /** @defgroup DMA_Peripheral_burst DMA Peripheral burst
Kojto 115:87f2f5183dfb 327 * @brief DMA peripheral burst
Kojto 115:87f2f5183dfb 328 * @{
Kojto 115:87f2f5183dfb 329 */
Kojto 122:f9eeca106725 330 #define DMA_PBURST_SINGLE ((uint32_t)0x00000000U)
Kojto 122:f9eeca106725 331 #define DMA_PBURST_INC4 ((uint32_t)DMA_SxCR_PBURST_0)
Kojto 122:f9eeca106725 332 #define DMA_PBURST_INC8 ((uint32_t)DMA_SxCR_PBURST_1)
Kojto 122:f9eeca106725 333 #define DMA_PBURST_INC16 ((uint32_t)DMA_SxCR_PBURST)
Kojto 115:87f2f5183dfb 334 /**
Kojto 115:87f2f5183dfb 335 * @}
Kojto 115:87f2f5183dfb 336 */
Kojto 115:87f2f5183dfb 337
Kojto 115:87f2f5183dfb 338 /** @defgroup DMA_interrupt_enable_definitions DMA interrupt enable definitions
Kojto 115:87f2f5183dfb 339 * @brief DMA interrupts definition
Kojto 115:87f2f5183dfb 340 * @{
Kojto 115:87f2f5183dfb 341 */
Kojto 115:87f2f5183dfb 342 #define DMA_IT_TC ((uint32_t)DMA_SxCR_TCIE)
Kojto 115:87f2f5183dfb 343 #define DMA_IT_HT ((uint32_t)DMA_SxCR_HTIE)
Kojto 115:87f2f5183dfb 344 #define DMA_IT_TE ((uint32_t)DMA_SxCR_TEIE)
Kojto 115:87f2f5183dfb 345 #define DMA_IT_DME ((uint32_t)DMA_SxCR_DMEIE)
Kojto 122:f9eeca106725 346 #define DMA_IT_FE ((uint32_t)0x00000080U)
Kojto 115:87f2f5183dfb 347 /**
Kojto 115:87f2f5183dfb 348 * @}
Kojto 115:87f2f5183dfb 349 */
Kojto 115:87f2f5183dfb 350
Kojto 115:87f2f5183dfb 351 /** @defgroup DMA_flag_definitions DMA flag definitions
Kojto 115:87f2f5183dfb 352 * @brief DMA flag definitions
Kojto 115:87f2f5183dfb 353 * @{
Kojto 115:87f2f5183dfb 354 */
Kojto 122:f9eeca106725 355 #define DMA_FLAG_FEIF0_4 ((uint32_t)0x00800001U)
Kojto 122:f9eeca106725 356 #define DMA_FLAG_DMEIF0_4 ((uint32_t)0x00800004U)
Kojto 122:f9eeca106725 357 #define DMA_FLAG_TEIF0_4 ((uint32_t)0x00000008U)
Kojto 122:f9eeca106725 358 #define DMA_FLAG_HTIF0_4 ((uint32_t)0x00000010U)
Kojto 122:f9eeca106725 359 #define DMA_FLAG_TCIF0_4 ((uint32_t)0x00000020U)
Kojto 122:f9eeca106725 360 #define DMA_FLAG_FEIF1_5 ((uint32_t)0x00000040U)
Kojto 122:f9eeca106725 361 #define DMA_FLAG_DMEIF1_5 ((uint32_t)0x00000100U)
Kojto 122:f9eeca106725 362 #define DMA_FLAG_TEIF1_5 ((uint32_t)0x00000200U)
Kojto 122:f9eeca106725 363 #define DMA_FLAG_HTIF1_5 ((uint32_t)0x00000400U)
Kojto 122:f9eeca106725 364 #define DMA_FLAG_TCIF1_5 ((uint32_t)0x00000800U)
Kojto 122:f9eeca106725 365 #define DMA_FLAG_FEIF2_6 ((uint32_t)0x00010000U)
Kojto 122:f9eeca106725 366 #define DMA_FLAG_DMEIF2_6 ((uint32_t)0x00040000U)
Kojto 122:f9eeca106725 367 #define DMA_FLAG_TEIF2_6 ((uint32_t)0x00080000U)
Kojto 122:f9eeca106725 368 #define DMA_FLAG_HTIF2_6 ((uint32_t)0x00100000U)
Kojto 122:f9eeca106725 369 #define DMA_FLAG_TCIF2_6 ((uint32_t)0x00200000U)
Kojto 122:f9eeca106725 370 #define DMA_FLAG_FEIF3_7 ((uint32_t)0x00400000U)
Kojto 122:f9eeca106725 371 #define DMA_FLAG_DMEIF3_7 ((uint32_t)0x01000000U)
Kojto 122:f9eeca106725 372 #define DMA_FLAG_TEIF3_7 ((uint32_t)0x02000000U)
Kojto 122:f9eeca106725 373 #define DMA_FLAG_HTIF3_7 ((uint32_t)0x04000000U)
Kojto 122:f9eeca106725 374 #define DMA_FLAG_TCIF3_7 ((uint32_t)0x08000000U)
Kojto 115:87f2f5183dfb 375 /**
Kojto 115:87f2f5183dfb 376 * @}
Kojto 115:87f2f5183dfb 377 */
Kojto 115:87f2f5183dfb 378
Kojto 115:87f2f5183dfb 379 /**
Kojto 115:87f2f5183dfb 380 * @}
Kojto 115:87f2f5183dfb 381 */
Kojto 115:87f2f5183dfb 382
Kojto 115:87f2f5183dfb 383 /* Exported macro ------------------------------------------------------------*/
Kojto 115:87f2f5183dfb 384
Kojto 115:87f2f5183dfb 385 /** @brief Reset DMA handle state
Kojto 115:87f2f5183dfb 386 * @param __HANDLE__: specifies the DMA handle.
Kojto 115:87f2f5183dfb 387 * @retval None
Kojto 115:87f2f5183dfb 388 */
Kojto 115:87f2f5183dfb 389 #define __HAL_DMA_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_DMA_STATE_RESET)
Kojto 115:87f2f5183dfb 390
Kojto 115:87f2f5183dfb 391 /**
Kojto 115:87f2f5183dfb 392 * @brief Return the current DMA Stream FIFO filled level.
Kojto 115:87f2f5183dfb 393 * @param __HANDLE__: DMA handle
Kojto 115:87f2f5183dfb 394 * @retval The FIFO filling state.
Kojto 115:87f2f5183dfb 395 * - DMA_FIFOStatus_Less1QuarterFull: when FIFO is less than 1 quarter-full
Kojto 115:87f2f5183dfb 396 * and not empty.
Kojto 115:87f2f5183dfb 397 * - DMA_FIFOStatus_1QuarterFull: if more than 1 quarter-full.
Kojto 115:87f2f5183dfb 398 * - DMA_FIFOStatus_HalfFull: if more than 1 half-full.
Kojto 115:87f2f5183dfb 399 * - DMA_FIFOStatus_3QuartersFull: if more than 3 quarters-full.
Kojto 115:87f2f5183dfb 400 * - DMA_FIFOStatus_Empty: when FIFO is empty
Kojto 115:87f2f5183dfb 401 * - DMA_FIFOStatus_Full: when FIFO is full
Kojto 115:87f2f5183dfb 402 */
Kojto 115:87f2f5183dfb 403 #define __HAL_DMA_GET_FS(__HANDLE__) (((__HANDLE__)->Instance->FCR & (DMA_SxFCR_FS)))
Kojto 115:87f2f5183dfb 404
Kojto 115:87f2f5183dfb 405 /**
Kojto 115:87f2f5183dfb 406 * @brief Enable the specified DMA Stream.
Kojto 115:87f2f5183dfb 407 * @param __HANDLE__: DMA handle
Kojto 115:87f2f5183dfb 408 * @retval None
Kojto 115:87f2f5183dfb 409 */
Kojto 115:87f2f5183dfb 410 #define __HAL_DMA_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= DMA_SxCR_EN)
Kojto 115:87f2f5183dfb 411
Kojto 115:87f2f5183dfb 412 /**
Kojto 115:87f2f5183dfb 413 * @brief Disable the specified DMA Stream.
Kojto 115:87f2f5183dfb 414 * @param __HANDLE__: DMA handle
Kojto 115:87f2f5183dfb 415 * @retval None
Kojto 115:87f2f5183dfb 416 */
Kojto 115:87f2f5183dfb 417 #define __HAL_DMA_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~DMA_SxCR_EN)
Kojto 115:87f2f5183dfb 418
Kojto 115:87f2f5183dfb 419 /* Interrupt & Flag management */
Kojto 115:87f2f5183dfb 420
Kojto 115:87f2f5183dfb 421 /**
Kojto 115:87f2f5183dfb 422 * @brief Return the current DMA Stream transfer complete flag.
Kojto 115:87f2f5183dfb 423 * @param __HANDLE__: DMA handle
Kojto 115:87f2f5183dfb 424 * @retval The specified transfer complete flag index.
Kojto 115:87f2f5183dfb 425 */
Kojto 115:87f2f5183dfb 426 #define __HAL_DMA_GET_TC_FLAG_INDEX(__HANDLE__) \
Kojto 115:87f2f5183dfb 427 (((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream0))? DMA_FLAG_TCIF0_4 :\
Kojto 115:87f2f5183dfb 428 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream0))? DMA_FLAG_TCIF0_4 :\
Kojto 115:87f2f5183dfb 429 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream4))? DMA_FLAG_TCIF0_4 :\
Kojto 115:87f2f5183dfb 430 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream4))? DMA_FLAG_TCIF0_4 :\
Kojto 115:87f2f5183dfb 431 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream1))? DMA_FLAG_TCIF1_5 :\
Kojto 115:87f2f5183dfb 432 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream1))? DMA_FLAG_TCIF1_5 :\
Kojto 115:87f2f5183dfb 433 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream5))? DMA_FLAG_TCIF1_5 :\
Kojto 115:87f2f5183dfb 434 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream5))? DMA_FLAG_TCIF1_5 :\
Kojto 115:87f2f5183dfb 435 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream2))? DMA_FLAG_TCIF2_6 :\
Kojto 115:87f2f5183dfb 436 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream2))? DMA_FLAG_TCIF2_6 :\
Kojto 115:87f2f5183dfb 437 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream6))? DMA_FLAG_TCIF2_6 :\
Kojto 115:87f2f5183dfb 438 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream6))? DMA_FLAG_TCIF2_6 :\
Kojto 115:87f2f5183dfb 439 DMA_FLAG_TCIF3_7)
Kojto 115:87f2f5183dfb 440
Kojto 115:87f2f5183dfb 441 /**
Kojto 115:87f2f5183dfb 442 * @brief Return the current DMA Stream half transfer complete flag.
Kojto 115:87f2f5183dfb 443 * @param __HANDLE__: DMA handle
Kojto 115:87f2f5183dfb 444 * @retval The specified half transfer complete flag index.
Kojto 115:87f2f5183dfb 445 */
Kojto 115:87f2f5183dfb 446 #define __HAL_DMA_GET_HT_FLAG_INDEX(__HANDLE__)\
Kojto 115:87f2f5183dfb 447 (((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream0))? DMA_FLAG_HTIF0_4 :\
Kojto 115:87f2f5183dfb 448 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream0))? DMA_FLAG_HTIF0_4 :\
Kojto 115:87f2f5183dfb 449 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream4))? DMA_FLAG_HTIF0_4 :\
Kojto 115:87f2f5183dfb 450 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream4))? DMA_FLAG_HTIF0_4 :\
Kojto 115:87f2f5183dfb 451 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream1))? DMA_FLAG_HTIF1_5 :\
Kojto 115:87f2f5183dfb 452 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream1))? DMA_FLAG_HTIF1_5 :\
Kojto 115:87f2f5183dfb 453 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream5))? DMA_FLAG_HTIF1_5 :\
Kojto 115:87f2f5183dfb 454 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream5))? DMA_FLAG_HTIF1_5 :\
Kojto 115:87f2f5183dfb 455 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream2))? DMA_FLAG_HTIF2_6 :\
Kojto 115:87f2f5183dfb 456 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream2))? DMA_FLAG_HTIF2_6 :\
Kojto 115:87f2f5183dfb 457 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream6))? DMA_FLAG_HTIF2_6 :\
Kojto 115:87f2f5183dfb 458 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream6))? DMA_FLAG_HTIF2_6 :\
Kojto 115:87f2f5183dfb 459 DMA_FLAG_HTIF3_7)
Kojto 115:87f2f5183dfb 460
Kojto 115:87f2f5183dfb 461 /**
Kojto 115:87f2f5183dfb 462 * @brief Return the current DMA Stream transfer error flag.
Kojto 115:87f2f5183dfb 463 * @param __HANDLE__: DMA handle
Kojto 115:87f2f5183dfb 464 * @retval The specified transfer error flag index.
Kojto 115:87f2f5183dfb 465 */
Kojto 115:87f2f5183dfb 466 #define __HAL_DMA_GET_TE_FLAG_INDEX(__HANDLE__)\
Kojto 115:87f2f5183dfb 467 (((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream0))? DMA_FLAG_TEIF0_4 :\
Kojto 115:87f2f5183dfb 468 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream0))? DMA_FLAG_TEIF0_4 :\
Kojto 115:87f2f5183dfb 469 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream4))? DMA_FLAG_TEIF0_4 :\
Kojto 115:87f2f5183dfb 470 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream4))? DMA_FLAG_TEIF0_4 :\
Kojto 115:87f2f5183dfb 471 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream1))? DMA_FLAG_TEIF1_5 :\
Kojto 115:87f2f5183dfb 472 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream1))? DMA_FLAG_TEIF1_5 :\
Kojto 115:87f2f5183dfb 473 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream5))? DMA_FLAG_TEIF1_5 :\
Kojto 115:87f2f5183dfb 474 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream5))? DMA_FLAG_TEIF1_5 :\
Kojto 115:87f2f5183dfb 475 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream2))? DMA_FLAG_TEIF2_6 :\
Kojto 115:87f2f5183dfb 476 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream2))? DMA_FLAG_TEIF2_6 :\
Kojto 115:87f2f5183dfb 477 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream6))? DMA_FLAG_TEIF2_6 :\
Kojto 115:87f2f5183dfb 478 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream6))? DMA_FLAG_TEIF2_6 :\
Kojto 115:87f2f5183dfb 479 DMA_FLAG_TEIF3_7)
Kojto 115:87f2f5183dfb 480
Kojto 115:87f2f5183dfb 481 /**
Kojto 115:87f2f5183dfb 482 * @brief Return the current DMA Stream FIFO error flag.
Kojto 115:87f2f5183dfb 483 * @param __HANDLE__: DMA handle
Kojto 115:87f2f5183dfb 484 * @retval The specified FIFO error flag index.
Kojto 115:87f2f5183dfb 485 */
Kojto 115:87f2f5183dfb 486 #define __HAL_DMA_GET_FE_FLAG_INDEX(__HANDLE__)\
Kojto 115:87f2f5183dfb 487 (((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream0))? DMA_FLAG_FEIF0_4 :\
Kojto 115:87f2f5183dfb 488 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream0))? DMA_FLAG_FEIF0_4 :\
Kojto 115:87f2f5183dfb 489 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream4))? DMA_FLAG_FEIF0_4 :\
Kojto 115:87f2f5183dfb 490 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream4))? DMA_FLAG_FEIF0_4 :\
Kojto 115:87f2f5183dfb 491 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream1))? DMA_FLAG_FEIF1_5 :\
Kojto 115:87f2f5183dfb 492 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream1))? DMA_FLAG_FEIF1_5 :\
Kojto 115:87f2f5183dfb 493 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream5))? DMA_FLAG_FEIF1_5 :\
Kojto 115:87f2f5183dfb 494 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream5))? DMA_FLAG_FEIF1_5 :\
Kojto 115:87f2f5183dfb 495 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream2))? DMA_FLAG_FEIF2_6 :\
Kojto 115:87f2f5183dfb 496 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream2))? DMA_FLAG_FEIF2_6 :\
Kojto 115:87f2f5183dfb 497 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream6))? DMA_FLAG_FEIF2_6 :\
Kojto 115:87f2f5183dfb 498 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream6))? DMA_FLAG_FEIF2_6 :\
Kojto 115:87f2f5183dfb 499 DMA_FLAG_FEIF3_7)
Kojto 115:87f2f5183dfb 500
Kojto 115:87f2f5183dfb 501 /**
Kojto 115:87f2f5183dfb 502 * @brief Return the current DMA Stream direct mode error flag.
Kojto 115:87f2f5183dfb 503 * @param __HANDLE__: DMA handle
Kojto 115:87f2f5183dfb 504 * @retval The specified direct mode error flag index.
Kojto 115:87f2f5183dfb 505 */
Kojto 115:87f2f5183dfb 506 #define __HAL_DMA_GET_DME_FLAG_INDEX(__HANDLE__)\
Kojto 115:87f2f5183dfb 507 (((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream0))? DMA_FLAG_DMEIF0_4 :\
Kojto 115:87f2f5183dfb 508 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream0))? DMA_FLAG_DMEIF0_4 :\
Kojto 115:87f2f5183dfb 509 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream4))? DMA_FLAG_DMEIF0_4 :\
Kojto 115:87f2f5183dfb 510 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream4))? DMA_FLAG_DMEIF0_4 :\
Kojto 115:87f2f5183dfb 511 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream1))? DMA_FLAG_DMEIF1_5 :\
Kojto 115:87f2f5183dfb 512 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream1))? DMA_FLAG_DMEIF1_5 :\
Kojto 115:87f2f5183dfb 513 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream5))? DMA_FLAG_DMEIF1_5 :\
Kojto 115:87f2f5183dfb 514 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream5))? DMA_FLAG_DMEIF1_5 :\
Kojto 115:87f2f5183dfb 515 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream2))? DMA_FLAG_DMEIF2_6 :\
Kojto 115:87f2f5183dfb 516 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream2))? DMA_FLAG_DMEIF2_6 :\
Kojto 115:87f2f5183dfb 517 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream6))? DMA_FLAG_DMEIF2_6 :\
Kojto 115:87f2f5183dfb 518 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream6))? DMA_FLAG_DMEIF2_6 :\
Kojto 115:87f2f5183dfb 519 DMA_FLAG_DMEIF3_7)
Kojto 115:87f2f5183dfb 520
Kojto 115:87f2f5183dfb 521 /**
Kojto 115:87f2f5183dfb 522 * @brief Get the DMA Stream pending flags.
Kojto 115:87f2f5183dfb 523 * @param __HANDLE__: DMA handle
Kojto 115:87f2f5183dfb 524 * @param __FLAG__: Get the specified flag.
Kojto 115:87f2f5183dfb 525 * This parameter can be any combination of the following values:
Kojto 115:87f2f5183dfb 526 * @arg DMA_FLAG_TCIFx: Transfer complete flag.
Kojto 115:87f2f5183dfb 527 * @arg DMA_FLAG_HTIFx: Half transfer complete flag.
Kojto 115:87f2f5183dfb 528 * @arg DMA_FLAG_TEIFx: Transfer error flag.
Kojto 115:87f2f5183dfb 529 * @arg DMA_FLAG_DMEIFx: Direct mode error flag.
Kojto 115:87f2f5183dfb 530 * @arg DMA_FLAG_FEIFx: FIFO error flag.
Kojto 115:87f2f5183dfb 531 * Where x can be 0_4, 1_5, 2_6 or 3_7 to select the DMA Stream flag.
Kojto 115:87f2f5183dfb 532 * @retval The state of FLAG (SET or RESET).
Kojto 115:87f2f5183dfb 533 */
Kojto 115:87f2f5183dfb 534 #define __HAL_DMA_GET_FLAG(__HANDLE__, __FLAG__)\
Kojto 115:87f2f5183dfb 535 (((uint32_t)((__HANDLE__)->Instance) > (uint32_t)DMA2_Stream3)? (DMA2->HISR & (__FLAG__)) :\
Kojto 115:87f2f5183dfb 536 ((uint32_t)((__HANDLE__)->Instance) > (uint32_t)DMA1_Stream7)? (DMA2->LISR & (__FLAG__)) :\
Kojto 115:87f2f5183dfb 537 ((uint32_t)((__HANDLE__)->Instance) > (uint32_t)DMA1_Stream3)? (DMA1->HISR & (__FLAG__)) : (DMA1->LISR & (__FLAG__)))
Kojto 115:87f2f5183dfb 538
Kojto 115:87f2f5183dfb 539 /**
Kojto 115:87f2f5183dfb 540 * @brief Clear the DMA Stream pending flags.
Kojto 115:87f2f5183dfb 541 * @param __HANDLE__: DMA handle
Kojto 115:87f2f5183dfb 542 * @param __FLAG__: specifies the flag to clear.
Kojto 115:87f2f5183dfb 543 * This parameter can be any combination of the following values:
Kojto 115:87f2f5183dfb 544 * @arg DMA_FLAG_TCIFx: Transfer complete flag.
Kojto 115:87f2f5183dfb 545 * @arg DMA_FLAG_HTIFx: Half transfer complete flag.
Kojto 115:87f2f5183dfb 546 * @arg DMA_FLAG_TEIFx: Transfer error flag.
Kojto 115:87f2f5183dfb 547 * @arg DMA_FLAG_DMEIFx: Direct mode error flag.
Kojto 115:87f2f5183dfb 548 * @arg DMA_FLAG_FEIFx: FIFO error flag.
Kojto 115:87f2f5183dfb 549 * Where x can be 0_4, 1_5, 2_6 or 3_7 to select the DMA Stream flag.
Kojto 115:87f2f5183dfb 550 * @retval None
Kojto 115:87f2f5183dfb 551 */
Kojto 115:87f2f5183dfb 552 #define __HAL_DMA_CLEAR_FLAG(__HANDLE__, __FLAG__) \
Kojto 115:87f2f5183dfb 553 (((uint32_t)((__HANDLE__)->Instance) > (uint32_t)DMA2_Stream3)? (DMA2->HIFCR = (__FLAG__)) :\
Kojto 115:87f2f5183dfb 554 ((uint32_t)((__HANDLE__)->Instance) > (uint32_t)DMA1_Stream7)? (DMA2->LIFCR = (__FLAG__)) :\
Kojto 115:87f2f5183dfb 555 ((uint32_t)((__HANDLE__)->Instance) > (uint32_t)DMA1_Stream3)? (DMA1->HIFCR = (__FLAG__)) : (DMA1->LIFCR = (__FLAG__)))
Kojto 115:87f2f5183dfb 556
Kojto 115:87f2f5183dfb 557 /**
Kojto 115:87f2f5183dfb 558 * @brief Enable the specified DMA Stream interrupts.
Kojto 115:87f2f5183dfb 559 * @param __HANDLE__: DMA handle
Kojto 115:87f2f5183dfb 560 * @param __INTERRUPT__: specifies the DMA interrupt sources to be enabled or disabled.
Kojto 122:f9eeca106725 561 * This parameter can be one of the following values:
Kojto 115:87f2f5183dfb 562 * @arg DMA_IT_TC: Transfer complete interrupt mask.
Kojto 115:87f2f5183dfb 563 * @arg DMA_IT_HT: Half transfer complete interrupt mask.
Kojto 115:87f2f5183dfb 564 * @arg DMA_IT_TE: Transfer error interrupt mask.
Kojto 115:87f2f5183dfb 565 * @arg DMA_IT_FE: FIFO error interrupt mask.
Kojto 115:87f2f5183dfb 566 * @arg DMA_IT_DME: Direct mode error interrupt.
Kojto 115:87f2f5183dfb 567 * @retval None
Kojto 115:87f2f5183dfb 568 */
Kojto 115:87f2f5183dfb 569 #define __HAL_DMA_ENABLE_IT(__HANDLE__, __INTERRUPT__) (((__INTERRUPT__) != DMA_IT_FE)? \
Kojto 115:87f2f5183dfb 570 ((__HANDLE__)->Instance->CR |= (__INTERRUPT__)) : ((__HANDLE__)->Instance->FCR |= (__INTERRUPT__)))
Kojto 115:87f2f5183dfb 571
Kojto 115:87f2f5183dfb 572 /**
Kojto 115:87f2f5183dfb 573 * @brief Disable the specified DMA Stream interrupts.
Kojto 115:87f2f5183dfb 574 * @param __HANDLE__: DMA handle
Kojto 115:87f2f5183dfb 575 * @param __INTERRUPT__: specifies the DMA interrupt sources to be enabled or disabled.
Kojto 122:f9eeca106725 576 * This parameter can be one of the following values:
Kojto 115:87f2f5183dfb 577 * @arg DMA_IT_TC: Transfer complete interrupt mask.
Kojto 115:87f2f5183dfb 578 * @arg DMA_IT_HT: Half transfer complete interrupt mask.
Kojto 115:87f2f5183dfb 579 * @arg DMA_IT_TE: Transfer error interrupt mask.
Kojto 115:87f2f5183dfb 580 * @arg DMA_IT_FE: FIFO error interrupt mask.
Kojto 115:87f2f5183dfb 581 * @arg DMA_IT_DME: Direct mode error interrupt.
Kojto 115:87f2f5183dfb 582 * @retval None
Kojto 115:87f2f5183dfb 583 */
Kojto 115:87f2f5183dfb 584 #define __HAL_DMA_DISABLE_IT(__HANDLE__, __INTERRUPT__) (((__INTERRUPT__) != DMA_IT_FE)? \
Kojto 115:87f2f5183dfb 585 ((__HANDLE__)->Instance->CR &= ~(__INTERRUPT__)) : ((__HANDLE__)->Instance->FCR &= ~(__INTERRUPT__)))
Kojto 115:87f2f5183dfb 586
Kojto 115:87f2f5183dfb 587 /**
Kojto 115:87f2f5183dfb 588 * @brief Check whether the specified DMA Stream interrupt is enabled or not.
Kojto 115:87f2f5183dfb 589 * @param __HANDLE__: DMA handle
Kojto 115:87f2f5183dfb 590 * @param __INTERRUPT__: specifies the DMA interrupt source to check.
Kojto 115:87f2f5183dfb 591 * This parameter can be one of the following values:
Kojto 115:87f2f5183dfb 592 * @arg DMA_IT_TC: Transfer complete interrupt mask.
Kojto 115:87f2f5183dfb 593 * @arg DMA_IT_HT: Half transfer complete interrupt mask.
Kojto 115:87f2f5183dfb 594 * @arg DMA_IT_TE: Transfer error interrupt mask.
Kojto 115:87f2f5183dfb 595 * @arg DMA_IT_FE: FIFO error interrupt mask.
Kojto 115:87f2f5183dfb 596 * @arg DMA_IT_DME: Direct mode error interrupt.
Kojto 115:87f2f5183dfb 597 * @retval The state of DMA_IT.
Kojto 115:87f2f5183dfb 598 */
Kojto 115:87f2f5183dfb 599 #define __HAL_DMA_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((__INTERRUPT__) != DMA_IT_FE)? \
Kojto 115:87f2f5183dfb 600 ((__HANDLE__)->Instance->CR & (__INTERRUPT__)) : \
Kojto 115:87f2f5183dfb 601 ((__HANDLE__)->Instance->FCR & (__INTERRUPT__)))
Kojto 115:87f2f5183dfb 602
Kojto 115:87f2f5183dfb 603 /**
Kojto 115:87f2f5183dfb 604 * @brief Writes the number of data units to be transferred on the DMA Stream.
Kojto 115:87f2f5183dfb 605 * @param __HANDLE__: DMA handle
Kojto 115:87f2f5183dfb 606 * @param __COUNTER__: Number of data units to be transferred (from 0 to 65535)
Kojto 115:87f2f5183dfb 607 * Number of data items depends only on the Peripheral data format.
Kojto 115:87f2f5183dfb 608 *
Kojto 115:87f2f5183dfb 609 * @note If Peripheral data format is Bytes: number of data units is equal
Kojto 115:87f2f5183dfb 610 * to total number of bytes to be transferred.
Kojto 115:87f2f5183dfb 611 *
Kojto 115:87f2f5183dfb 612 * @note If Peripheral data format is Half-Word: number of data units is
Kojto 115:87f2f5183dfb 613 * equal to total number of bytes to be transferred / 2.
Kojto 115:87f2f5183dfb 614 *
Kojto 115:87f2f5183dfb 615 * @note If Peripheral data format is Word: number of data units is equal
Kojto 115:87f2f5183dfb 616 * to total number of bytes to be transferred / 4.
Kojto 115:87f2f5183dfb 617 *
Kojto 115:87f2f5183dfb 618 * @retval The number of remaining data units in the current DMAy Streamx transfer.
Kojto 115:87f2f5183dfb 619 */
Kojto 115:87f2f5183dfb 620 #define __HAL_DMA_SET_COUNTER(__HANDLE__, __COUNTER__) ((__HANDLE__)->Instance->NDTR = (uint16_t)(__COUNTER__))
Kojto 115:87f2f5183dfb 621
Kojto 115:87f2f5183dfb 622 /**
Kojto 115:87f2f5183dfb 623 * @brief Returns the number of remaining data units in the current DMAy Streamx transfer.
Kojto 115:87f2f5183dfb 624 * @param __HANDLE__: DMA handle
Kojto 115:87f2f5183dfb 625 *
Kojto 115:87f2f5183dfb 626 * @retval The number of remaining data units in the current DMA Stream transfer.
Kojto 115:87f2f5183dfb 627 */
Kojto 115:87f2f5183dfb 628 #define __HAL_DMA_GET_COUNTER(__HANDLE__) ((__HANDLE__)->Instance->NDTR)
Kojto 115:87f2f5183dfb 629
Kojto 115:87f2f5183dfb 630
Kojto 115:87f2f5183dfb 631 /* Include DMA HAL Extension module */
Kojto 115:87f2f5183dfb 632 #include "stm32f7xx_hal_dma_ex.h"
Kojto 115:87f2f5183dfb 633
Kojto 115:87f2f5183dfb 634 /* Exported functions --------------------------------------------------------*/
Kojto 115:87f2f5183dfb 635
Kojto 115:87f2f5183dfb 636 /** @defgroup DMA_Exported_Functions DMA Exported Functions
Kojto 115:87f2f5183dfb 637 * @brief DMA Exported functions
Kojto 115:87f2f5183dfb 638 * @{
Kojto 115:87f2f5183dfb 639 */
Kojto 115:87f2f5183dfb 640
Kojto 115:87f2f5183dfb 641 /** @defgroup DMA_Exported_Functions_Group1 Initialization and de-initialization functions
Kojto 115:87f2f5183dfb 642 * @brief Initialization and de-initialization functions
Kojto 115:87f2f5183dfb 643 * @{
Kojto 115:87f2f5183dfb 644 */
Kojto 115:87f2f5183dfb 645 HAL_StatusTypeDef HAL_DMA_Init(DMA_HandleTypeDef *hdma);
Kojto 115:87f2f5183dfb 646 HAL_StatusTypeDef HAL_DMA_DeInit(DMA_HandleTypeDef *hdma);
Kojto 115:87f2f5183dfb 647 /**
Kojto 115:87f2f5183dfb 648 * @}
Kojto 115:87f2f5183dfb 649 */
Kojto 115:87f2f5183dfb 650
Kojto 115:87f2f5183dfb 651 /** @defgroup DMA_Exported_Functions_Group2 I/O operation functions
Kojto 115:87f2f5183dfb 652 * @brief I/O operation functions
Kojto 115:87f2f5183dfb 653 * @{
Kojto 115:87f2f5183dfb 654 */
Kojto 115:87f2f5183dfb 655 HAL_StatusTypeDef HAL_DMA_Start (DMA_HandleTypeDef *hdma, uint32_t SrcAddress, uint32_t DstAddress, uint32_t DataLength);
Kojto 115:87f2f5183dfb 656 HAL_StatusTypeDef HAL_DMA_Start_IT(DMA_HandleTypeDef *hdma, uint32_t SrcAddress, uint32_t DstAddress, uint32_t DataLength);
Kojto 115:87f2f5183dfb 657 HAL_StatusTypeDef HAL_DMA_Abort(DMA_HandleTypeDef *hdma);
Kojto 122:f9eeca106725 658 HAL_StatusTypeDef HAL_DMA_Abort_IT(DMA_HandleTypeDef *hdma);
Kojto 122:f9eeca106725 659 HAL_StatusTypeDef HAL_DMA_PollForTransfer(DMA_HandleTypeDef *hdma, HAL_DMA_LevelCompleteTypeDef CompleteLevel, uint32_t Timeout);
Kojto 115:87f2f5183dfb 660 void HAL_DMA_IRQHandler(DMA_HandleTypeDef *hdma);
Kojto 122:f9eeca106725 661 HAL_StatusTypeDef HAL_DMA_CleanCallbacks(DMA_HandleTypeDef *hdma);
Kojto 122:f9eeca106725 662 HAL_StatusTypeDef HAL_DMA_RegisterCallback(DMA_HandleTypeDef *hdma, HAL_DMA_CallbackIDTypeDef CallbackID, void (* pCallback)(DMA_HandleTypeDef *_hdma));
Kojto 122:f9eeca106725 663 HAL_StatusTypeDef HAL_DMA_UnRegisterCallback(DMA_HandleTypeDef *hdma, HAL_DMA_CallbackIDTypeDef CallbackID);
Kojto 122:f9eeca106725 664
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_DIRECTION(DIRECTION) (((DIRECTION) == DMA_PERIPH_TO_MEMORY ) || \
Kojto 115:87f2f5183dfb 696 ((DIRECTION) == DMA_MEMORY_TO_PERIPH) || \
Kojto 115:87f2f5183dfb 697 ((DIRECTION) == DMA_MEMORY_TO_MEMORY))
Kojto 115:87f2f5183dfb 698
Kojto 122:f9eeca106725 699 #define IS_DMA_BUFFER_SIZE(SIZE) (((SIZE) >= 0x01U) && ((SIZE) < 0x10000U))
Kojto 115:87f2f5183dfb 700
Kojto 115:87f2f5183dfb 701 #define IS_DMA_PERIPHERAL_INC_STATE(STATE) (((STATE) == DMA_PINC_ENABLE) || \
Kojto 115:87f2f5183dfb 702 ((STATE) == DMA_PINC_DISABLE))
Kojto 115:87f2f5183dfb 703
Kojto 115:87f2f5183dfb 704 #define IS_DMA_MEMORY_INC_STATE(STATE) (((STATE) == DMA_MINC_ENABLE) || \
Kojto 115:87f2f5183dfb 705 ((STATE) == DMA_MINC_DISABLE))
Kojto 115:87f2f5183dfb 706
Kojto 115:87f2f5183dfb 707 #define IS_DMA_PERIPHERAL_DATA_SIZE(SIZE) (((SIZE) == DMA_PDATAALIGN_BYTE) || \
Kojto 115:87f2f5183dfb 708 ((SIZE) == DMA_PDATAALIGN_HALFWORD) || \
Kojto 115:87f2f5183dfb 709 ((SIZE) == DMA_PDATAALIGN_WORD))
Kojto 115:87f2f5183dfb 710
Kojto 115:87f2f5183dfb 711 #define IS_DMA_MEMORY_DATA_SIZE(SIZE) (((SIZE) == DMA_MDATAALIGN_BYTE) || \
Kojto 115:87f2f5183dfb 712 ((SIZE) == DMA_MDATAALIGN_HALFWORD) || \
Kojto 115:87f2f5183dfb 713 ((SIZE) == DMA_MDATAALIGN_WORD ))
Kojto 115:87f2f5183dfb 714
Kojto 115:87f2f5183dfb 715 #define IS_DMA_MODE(MODE) (((MODE) == DMA_NORMAL ) || \
Kojto 115:87f2f5183dfb 716 ((MODE) == DMA_CIRCULAR) || \
Kojto 115:87f2f5183dfb 717 ((MODE) == DMA_PFCTRL))
Kojto 115:87f2f5183dfb 718
Kojto 115:87f2f5183dfb 719 #define IS_DMA_PRIORITY(PRIORITY) (((PRIORITY) == DMA_PRIORITY_LOW ) || \
Kojto 115:87f2f5183dfb 720 ((PRIORITY) == DMA_PRIORITY_MEDIUM) || \
Kojto 115:87f2f5183dfb 721 ((PRIORITY) == DMA_PRIORITY_HIGH) || \
Kojto 115:87f2f5183dfb 722 ((PRIORITY) == DMA_PRIORITY_VERY_HIGH))
Kojto 115:87f2f5183dfb 723
Kojto 115:87f2f5183dfb 724 #define IS_DMA_FIFO_MODE_STATE(STATE) (((STATE) == DMA_FIFOMODE_DISABLE ) || \
Kojto 115:87f2f5183dfb 725 ((STATE) == DMA_FIFOMODE_ENABLE))
Kojto 115:87f2f5183dfb 726
Kojto 115:87f2f5183dfb 727 #define IS_DMA_FIFO_THRESHOLD(THRESHOLD) (((THRESHOLD) == DMA_FIFO_THRESHOLD_1QUARTERFULL ) || \
Kojto 115:87f2f5183dfb 728 ((THRESHOLD) == DMA_FIFO_THRESHOLD_HALFFULL) || \
Kojto 115:87f2f5183dfb 729 ((THRESHOLD) == DMA_FIFO_THRESHOLD_3QUARTERSFULL) || \
Kojto 115:87f2f5183dfb 730 ((THRESHOLD) == DMA_FIFO_THRESHOLD_FULL))
Kojto 115:87f2f5183dfb 731
Kojto 115:87f2f5183dfb 732 #define IS_DMA_MEMORY_BURST(BURST) (((BURST) == DMA_MBURST_SINGLE) || \
Kojto 115:87f2f5183dfb 733 ((BURST) == DMA_MBURST_INC4) || \
Kojto 115:87f2f5183dfb 734 ((BURST) == DMA_MBURST_INC8) || \
Kojto 115:87f2f5183dfb 735 ((BURST) == DMA_MBURST_INC16))
Kojto 115:87f2f5183dfb 736
Kojto 115:87f2f5183dfb 737 #define IS_DMA_PERIPHERAL_BURST(BURST) (((BURST) == DMA_PBURST_SINGLE) || \
Kojto 115:87f2f5183dfb 738 ((BURST) == DMA_PBURST_INC4) || \
Kojto 115:87f2f5183dfb 739 ((BURST) == DMA_PBURST_INC8) || \
Kojto 115:87f2f5183dfb 740 ((BURST) == DMA_PBURST_INC16))
Kojto 115:87f2f5183dfb 741 /**
Kojto 115:87f2f5183dfb 742 * @}
Kojto 115:87f2f5183dfb 743 */
Kojto 115:87f2f5183dfb 744
Kojto 115:87f2f5183dfb 745 /* Private functions ---------------------------------------------------------*/
Kojto 115:87f2f5183dfb 746 /** @defgroup DMA_Private_Functions DMA Private Functions
Kojto 115:87f2f5183dfb 747 * @brief DMA private functions
Kojto 115:87f2f5183dfb 748 * @{
Kojto 115:87f2f5183dfb 749 */
Kojto 115:87f2f5183dfb 750 /**
Kojto 115:87f2f5183dfb 751 * @}
Kojto 115:87f2f5183dfb 752 */
Kojto 115:87f2f5183dfb 753
Kojto 115:87f2f5183dfb 754 /**
Kojto 115:87f2f5183dfb 755 * @}
Kojto 115:87f2f5183dfb 756 */
Kojto 115:87f2f5183dfb 757
Kojto 115:87f2f5183dfb 758 /**
Kojto 115:87f2f5183dfb 759 * @}
Kojto 115:87f2f5183dfb 760 */
Kojto 115:87f2f5183dfb 761
Kojto 115:87f2f5183dfb 762 #ifdef __cplusplus
Kojto 115:87f2f5183dfb 763 }
Kojto 115:87f2f5183dfb 764 #endif
Kojto 115:87f2f5183dfb 765
Kojto 115:87f2f5183dfb 766 #endif /* __STM32F7xx_HAL_DMA_H */
Kojto 115:87f2f5183dfb 767
Kojto 115:87f2f5183dfb 768 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/