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
TARGET_NUCLEO_F746ZG/stm32f7xx_hal_dma.h@115:87f2f5183dfb, 2016-03-02 (annotated)
- Committer:
- Kojto
- Date:
- Wed Mar 02 09:58:28 2016 +0100
- Revision:
- 115:87f2f5183dfb
- Child:
- 116:c0f6e94411f5
Release 115 of the mbed library
Changes:
- new targets - NUCLEO_F746ZG
- Bugfix - STM32F7 + STM32L4 - RTC init fix
- Bugfix - STM32L4 Set NVIC_RAM_VECTOR_ADDRESS to 0x10000000
- B96B_F446VE - CAN addition
- Changed target name from NZ32SC151 to NZ32_SC151
Who changed what in which revision?
User | Revision | Line number | New 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 | 115:87f2f5183dfb | 5 | * @version V1.0.1 |
Kojto | 115:87f2f5183dfb | 6 | * @date 25-June-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>© 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 | 115:87f2f5183dfb | 168 | }DMA_HandleTypeDef; |
Kojto | 115:87f2f5183dfb | 169 | |
Kojto | 115:87f2f5183dfb | 170 | /** |
Kojto | 115:87f2f5183dfb | 171 | * @} |
Kojto | 115:87f2f5183dfb | 172 | */ |
Kojto | 115:87f2f5183dfb | 173 | |
Kojto | 115:87f2f5183dfb | 174 | |
Kojto | 115:87f2f5183dfb | 175 | /* Exported constants --------------------------------------------------------*/ |
Kojto | 115:87f2f5183dfb | 176 | |
Kojto | 115:87f2f5183dfb | 177 | /** @defgroup DMA_Exported_Constants DMA Exported Constants |
Kojto | 115:87f2f5183dfb | 178 | * @brief DMA Exported constants |
Kojto | 115:87f2f5183dfb | 179 | * @{ |
Kojto | 115:87f2f5183dfb | 180 | */ |
Kojto | 115:87f2f5183dfb | 181 | |
Kojto | 115:87f2f5183dfb | 182 | /** @defgroup DMA_Error_Code DMA Error Code |
Kojto | 115:87f2f5183dfb | 183 | * @brief DMA Error Code |
Kojto | 115:87f2f5183dfb | 184 | * @{ |
Kojto | 115:87f2f5183dfb | 185 | */ |
Kojto | 115:87f2f5183dfb | 186 | #define HAL_DMA_ERROR_NONE ((uint32_t)0x00000000) /*!< No error */ |
Kojto | 115:87f2f5183dfb | 187 | #define HAL_DMA_ERROR_TE ((uint32_t)0x00000001) /*!< Transfer error */ |
Kojto | 115:87f2f5183dfb | 188 | #define HAL_DMA_ERROR_FE ((uint32_t)0x00000002) /*!< FIFO error */ |
Kojto | 115:87f2f5183dfb | 189 | #define HAL_DMA_ERROR_DME ((uint32_t)0x00000004) /*!< Direct Mode error */ |
Kojto | 115:87f2f5183dfb | 190 | #define HAL_DMA_ERROR_TIMEOUT ((uint32_t)0x00000020) /*!< Timeout error */ |
Kojto | 115:87f2f5183dfb | 191 | /** |
Kojto | 115:87f2f5183dfb | 192 | * @} |
Kojto | 115:87f2f5183dfb | 193 | */ |
Kojto | 115:87f2f5183dfb | 194 | |
Kojto | 115:87f2f5183dfb | 195 | /** @defgroup DMA_Channel_selection DMA Channel selection |
Kojto | 115:87f2f5183dfb | 196 | * @brief DMA channel selection |
Kojto | 115:87f2f5183dfb | 197 | * @{ |
Kojto | 115:87f2f5183dfb | 198 | */ |
Kojto | 115:87f2f5183dfb | 199 | #define DMA_CHANNEL_0 ((uint32_t)0x00000000) /*!< DMA Channel 0 */ |
Kojto | 115:87f2f5183dfb | 200 | #define DMA_CHANNEL_1 ((uint32_t)0x02000000) /*!< DMA Channel 1 */ |
Kojto | 115:87f2f5183dfb | 201 | #define DMA_CHANNEL_2 ((uint32_t)0x04000000) /*!< DMA Channel 2 */ |
Kojto | 115:87f2f5183dfb | 202 | #define DMA_CHANNEL_3 ((uint32_t)0x06000000) /*!< DMA Channel 3 */ |
Kojto | 115:87f2f5183dfb | 203 | #define DMA_CHANNEL_4 ((uint32_t)0x08000000) /*!< DMA Channel 4 */ |
Kojto | 115:87f2f5183dfb | 204 | #define DMA_CHANNEL_5 ((uint32_t)0x0A000000) /*!< DMA Channel 5 */ |
Kojto | 115:87f2f5183dfb | 205 | #define DMA_CHANNEL_6 ((uint32_t)0x0C000000) /*!< DMA Channel 6 */ |
Kojto | 115:87f2f5183dfb | 206 | #define DMA_CHANNEL_7 ((uint32_t)0x0E000000) /*!< DMA Channel 7 */ |
Kojto | 115:87f2f5183dfb | 207 | /** |
Kojto | 115:87f2f5183dfb | 208 | * @} |
Kojto | 115:87f2f5183dfb | 209 | */ |
Kojto | 115:87f2f5183dfb | 210 | |
Kojto | 115:87f2f5183dfb | 211 | /** @defgroup DMA_Data_transfer_direction DMA Data transfer direction |
Kojto | 115:87f2f5183dfb | 212 | * @brief DMA data transfer direction |
Kojto | 115:87f2f5183dfb | 213 | * @{ |
Kojto | 115:87f2f5183dfb | 214 | */ |
Kojto | 115:87f2f5183dfb | 215 | #define DMA_PERIPH_TO_MEMORY ((uint32_t)0x00000000) /*!< Peripheral to memory direction */ |
Kojto | 115:87f2f5183dfb | 216 | #define DMA_MEMORY_TO_PERIPH ((uint32_t)DMA_SxCR_DIR_0) /*!< Memory to peripheral direction */ |
Kojto | 115:87f2f5183dfb | 217 | #define DMA_MEMORY_TO_MEMORY ((uint32_t)DMA_SxCR_DIR_1) /*!< Memory to memory direction */ |
Kojto | 115:87f2f5183dfb | 218 | /** |
Kojto | 115:87f2f5183dfb | 219 | * @} |
Kojto | 115:87f2f5183dfb | 220 | */ |
Kojto | 115:87f2f5183dfb | 221 | |
Kojto | 115:87f2f5183dfb | 222 | /** @defgroup DMA_Peripheral_incremented_mode DMA Peripheral incremented mode |
Kojto | 115:87f2f5183dfb | 223 | * @brief DMA peripheral incremented mode |
Kojto | 115:87f2f5183dfb | 224 | * @{ |
Kojto | 115:87f2f5183dfb | 225 | */ |
Kojto | 115:87f2f5183dfb | 226 | #define DMA_PINC_ENABLE ((uint32_t)DMA_SxCR_PINC) /*!< Peripheral increment mode enable */ |
Kojto | 115:87f2f5183dfb | 227 | #define DMA_PINC_DISABLE ((uint32_t)0x00000000) /*!< Peripheral increment mode disable */ |
Kojto | 115:87f2f5183dfb | 228 | /** |
Kojto | 115:87f2f5183dfb | 229 | * @} |
Kojto | 115:87f2f5183dfb | 230 | */ |
Kojto | 115:87f2f5183dfb | 231 | |
Kojto | 115:87f2f5183dfb | 232 | /** @defgroup DMA_Memory_incremented_mode DMA Memory incremented mode |
Kojto | 115:87f2f5183dfb | 233 | * @brief DMA memory incremented mode |
Kojto | 115:87f2f5183dfb | 234 | * @{ |
Kojto | 115:87f2f5183dfb | 235 | */ |
Kojto | 115:87f2f5183dfb | 236 | #define DMA_MINC_ENABLE ((uint32_t)DMA_SxCR_MINC) /*!< Memory increment mode enable */ |
Kojto | 115:87f2f5183dfb | 237 | #define DMA_MINC_DISABLE ((uint32_t)0x00000000) /*!< Memory increment mode disable */ |
Kojto | 115:87f2f5183dfb | 238 | /** |
Kojto | 115:87f2f5183dfb | 239 | * @} |
Kojto | 115:87f2f5183dfb | 240 | */ |
Kojto | 115:87f2f5183dfb | 241 | |
Kojto | 115:87f2f5183dfb | 242 | |
Kojto | 115:87f2f5183dfb | 243 | /** @defgroup DMA_Peripheral_data_size DMA Peripheral data size |
Kojto | 115:87f2f5183dfb | 244 | * @brief DMA peripheral data size |
Kojto | 115:87f2f5183dfb | 245 | * @{ |
Kojto | 115:87f2f5183dfb | 246 | */ |
Kojto | 115:87f2f5183dfb | 247 | #define DMA_PDATAALIGN_BYTE ((uint32_t)0x00000000) /*!< Peripheral data alignment: Byte */ |
Kojto | 115:87f2f5183dfb | 248 | #define DMA_PDATAALIGN_HALFWORD ((uint32_t)DMA_SxCR_PSIZE_0) /*!< Peripheral data alignment: HalfWord */ |
Kojto | 115:87f2f5183dfb | 249 | #define DMA_PDATAALIGN_WORD ((uint32_t)DMA_SxCR_PSIZE_1) /*!< Peripheral data alignment: Word */ |
Kojto | 115:87f2f5183dfb | 250 | /** |
Kojto | 115:87f2f5183dfb | 251 | * @} |
Kojto | 115:87f2f5183dfb | 252 | */ |
Kojto | 115:87f2f5183dfb | 253 | |
Kojto | 115:87f2f5183dfb | 254 | |
Kojto | 115:87f2f5183dfb | 255 | /** @defgroup DMA_Memory_data_size DMA Memory data size |
Kojto | 115:87f2f5183dfb | 256 | * @brief DMA memory data size |
Kojto | 115:87f2f5183dfb | 257 | * @{ |
Kojto | 115:87f2f5183dfb | 258 | */ |
Kojto | 115:87f2f5183dfb | 259 | #define DMA_MDATAALIGN_BYTE ((uint32_t)0x00000000) /*!< Memory data alignment: Byte */ |
Kojto | 115:87f2f5183dfb | 260 | #define DMA_MDATAALIGN_HALFWORD ((uint32_t)DMA_SxCR_MSIZE_0) /*!< Memory data alignment: HalfWord */ |
Kojto | 115:87f2f5183dfb | 261 | #define DMA_MDATAALIGN_WORD ((uint32_t)DMA_SxCR_MSIZE_1) /*!< Memory data alignment: Word */ |
Kojto | 115:87f2f5183dfb | 262 | /** |
Kojto | 115:87f2f5183dfb | 263 | * @} |
Kojto | 115:87f2f5183dfb | 264 | */ |
Kojto | 115:87f2f5183dfb | 265 | |
Kojto | 115:87f2f5183dfb | 266 | /** @defgroup DMA_mode DMA mode |
Kojto | 115:87f2f5183dfb | 267 | * @brief DMA mode |
Kojto | 115:87f2f5183dfb | 268 | * @{ |
Kojto | 115:87f2f5183dfb | 269 | */ |
Kojto | 115:87f2f5183dfb | 270 | #define DMA_NORMAL ((uint32_t)0x00000000) /*!< Normal mode */ |
Kojto | 115:87f2f5183dfb | 271 | #define DMA_CIRCULAR ((uint32_t)DMA_SxCR_CIRC) /*!< Circular mode */ |
Kojto | 115:87f2f5183dfb | 272 | #define DMA_PFCTRL ((uint32_t)DMA_SxCR_PFCTRL) /*!< Peripheral flow control mode */ |
Kojto | 115:87f2f5183dfb | 273 | /** |
Kojto | 115:87f2f5183dfb | 274 | * @} |
Kojto | 115:87f2f5183dfb | 275 | */ |
Kojto | 115:87f2f5183dfb | 276 | |
Kojto | 115:87f2f5183dfb | 277 | |
Kojto | 115:87f2f5183dfb | 278 | /** @defgroup DMA_Priority_level DMA Priority level |
Kojto | 115:87f2f5183dfb | 279 | * @brief DMA priority levels |
Kojto | 115:87f2f5183dfb | 280 | * @{ |
Kojto | 115:87f2f5183dfb | 281 | */ |
Kojto | 115:87f2f5183dfb | 282 | #define DMA_PRIORITY_LOW ((uint32_t)0x00000000) /*!< Priority level: Low */ |
Kojto | 115:87f2f5183dfb | 283 | #define DMA_PRIORITY_MEDIUM ((uint32_t)DMA_SxCR_PL_0) /*!< Priority level: Medium */ |
Kojto | 115:87f2f5183dfb | 284 | #define DMA_PRIORITY_HIGH ((uint32_t)DMA_SxCR_PL_1) /*!< Priority level: High */ |
Kojto | 115:87f2f5183dfb | 285 | #define DMA_PRIORITY_VERY_HIGH ((uint32_t)DMA_SxCR_PL) /*!< Priority level: Very High */ |
Kojto | 115:87f2f5183dfb | 286 | /** |
Kojto | 115:87f2f5183dfb | 287 | * @} |
Kojto | 115:87f2f5183dfb | 288 | */ |
Kojto | 115:87f2f5183dfb | 289 | |
Kojto | 115:87f2f5183dfb | 290 | |
Kojto | 115:87f2f5183dfb | 291 | /** @defgroup DMA_FIFO_direct_mode DMA FIFO direct mode |
Kojto | 115:87f2f5183dfb | 292 | * @brief DMA FIFO direct mode |
Kojto | 115:87f2f5183dfb | 293 | * @{ |
Kojto | 115:87f2f5183dfb | 294 | */ |
Kojto | 115:87f2f5183dfb | 295 | #define DMA_FIFOMODE_DISABLE ((uint32_t)0x00000000) /*!< FIFO mode disable */ |
Kojto | 115:87f2f5183dfb | 296 | #define DMA_FIFOMODE_ENABLE ((uint32_t)DMA_SxFCR_DMDIS) /*!< FIFO mode enable */ |
Kojto | 115:87f2f5183dfb | 297 | /** |
Kojto | 115:87f2f5183dfb | 298 | * @} |
Kojto | 115:87f2f5183dfb | 299 | */ |
Kojto | 115:87f2f5183dfb | 300 | |
Kojto | 115:87f2f5183dfb | 301 | /** @defgroup DMA_FIFO_threshold_level DMA FIFO threshold level |
Kojto | 115:87f2f5183dfb | 302 | * @brief DMA FIFO level |
Kojto | 115:87f2f5183dfb | 303 | * @{ |
Kojto | 115:87f2f5183dfb | 304 | */ |
Kojto | 115:87f2f5183dfb | 305 | #define DMA_FIFO_THRESHOLD_1QUARTERFULL ((uint32_t)0x00000000) /*!< FIFO threshold 1 quart full configuration */ |
Kojto | 115:87f2f5183dfb | 306 | #define DMA_FIFO_THRESHOLD_HALFFULL ((uint32_t)DMA_SxFCR_FTH_0) /*!< FIFO threshold half full configuration */ |
Kojto | 115:87f2f5183dfb | 307 | #define DMA_FIFO_THRESHOLD_3QUARTERSFULL ((uint32_t)DMA_SxFCR_FTH_1) /*!< FIFO threshold 3 quarts full configuration */ |
Kojto | 115:87f2f5183dfb | 308 | #define DMA_FIFO_THRESHOLD_FULL ((uint32_t)DMA_SxFCR_FTH) /*!< FIFO threshold full configuration */ |
Kojto | 115:87f2f5183dfb | 309 | /** |
Kojto | 115:87f2f5183dfb | 310 | * @} |
Kojto | 115:87f2f5183dfb | 311 | */ |
Kojto | 115:87f2f5183dfb | 312 | |
Kojto | 115:87f2f5183dfb | 313 | /** @defgroup DMA_Memory_burst DMA Memory burst |
Kojto | 115:87f2f5183dfb | 314 | * @brief DMA memory burst |
Kojto | 115:87f2f5183dfb | 315 | * @{ |
Kojto | 115:87f2f5183dfb | 316 | */ |
Kojto | 115:87f2f5183dfb | 317 | #define DMA_MBURST_SINGLE ((uint32_t)0x00000000) |
Kojto | 115:87f2f5183dfb | 318 | #define DMA_MBURST_INC4 ((uint32_t)DMA_SxCR_MBURST_0) |
Kojto | 115:87f2f5183dfb | 319 | #define DMA_MBURST_INC8 ((uint32_t)DMA_SxCR_MBURST_1) |
Kojto | 115:87f2f5183dfb | 320 | #define DMA_MBURST_INC16 ((uint32_t)DMA_SxCR_MBURST) |
Kojto | 115:87f2f5183dfb | 321 | /** |
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 | 115:87f2f5183dfb | 330 | #define DMA_PBURST_SINGLE ((uint32_t)0x00000000) |
Kojto | 115:87f2f5183dfb | 331 | #define DMA_PBURST_INC4 ((uint32_t)DMA_SxCR_PBURST_0) |
Kojto | 115:87f2f5183dfb | 332 | #define DMA_PBURST_INC8 ((uint32_t)DMA_SxCR_PBURST_1) |
Kojto | 115:87f2f5183dfb | 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 | 115:87f2f5183dfb | 346 | #define DMA_IT_FE ((uint32_t)0x00000080) |
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 | 115:87f2f5183dfb | 355 | #define DMA_FLAG_FEIF0_4 ((uint32_t)0x00800001) |
Kojto | 115:87f2f5183dfb | 356 | #define DMA_FLAG_DMEIF0_4 ((uint32_t)0x00800004) |
Kojto | 115:87f2f5183dfb | 357 | #define DMA_FLAG_TEIF0_4 ((uint32_t)0x00000008) |
Kojto | 115:87f2f5183dfb | 358 | #define DMA_FLAG_HTIF0_4 ((uint32_t)0x00000010) |
Kojto | 115:87f2f5183dfb | 359 | #define DMA_FLAG_TCIF0_4 ((uint32_t)0x00000020) |
Kojto | 115:87f2f5183dfb | 360 | #define DMA_FLAG_FEIF1_5 ((uint32_t)0x00000040) |
Kojto | 115:87f2f5183dfb | 361 | #define DMA_FLAG_DMEIF1_5 ((uint32_t)0x00000100) |
Kojto | 115:87f2f5183dfb | 362 | #define DMA_FLAG_TEIF1_5 ((uint32_t)0x00000200) |
Kojto | 115:87f2f5183dfb | 363 | #define DMA_FLAG_HTIF1_5 ((uint32_t)0x00000400) |
Kojto | 115:87f2f5183dfb | 364 | #define DMA_FLAG_TCIF1_5 ((uint32_t)0x00000800) |
Kojto | 115:87f2f5183dfb | 365 | #define DMA_FLAG_FEIF2_6 ((uint32_t)0x00010000) |
Kojto | 115:87f2f5183dfb | 366 | #define DMA_FLAG_DMEIF2_6 ((uint32_t)0x00040000) |
Kojto | 115:87f2f5183dfb | 367 | #define DMA_FLAG_TEIF2_6 ((uint32_t)0x00080000) |
Kojto | 115:87f2f5183dfb | 368 | #define DMA_FLAG_HTIF2_6 ((uint32_t)0x00100000) |
Kojto | 115:87f2f5183dfb | 369 | #define DMA_FLAG_TCIF2_6 ((uint32_t)0x00200000) |
Kojto | 115:87f2f5183dfb | 370 | #define DMA_FLAG_FEIF3_7 ((uint32_t)0x00400000) |
Kojto | 115:87f2f5183dfb | 371 | #define DMA_FLAG_DMEIF3_7 ((uint32_t)0x01000000) |
Kojto | 115:87f2f5183dfb | 372 | #define DMA_FLAG_TEIF3_7 ((uint32_t)0x02000000) |
Kojto | 115:87f2f5183dfb | 373 | #define DMA_FLAG_HTIF3_7 ((uint32_t)0x04000000) |
Kojto | 115:87f2f5183dfb | 374 | #define DMA_FLAG_TCIF3_7 ((uint32_t)0x08000000) |
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 | 115:87f2f5183dfb | 561 | * This parameter can be any combination 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 | 115:87f2f5183dfb | 576 | * This parameter can be any combination 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 | 115:87f2f5183dfb | 658 | HAL_StatusTypeDef HAL_DMA_PollForTransfer(DMA_HandleTypeDef *hdma, uint32_t CompleteLevel, uint32_t Timeout); |
Kojto | 115:87f2f5183dfb | 659 | void HAL_DMA_IRQHandler(DMA_HandleTypeDef *hdma); |
Kojto | 115:87f2f5183dfb | 660 | /** |
Kojto | 115:87f2f5183dfb | 661 | * @} |
Kojto | 115:87f2f5183dfb | 662 | */ |
Kojto | 115:87f2f5183dfb | 663 | |
Kojto | 115:87f2f5183dfb | 664 | /** @defgroup DMA_Exported_Functions_Group3 Peripheral State functions |
Kojto | 115:87f2f5183dfb | 665 | * @brief Peripheral State functions |
Kojto | 115:87f2f5183dfb | 666 | * @{ |
Kojto | 115:87f2f5183dfb | 667 | */ |
Kojto | 115:87f2f5183dfb | 668 | HAL_DMA_StateTypeDef HAL_DMA_GetState(DMA_HandleTypeDef *hdma); |
Kojto | 115:87f2f5183dfb | 669 | uint32_t HAL_DMA_GetError(DMA_HandleTypeDef *hdma); |
Kojto | 115:87f2f5183dfb | 670 | /** |
Kojto | 115:87f2f5183dfb | 671 | * @} |
Kojto | 115:87f2f5183dfb | 672 | */ |
Kojto | 115:87f2f5183dfb | 673 | /** |
Kojto | 115:87f2f5183dfb | 674 | * @} |
Kojto | 115:87f2f5183dfb | 675 | */ |
Kojto | 115:87f2f5183dfb | 676 | /* Private Constants -------------------------------------------------------------*/ |
Kojto | 115:87f2f5183dfb | 677 | /** @defgroup DMA_Private_Constants DMA Private Constants |
Kojto | 115:87f2f5183dfb | 678 | * @brief DMA private defines and constants |
Kojto | 115:87f2f5183dfb | 679 | * @{ |
Kojto | 115:87f2f5183dfb | 680 | */ |
Kojto | 115:87f2f5183dfb | 681 | /** |
Kojto | 115:87f2f5183dfb | 682 | * @} |
Kojto | 115:87f2f5183dfb | 683 | */ |
Kojto | 115:87f2f5183dfb | 684 | |
Kojto | 115:87f2f5183dfb | 685 | /* Private macros ------------------------------------------------------------*/ |
Kojto | 115:87f2f5183dfb | 686 | /** @defgroup DMA_Private_Macros DMA Private Macros |
Kojto | 115:87f2f5183dfb | 687 | * @brief DMA private macros |
Kojto | 115:87f2f5183dfb | 688 | * @{ |
Kojto | 115:87f2f5183dfb | 689 | */ |
Kojto | 115:87f2f5183dfb | 690 | #define IS_DMA_CHANNEL(CHANNEL) (((CHANNEL) == DMA_CHANNEL_0) || \ |
Kojto | 115:87f2f5183dfb | 691 | ((CHANNEL) == DMA_CHANNEL_1) || \ |
Kojto | 115:87f2f5183dfb | 692 | ((CHANNEL) == DMA_CHANNEL_2) || \ |
Kojto | 115:87f2f5183dfb | 693 | ((CHANNEL) == DMA_CHANNEL_3) || \ |
Kojto | 115:87f2f5183dfb | 694 | ((CHANNEL) == DMA_CHANNEL_4) || \ |
Kojto | 115:87f2f5183dfb | 695 | ((CHANNEL) == DMA_CHANNEL_5) || \ |
Kojto | 115:87f2f5183dfb | 696 | ((CHANNEL) == DMA_CHANNEL_6) || \ |
Kojto | 115:87f2f5183dfb | 697 | ((CHANNEL) == DMA_CHANNEL_7)) |
Kojto | 115:87f2f5183dfb | 698 | |
Kojto | 115:87f2f5183dfb | 699 | #define IS_DMA_DIRECTION(DIRECTION) (((DIRECTION) == DMA_PERIPH_TO_MEMORY ) || \ |
Kojto | 115:87f2f5183dfb | 700 | ((DIRECTION) == DMA_MEMORY_TO_PERIPH) || \ |
Kojto | 115:87f2f5183dfb | 701 | ((DIRECTION) == DMA_MEMORY_TO_MEMORY)) |
Kojto | 115:87f2f5183dfb | 702 | |
Kojto | 115:87f2f5183dfb | 703 | #define IS_DMA_BUFFER_SIZE(SIZE) (((SIZE) >= 0x1) && ((SIZE) < 0x10000)) |
Kojto | 115:87f2f5183dfb | 704 | |
Kojto | 115:87f2f5183dfb | 705 | #define IS_DMA_PERIPHERAL_INC_STATE(STATE) (((STATE) == DMA_PINC_ENABLE) || \ |
Kojto | 115:87f2f5183dfb | 706 | ((STATE) == DMA_PINC_DISABLE)) |
Kojto | 115:87f2f5183dfb | 707 | |
Kojto | 115:87f2f5183dfb | 708 | #define IS_DMA_MEMORY_INC_STATE(STATE) (((STATE) == DMA_MINC_ENABLE) || \ |
Kojto | 115:87f2f5183dfb | 709 | ((STATE) == DMA_MINC_DISABLE)) |
Kojto | 115:87f2f5183dfb | 710 | |
Kojto | 115:87f2f5183dfb | 711 | #define IS_DMA_PERIPHERAL_DATA_SIZE(SIZE) (((SIZE) == DMA_PDATAALIGN_BYTE) || \ |
Kojto | 115:87f2f5183dfb | 712 | ((SIZE) == DMA_PDATAALIGN_HALFWORD) || \ |
Kojto | 115:87f2f5183dfb | 713 | ((SIZE) == DMA_PDATAALIGN_WORD)) |
Kojto | 115:87f2f5183dfb | 714 | |
Kojto | 115:87f2f5183dfb | 715 | #define IS_DMA_MEMORY_DATA_SIZE(SIZE) (((SIZE) == DMA_MDATAALIGN_BYTE) || \ |
Kojto | 115:87f2f5183dfb | 716 | ((SIZE) == DMA_MDATAALIGN_HALFWORD) || \ |
Kojto | 115:87f2f5183dfb | 717 | ((SIZE) == DMA_MDATAALIGN_WORD )) |
Kojto | 115:87f2f5183dfb | 718 | |
Kojto | 115:87f2f5183dfb | 719 | #define IS_DMA_MODE(MODE) (((MODE) == DMA_NORMAL ) || \ |
Kojto | 115:87f2f5183dfb | 720 | ((MODE) == DMA_CIRCULAR) || \ |
Kojto | 115:87f2f5183dfb | 721 | ((MODE) == DMA_PFCTRL)) |
Kojto | 115:87f2f5183dfb | 722 | |
Kojto | 115:87f2f5183dfb | 723 | #define IS_DMA_PRIORITY(PRIORITY) (((PRIORITY) == DMA_PRIORITY_LOW ) || \ |
Kojto | 115:87f2f5183dfb | 724 | ((PRIORITY) == DMA_PRIORITY_MEDIUM) || \ |
Kojto | 115:87f2f5183dfb | 725 | ((PRIORITY) == DMA_PRIORITY_HIGH) || \ |
Kojto | 115:87f2f5183dfb | 726 | ((PRIORITY) == DMA_PRIORITY_VERY_HIGH)) |
Kojto | 115:87f2f5183dfb | 727 | |
Kojto | 115:87f2f5183dfb | 728 | #define IS_DMA_FIFO_MODE_STATE(STATE) (((STATE) == DMA_FIFOMODE_DISABLE ) || \ |
Kojto | 115:87f2f5183dfb | 729 | ((STATE) == DMA_FIFOMODE_ENABLE)) |
Kojto | 115:87f2f5183dfb | 730 | |
Kojto | 115:87f2f5183dfb | 731 | #define IS_DMA_FIFO_THRESHOLD(THRESHOLD) (((THRESHOLD) == DMA_FIFO_THRESHOLD_1QUARTERFULL ) || \ |
Kojto | 115:87f2f5183dfb | 732 | ((THRESHOLD) == DMA_FIFO_THRESHOLD_HALFFULL) || \ |
Kojto | 115:87f2f5183dfb | 733 | ((THRESHOLD) == DMA_FIFO_THRESHOLD_3QUARTERSFULL) || \ |
Kojto | 115:87f2f5183dfb | 734 | ((THRESHOLD) == DMA_FIFO_THRESHOLD_FULL)) |
Kojto | 115:87f2f5183dfb | 735 | |
Kojto | 115:87f2f5183dfb | 736 | #define IS_DMA_MEMORY_BURST(BURST) (((BURST) == DMA_MBURST_SINGLE) || \ |
Kojto | 115:87f2f5183dfb | 737 | ((BURST) == DMA_MBURST_INC4) || \ |
Kojto | 115:87f2f5183dfb | 738 | ((BURST) == DMA_MBURST_INC8) || \ |
Kojto | 115:87f2f5183dfb | 739 | ((BURST) == DMA_MBURST_INC16)) |
Kojto | 115:87f2f5183dfb | 740 | |
Kojto | 115:87f2f5183dfb | 741 | #define IS_DMA_PERIPHERAL_BURST(BURST) (((BURST) == DMA_PBURST_SINGLE) || \ |
Kojto | 115:87f2f5183dfb | 742 | ((BURST) == DMA_PBURST_INC4) || \ |
Kojto | 115:87f2f5183dfb | 743 | ((BURST) == DMA_PBURST_INC8) || \ |
Kojto | 115:87f2f5183dfb | 744 | ((BURST) == DMA_PBURST_INC16)) |
Kojto | 115:87f2f5183dfb | 745 | /** |
Kojto | 115:87f2f5183dfb | 746 | * @} |
Kojto | 115:87f2f5183dfb | 747 | */ |
Kojto | 115:87f2f5183dfb | 748 | |
Kojto | 115:87f2f5183dfb | 749 | /* Private functions ---------------------------------------------------------*/ |
Kojto | 115:87f2f5183dfb | 750 | /** @defgroup DMA_Private_Functions DMA Private Functions |
Kojto | 115:87f2f5183dfb | 751 | * @brief DMA private functions |
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 | /** |
Kojto | 115:87f2f5183dfb | 763 | * @} |
Kojto | 115:87f2f5183dfb | 764 | */ |
Kojto | 115:87f2f5183dfb | 765 | |
Kojto | 115:87f2f5183dfb | 766 | #ifdef __cplusplus |
Kojto | 115:87f2f5183dfb | 767 | } |
Kojto | 115:87f2f5183dfb | 768 | #endif |
Kojto | 115:87f2f5183dfb | 769 | |
Kojto | 115:87f2f5183dfb | 770 | #endif /* __STM32F7xx_HAL_DMA_H */ |
Kojto | 115:87f2f5183dfb | 771 | |
Kojto | 115:87f2f5183dfb | 772 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |