mbed library sources
Fork of mbed-src by
targets/cmsis/TARGET_STM/TARGET_STM32F3XX/stm32f30x_dma.h@308:59cc78a25982, 2014-09-05 (annotated)
- Committer:
- todotani
- Date:
- Fri Sep 05 14:20:33 2014 +0000
- Revision:
- 308:59cc78a25982
- Parent:
- 155:8435094ec241
BLE_Health_Thermometer for mbed HRM1017 with BLE library 0.1.0
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mbed_official | 155:8435094ec241 | 1 | /** |
mbed_official | 155:8435094ec241 | 2 | ****************************************************************************** |
mbed_official | 155:8435094ec241 | 3 | * @file stm32f30x_dma.h |
mbed_official | 155:8435094ec241 | 4 | * @author MCD Application Team |
mbed_official | 155:8435094ec241 | 5 | * @version V1.1.0 |
mbed_official | 155:8435094ec241 | 6 | * @date 27-February-2014 |
mbed_official | 155:8435094ec241 | 7 | * @brief This file contains all the functions prototypes for the DMA firmware |
mbed_official | 155:8435094ec241 | 8 | * library. |
mbed_official | 155:8435094ec241 | 9 | ****************************************************************************** |
mbed_official | 155:8435094ec241 | 10 | * @attention |
mbed_official | 155:8435094ec241 | 11 | * |
mbed_official | 155:8435094ec241 | 12 | * <h2><center>© COPYRIGHT(c) 2014 STMicroelectronics</center></h2> |
mbed_official | 155:8435094ec241 | 13 | * |
mbed_official | 155:8435094ec241 | 14 | * Redistribution and use in source and binary forms, with or without modification, |
mbed_official | 155:8435094ec241 | 15 | * are permitted provided that the following conditions are met: |
mbed_official | 155:8435094ec241 | 16 | * 1. Redistributions of source code must retain the above copyright notice, |
mbed_official | 155:8435094ec241 | 17 | * this list of conditions and the following disclaimer. |
mbed_official | 155:8435094ec241 | 18 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
mbed_official | 155:8435094ec241 | 19 | * this list of conditions and the following disclaimer in the documentation |
mbed_official | 155:8435094ec241 | 20 | * and/or other materials provided with the distribution. |
mbed_official | 155:8435094ec241 | 21 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
mbed_official | 155:8435094ec241 | 22 | * may be used to endorse or promote products derived from this software |
mbed_official | 155:8435094ec241 | 23 | * without specific prior written permission. |
mbed_official | 155:8435094ec241 | 24 | * |
mbed_official | 155:8435094ec241 | 25 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
mbed_official | 155:8435094ec241 | 26 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
mbed_official | 155:8435094ec241 | 27 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
mbed_official | 155:8435094ec241 | 28 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
mbed_official | 155:8435094ec241 | 29 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
mbed_official | 155:8435094ec241 | 30 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
mbed_official | 155:8435094ec241 | 31 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
mbed_official | 155:8435094ec241 | 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
mbed_official | 155:8435094ec241 | 33 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
mbed_official | 155:8435094ec241 | 34 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
mbed_official | 155:8435094ec241 | 35 | * |
mbed_official | 155:8435094ec241 | 36 | ****************************************************************************** |
mbed_official | 155:8435094ec241 | 37 | */ |
mbed_official | 155:8435094ec241 | 38 | |
mbed_official | 155:8435094ec241 | 39 | /* Define to prevent recursive inclusion -------------------------------------*/ |
mbed_official | 155:8435094ec241 | 40 | #ifndef __STM32F30x_DMA_H |
mbed_official | 155:8435094ec241 | 41 | #define __STM32F30x_DMA_H |
mbed_official | 155:8435094ec241 | 42 | |
mbed_official | 155:8435094ec241 | 43 | #ifdef __cplusplus |
mbed_official | 155:8435094ec241 | 44 | extern "C" { |
mbed_official | 155:8435094ec241 | 45 | #endif |
mbed_official | 155:8435094ec241 | 46 | |
mbed_official | 155:8435094ec241 | 47 | /* Includes ------------------------------------------------------------------*/ |
mbed_official | 155:8435094ec241 | 48 | #include "stm32f30x.h" |
mbed_official | 155:8435094ec241 | 49 | |
mbed_official | 155:8435094ec241 | 50 | /** @addtogroup STM32F30x_StdPeriph_Driver |
mbed_official | 155:8435094ec241 | 51 | * @{ |
mbed_official | 155:8435094ec241 | 52 | */ |
mbed_official | 155:8435094ec241 | 53 | |
mbed_official | 155:8435094ec241 | 54 | /** @addtogroup DMA |
mbed_official | 155:8435094ec241 | 55 | * @{ |
mbed_official | 155:8435094ec241 | 56 | */ |
mbed_official | 155:8435094ec241 | 57 | |
mbed_official | 155:8435094ec241 | 58 | /* Exported types ------------------------------------------------------------*/ |
mbed_official | 155:8435094ec241 | 59 | |
mbed_official | 155:8435094ec241 | 60 | /** |
mbed_official | 155:8435094ec241 | 61 | * @brief DMA Init structures definition |
mbed_official | 155:8435094ec241 | 62 | */ |
mbed_official | 155:8435094ec241 | 63 | typedef struct |
mbed_official | 155:8435094ec241 | 64 | { |
mbed_official | 155:8435094ec241 | 65 | uint32_t DMA_PeripheralBaseAddr; /*!< Specifies the peripheral base address for DMAy Channelx. */ |
mbed_official | 155:8435094ec241 | 66 | |
mbed_official | 155:8435094ec241 | 67 | uint32_t DMA_MemoryBaseAddr; /*!< Specifies the memory base address for DMAy Channelx. */ |
mbed_official | 155:8435094ec241 | 68 | |
mbed_official | 155:8435094ec241 | 69 | uint32_t DMA_DIR; /*!< Specifies if the peripheral is the source or destination. |
mbed_official | 155:8435094ec241 | 70 | This parameter can be a value of @ref DMA_data_transfer_direction */ |
mbed_official | 155:8435094ec241 | 71 | |
mbed_official | 155:8435094ec241 | 72 | uint16_t DMA_BufferSize; /*!< Specifies the buffer size, in data unit, of the specified Channel. |
mbed_official | 155:8435094ec241 | 73 | The data unit is equal to the configuration set in DMA_PeripheralDataSize |
mbed_official | 155:8435094ec241 | 74 | or DMA_MemoryDataSize members depending in the transfer direction. */ |
mbed_official | 155:8435094ec241 | 75 | |
mbed_official | 155:8435094ec241 | 76 | uint32_t DMA_PeripheralInc; /*!< Specifies whether the Peripheral address register is incremented or not. |
mbed_official | 155:8435094ec241 | 77 | This parameter can be a value of @ref DMA_peripheral_incremented_mode */ |
mbed_official | 155:8435094ec241 | 78 | |
mbed_official | 155:8435094ec241 | 79 | uint32_t DMA_MemoryInc; /*!< Specifies whether the memory address register is incremented or not. |
mbed_official | 155:8435094ec241 | 80 | This parameter can be a value of @ref DMA_memory_incremented_mode */ |
mbed_official | 155:8435094ec241 | 81 | |
mbed_official | 155:8435094ec241 | 82 | uint32_t DMA_PeripheralDataSize; /*!< Specifies the Peripheral data width. |
mbed_official | 155:8435094ec241 | 83 | This parameter can be a value of @ref DMA_peripheral_data_size */ |
mbed_official | 155:8435094ec241 | 84 | |
mbed_official | 155:8435094ec241 | 85 | uint32_t DMA_MemoryDataSize; /*!< Specifies the Memory data width. |
mbed_official | 155:8435094ec241 | 86 | This parameter can be a value of @ref DMA_memory_data_size */ |
mbed_official | 155:8435094ec241 | 87 | |
mbed_official | 155:8435094ec241 | 88 | uint32_t DMA_Mode; /*!< Specifies the operation mode of the DMAy Channelx. |
mbed_official | 155:8435094ec241 | 89 | This parameter can be a value of @ref DMA_circular_normal_mode |
mbed_official | 155:8435094ec241 | 90 | @note: The circular buffer mode cannot be used if the memory-to-memory |
mbed_official | 155:8435094ec241 | 91 | data transfer is configured on the selected Channel */ |
mbed_official | 155:8435094ec241 | 92 | |
mbed_official | 155:8435094ec241 | 93 | uint32_t DMA_Priority; /*!< Specifies the software priority for the DMAy Channelx. |
mbed_official | 155:8435094ec241 | 94 | This parameter can be a value of @ref DMA_priority_level */ |
mbed_official | 155:8435094ec241 | 95 | |
mbed_official | 155:8435094ec241 | 96 | uint32_t DMA_M2M; /*!< Specifies if the DMAy Channelx will be used in memory-to-memory transfer. |
mbed_official | 155:8435094ec241 | 97 | This parameter can be a value of @ref DMA_memory_to_memory */ |
mbed_official | 155:8435094ec241 | 98 | }DMA_InitTypeDef; |
mbed_official | 155:8435094ec241 | 99 | |
mbed_official | 155:8435094ec241 | 100 | /* Exported constants --------------------------------------------------------*/ |
mbed_official | 155:8435094ec241 | 101 | |
mbed_official | 155:8435094ec241 | 102 | /** @defgroup DMA_Exported_Constants |
mbed_official | 155:8435094ec241 | 103 | * @{ |
mbed_official | 155:8435094ec241 | 104 | */ |
mbed_official | 155:8435094ec241 | 105 | |
mbed_official | 155:8435094ec241 | 106 | #define IS_DMA_ALL_PERIPH(PERIPH) (((PERIPH) == DMA1_Channel1) || \ |
mbed_official | 155:8435094ec241 | 107 | ((PERIPH) == DMA1_Channel2) || \ |
mbed_official | 155:8435094ec241 | 108 | ((PERIPH) == DMA1_Channel3) || \ |
mbed_official | 155:8435094ec241 | 109 | ((PERIPH) == DMA1_Channel4) || \ |
mbed_official | 155:8435094ec241 | 110 | ((PERIPH) == DMA1_Channel5) || \ |
mbed_official | 155:8435094ec241 | 111 | ((PERIPH) == DMA1_Channel6) || \ |
mbed_official | 155:8435094ec241 | 112 | ((PERIPH) == DMA1_Channel7) || \ |
mbed_official | 155:8435094ec241 | 113 | ((PERIPH) == DMA2_Channel1) || \ |
mbed_official | 155:8435094ec241 | 114 | ((PERIPH) == DMA2_Channel2) || \ |
mbed_official | 155:8435094ec241 | 115 | ((PERIPH) == DMA2_Channel3) || \ |
mbed_official | 155:8435094ec241 | 116 | ((PERIPH) == DMA2_Channel4) || \ |
mbed_official | 155:8435094ec241 | 117 | ((PERIPH) == DMA2_Channel5)) |
mbed_official | 155:8435094ec241 | 118 | |
mbed_official | 155:8435094ec241 | 119 | /** @defgroup DMA_data_transfer_direction |
mbed_official | 155:8435094ec241 | 120 | * @{ |
mbed_official | 155:8435094ec241 | 121 | */ |
mbed_official | 155:8435094ec241 | 122 | |
mbed_official | 155:8435094ec241 | 123 | #define DMA_DIR_PeripheralSRC ((uint32_t)0x00000000) |
mbed_official | 155:8435094ec241 | 124 | #define DMA_DIR_PeripheralDST DMA_CCR_DIR |
mbed_official | 155:8435094ec241 | 125 | |
mbed_official | 155:8435094ec241 | 126 | #define IS_DMA_DIR(DIR) (((DIR) == DMA_DIR_PeripheralSRC) || \ |
mbed_official | 155:8435094ec241 | 127 | ((DIR) == DMA_DIR_PeripheralDST)) |
mbed_official | 155:8435094ec241 | 128 | /** |
mbed_official | 155:8435094ec241 | 129 | * @} |
mbed_official | 155:8435094ec241 | 130 | */ |
mbed_official | 155:8435094ec241 | 131 | |
mbed_official | 155:8435094ec241 | 132 | |
mbed_official | 155:8435094ec241 | 133 | /** @defgroup DMA_peripheral_incremented_mode |
mbed_official | 155:8435094ec241 | 134 | * @{ |
mbed_official | 155:8435094ec241 | 135 | */ |
mbed_official | 155:8435094ec241 | 136 | |
mbed_official | 155:8435094ec241 | 137 | #define DMA_PeripheralInc_Disable ((uint32_t)0x00000000) |
mbed_official | 155:8435094ec241 | 138 | #define DMA_PeripheralInc_Enable DMA_CCR_PINC |
mbed_official | 155:8435094ec241 | 139 | |
mbed_official | 155:8435094ec241 | 140 | #define IS_DMA_PERIPHERAL_INC_STATE(STATE) (((STATE) == DMA_PeripheralInc_Disable) || \ |
mbed_official | 155:8435094ec241 | 141 | ((STATE) == DMA_PeripheralInc_Enable)) |
mbed_official | 155:8435094ec241 | 142 | /** |
mbed_official | 155:8435094ec241 | 143 | * @} |
mbed_official | 155:8435094ec241 | 144 | */ |
mbed_official | 155:8435094ec241 | 145 | |
mbed_official | 155:8435094ec241 | 146 | /** @defgroup DMA_memory_incremented_mode |
mbed_official | 155:8435094ec241 | 147 | * @{ |
mbed_official | 155:8435094ec241 | 148 | */ |
mbed_official | 155:8435094ec241 | 149 | |
mbed_official | 155:8435094ec241 | 150 | #define DMA_MemoryInc_Disable ((uint32_t)0x00000000) |
mbed_official | 155:8435094ec241 | 151 | #define DMA_MemoryInc_Enable DMA_CCR_MINC |
mbed_official | 155:8435094ec241 | 152 | |
mbed_official | 155:8435094ec241 | 153 | #define IS_DMA_MEMORY_INC_STATE(STATE) (((STATE) == DMA_MemoryInc_Disable) || \ |
mbed_official | 155:8435094ec241 | 154 | ((STATE) == DMA_MemoryInc_Enable)) |
mbed_official | 155:8435094ec241 | 155 | /** |
mbed_official | 155:8435094ec241 | 156 | * @} |
mbed_official | 155:8435094ec241 | 157 | */ |
mbed_official | 155:8435094ec241 | 158 | |
mbed_official | 155:8435094ec241 | 159 | /** @defgroup DMA_peripheral_data_size |
mbed_official | 155:8435094ec241 | 160 | * @{ |
mbed_official | 155:8435094ec241 | 161 | */ |
mbed_official | 155:8435094ec241 | 162 | |
mbed_official | 155:8435094ec241 | 163 | #define DMA_PeripheralDataSize_Byte ((uint32_t)0x00000000) |
mbed_official | 155:8435094ec241 | 164 | #define DMA_PeripheralDataSize_HalfWord DMA_CCR_PSIZE_0 |
mbed_official | 155:8435094ec241 | 165 | #define DMA_PeripheralDataSize_Word DMA_CCR_PSIZE_1 |
mbed_official | 155:8435094ec241 | 166 | |
mbed_official | 155:8435094ec241 | 167 | #define IS_DMA_PERIPHERAL_DATA_SIZE(SIZE) (((SIZE) == DMA_PeripheralDataSize_Byte) || \ |
mbed_official | 155:8435094ec241 | 168 | ((SIZE) == DMA_PeripheralDataSize_HalfWord) || \ |
mbed_official | 155:8435094ec241 | 169 | ((SIZE) == DMA_PeripheralDataSize_Word)) |
mbed_official | 155:8435094ec241 | 170 | /** |
mbed_official | 155:8435094ec241 | 171 | * @} |
mbed_official | 155:8435094ec241 | 172 | */ |
mbed_official | 155:8435094ec241 | 173 | |
mbed_official | 155:8435094ec241 | 174 | /** @defgroup DMA_memory_data_size |
mbed_official | 155:8435094ec241 | 175 | * @{ |
mbed_official | 155:8435094ec241 | 176 | */ |
mbed_official | 155:8435094ec241 | 177 | |
mbed_official | 155:8435094ec241 | 178 | #define DMA_MemoryDataSize_Byte ((uint32_t)0x00000000) |
mbed_official | 155:8435094ec241 | 179 | #define DMA_MemoryDataSize_HalfWord DMA_CCR_MSIZE_0 |
mbed_official | 155:8435094ec241 | 180 | #define DMA_MemoryDataSize_Word DMA_CCR_MSIZE_1 |
mbed_official | 155:8435094ec241 | 181 | |
mbed_official | 155:8435094ec241 | 182 | #define IS_DMA_MEMORY_DATA_SIZE(SIZE) (((SIZE) == DMA_MemoryDataSize_Byte) || \ |
mbed_official | 155:8435094ec241 | 183 | ((SIZE) == DMA_MemoryDataSize_HalfWord) || \ |
mbed_official | 155:8435094ec241 | 184 | ((SIZE) == DMA_MemoryDataSize_Word)) |
mbed_official | 155:8435094ec241 | 185 | /** |
mbed_official | 155:8435094ec241 | 186 | * @} |
mbed_official | 155:8435094ec241 | 187 | */ |
mbed_official | 155:8435094ec241 | 188 | |
mbed_official | 155:8435094ec241 | 189 | /** @defgroup DMA_circular_normal_mode |
mbed_official | 155:8435094ec241 | 190 | * @{ |
mbed_official | 155:8435094ec241 | 191 | */ |
mbed_official | 155:8435094ec241 | 192 | |
mbed_official | 155:8435094ec241 | 193 | #define DMA_Mode_Normal ((uint32_t)0x00000000) |
mbed_official | 155:8435094ec241 | 194 | #define DMA_Mode_Circular DMA_CCR_CIRC |
mbed_official | 155:8435094ec241 | 195 | |
mbed_official | 155:8435094ec241 | 196 | #define IS_DMA_MODE(MODE) (((MODE) == DMA_Mode_Normal) || ((MODE) == DMA_Mode_Circular)) |
mbed_official | 155:8435094ec241 | 197 | /** |
mbed_official | 155:8435094ec241 | 198 | * @} |
mbed_official | 155:8435094ec241 | 199 | */ |
mbed_official | 155:8435094ec241 | 200 | |
mbed_official | 155:8435094ec241 | 201 | /** @defgroup DMA_priority_level |
mbed_official | 155:8435094ec241 | 202 | * @{ |
mbed_official | 155:8435094ec241 | 203 | */ |
mbed_official | 155:8435094ec241 | 204 | |
mbed_official | 155:8435094ec241 | 205 | #define DMA_Priority_VeryHigh DMA_CCR_PL |
mbed_official | 155:8435094ec241 | 206 | #define DMA_Priority_High DMA_CCR_PL_1 |
mbed_official | 155:8435094ec241 | 207 | #define DMA_Priority_Medium DMA_CCR_PL_0 |
mbed_official | 155:8435094ec241 | 208 | #define DMA_Priority_Low ((uint32_t)0x00000000) |
mbed_official | 155:8435094ec241 | 209 | |
mbed_official | 155:8435094ec241 | 210 | #define IS_DMA_PRIORITY(PRIORITY) (((PRIORITY) == DMA_Priority_VeryHigh) || \ |
mbed_official | 155:8435094ec241 | 211 | ((PRIORITY) == DMA_Priority_High) || \ |
mbed_official | 155:8435094ec241 | 212 | ((PRIORITY) == DMA_Priority_Medium) || \ |
mbed_official | 155:8435094ec241 | 213 | ((PRIORITY) == DMA_Priority_Low)) |
mbed_official | 155:8435094ec241 | 214 | /** |
mbed_official | 155:8435094ec241 | 215 | * @} |
mbed_official | 155:8435094ec241 | 216 | */ |
mbed_official | 155:8435094ec241 | 217 | |
mbed_official | 155:8435094ec241 | 218 | /** @defgroup DMA_memory_to_memory |
mbed_official | 155:8435094ec241 | 219 | * @{ |
mbed_official | 155:8435094ec241 | 220 | */ |
mbed_official | 155:8435094ec241 | 221 | |
mbed_official | 155:8435094ec241 | 222 | #define DMA_M2M_Disable ((uint32_t)0x00000000) |
mbed_official | 155:8435094ec241 | 223 | #define DMA_M2M_Enable DMA_CCR_MEM2MEM |
mbed_official | 155:8435094ec241 | 224 | |
mbed_official | 155:8435094ec241 | 225 | #define IS_DMA_M2M_STATE(STATE) (((STATE) == DMA_M2M_Disable) || ((STATE) == DMA_M2M_Enable)) |
mbed_official | 155:8435094ec241 | 226 | |
mbed_official | 155:8435094ec241 | 227 | /** |
mbed_official | 155:8435094ec241 | 228 | * @} |
mbed_official | 155:8435094ec241 | 229 | */ |
mbed_official | 155:8435094ec241 | 230 | |
mbed_official | 155:8435094ec241 | 231 | /** @defgroup DMA_interrupts_definition |
mbed_official | 155:8435094ec241 | 232 | * @{ |
mbed_official | 155:8435094ec241 | 233 | */ |
mbed_official | 155:8435094ec241 | 234 | |
mbed_official | 155:8435094ec241 | 235 | #define DMA_IT_TC ((uint32_t)0x00000002) |
mbed_official | 155:8435094ec241 | 236 | #define DMA_IT_HT ((uint32_t)0x00000004) |
mbed_official | 155:8435094ec241 | 237 | #define DMA_IT_TE ((uint32_t)0x00000008) |
mbed_official | 155:8435094ec241 | 238 | #define IS_DMA_CONFIG_IT(IT) ((((IT) & 0xFFFFFFF1) == 0x00) && ((IT) != 0x00)) |
mbed_official | 155:8435094ec241 | 239 | |
mbed_official | 155:8435094ec241 | 240 | #define DMA1_IT_GL1 ((uint32_t)0x00000001) |
mbed_official | 155:8435094ec241 | 241 | #define DMA1_IT_TC1 ((uint32_t)0x00000002) |
mbed_official | 155:8435094ec241 | 242 | #define DMA1_IT_HT1 ((uint32_t)0x00000004) |
mbed_official | 155:8435094ec241 | 243 | #define DMA1_IT_TE1 ((uint32_t)0x00000008) |
mbed_official | 155:8435094ec241 | 244 | #define DMA1_IT_GL2 ((uint32_t)0x00000010) |
mbed_official | 155:8435094ec241 | 245 | #define DMA1_IT_TC2 ((uint32_t)0x00000020) |
mbed_official | 155:8435094ec241 | 246 | #define DMA1_IT_HT2 ((uint32_t)0x00000040) |
mbed_official | 155:8435094ec241 | 247 | #define DMA1_IT_TE2 ((uint32_t)0x00000080) |
mbed_official | 155:8435094ec241 | 248 | #define DMA1_IT_GL3 ((uint32_t)0x00000100) |
mbed_official | 155:8435094ec241 | 249 | #define DMA1_IT_TC3 ((uint32_t)0x00000200) |
mbed_official | 155:8435094ec241 | 250 | #define DMA1_IT_HT3 ((uint32_t)0x00000400) |
mbed_official | 155:8435094ec241 | 251 | #define DMA1_IT_TE3 ((uint32_t)0x00000800) |
mbed_official | 155:8435094ec241 | 252 | #define DMA1_IT_GL4 ((uint32_t)0x00001000) |
mbed_official | 155:8435094ec241 | 253 | #define DMA1_IT_TC4 ((uint32_t)0x00002000) |
mbed_official | 155:8435094ec241 | 254 | #define DMA1_IT_HT4 ((uint32_t)0x00004000) |
mbed_official | 155:8435094ec241 | 255 | #define DMA1_IT_TE4 ((uint32_t)0x00008000) |
mbed_official | 155:8435094ec241 | 256 | #define DMA1_IT_GL5 ((uint32_t)0x00010000) |
mbed_official | 155:8435094ec241 | 257 | #define DMA1_IT_TC5 ((uint32_t)0x00020000) |
mbed_official | 155:8435094ec241 | 258 | #define DMA1_IT_HT5 ((uint32_t)0x00040000) |
mbed_official | 155:8435094ec241 | 259 | #define DMA1_IT_TE5 ((uint32_t)0x00080000) |
mbed_official | 155:8435094ec241 | 260 | #define DMA1_IT_GL6 ((uint32_t)0x00100000) |
mbed_official | 155:8435094ec241 | 261 | #define DMA1_IT_TC6 ((uint32_t)0x00200000) |
mbed_official | 155:8435094ec241 | 262 | #define DMA1_IT_HT6 ((uint32_t)0x00400000) |
mbed_official | 155:8435094ec241 | 263 | #define DMA1_IT_TE6 ((uint32_t)0x00800000) |
mbed_official | 155:8435094ec241 | 264 | #define DMA1_IT_GL7 ((uint32_t)0x01000000) |
mbed_official | 155:8435094ec241 | 265 | #define DMA1_IT_TC7 ((uint32_t)0x02000000) |
mbed_official | 155:8435094ec241 | 266 | #define DMA1_IT_HT7 ((uint32_t)0x04000000) |
mbed_official | 155:8435094ec241 | 267 | #define DMA1_IT_TE7 ((uint32_t)0x08000000) |
mbed_official | 155:8435094ec241 | 268 | |
mbed_official | 155:8435094ec241 | 269 | #define DMA2_IT_GL1 ((uint32_t)0x10000001) |
mbed_official | 155:8435094ec241 | 270 | #define DMA2_IT_TC1 ((uint32_t)0x10000002) |
mbed_official | 155:8435094ec241 | 271 | #define DMA2_IT_HT1 ((uint32_t)0x10000004) |
mbed_official | 155:8435094ec241 | 272 | #define DMA2_IT_TE1 ((uint32_t)0x10000008) |
mbed_official | 155:8435094ec241 | 273 | #define DMA2_IT_GL2 ((uint32_t)0x10000010) |
mbed_official | 155:8435094ec241 | 274 | #define DMA2_IT_TC2 ((uint32_t)0x10000020) |
mbed_official | 155:8435094ec241 | 275 | #define DMA2_IT_HT2 ((uint32_t)0x10000040) |
mbed_official | 155:8435094ec241 | 276 | #define DMA2_IT_TE2 ((uint32_t)0x10000080) |
mbed_official | 155:8435094ec241 | 277 | #define DMA2_IT_GL3 ((uint32_t)0x10000100) |
mbed_official | 155:8435094ec241 | 278 | #define DMA2_IT_TC3 ((uint32_t)0x10000200) |
mbed_official | 155:8435094ec241 | 279 | #define DMA2_IT_HT3 ((uint32_t)0x10000400) |
mbed_official | 155:8435094ec241 | 280 | #define DMA2_IT_TE3 ((uint32_t)0x10000800) |
mbed_official | 155:8435094ec241 | 281 | #define DMA2_IT_GL4 ((uint32_t)0x10001000) |
mbed_official | 155:8435094ec241 | 282 | #define DMA2_IT_TC4 ((uint32_t)0x10002000) |
mbed_official | 155:8435094ec241 | 283 | #define DMA2_IT_HT4 ((uint32_t)0x10004000) |
mbed_official | 155:8435094ec241 | 284 | #define DMA2_IT_TE4 ((uint32_t)0x10008000) |
mbed_official | 155:8435094ec241 | 285 | #define DMA2_IT_GL5 ((uint32_t)0x10010000) |
mbed_official | 155:8435094ec241 | 286 | #define DMA2_IT_TC5 ((uint32_t)0x10020000) |
mbed_official | 155:8435094ec241 | 287 | #define DMA2_IT_HT5 ((uint32_t)0x10040000) |
mbed_official | 155:8435094ec241 | 288 | #define DMA2_IT_TE5 ((uint32_t)0x10080000) |
mbed_official | 155:8435094ec241 | 289 | |
mbed_official | 155:8435094ec241 | 290 | #define IS_DMA_CLEAR_IT(IT) (((((IT) & 0xF0000000) == 0x00) || (((IT) & 0xEFF00000) == 0x00)) && ((IT) != 0x00)) |
mbed_official | 155:8435094ec241 | 291 | |
mbed_official | 155:8435094ec241 | 292 | #define IS_DMA_GET_IT(IT) (((IT) == DMA1_IT_GL1) || ((IT) == DMA1_IT_TC1) || \ |
mbed_official | 155:8435094ec241 | 293 | ((IT) == DMA1_IT_HT1) || ((IT) == DMA1_IT_TE1) || \ |
mbed_official | 155:8435094ec241 | 294 | ((IT) == DMA1_IT_GL2) || ((IT) == DMA1_IT_TC2) || \ |
mbed_official | 155:8435094ec241 | 295 | ((IT) == DMA1_IT_HT2) || ((IT) == DMA1_IT_TE2) || \ |
mbed_official | 155:8435094ec241 | 296 | ((IT) == DMA1_IT_GL3) || ((IT) == DMA1_IT_TC3) || \ |
mbed_official | 155:8435094ec241 | 297 | ((IT) == DMA1_IT_HT3) || ((IT) == DMA1_IT_TE3) || \ |
mbed_official | 155:8435094ec241 | 298 | ((IT) == DMA1_IT_GL4) || ((IT) == DMA1_IT_TC4) || \ |
mbed_official | 155:8435094ec241 | 299 | ((IT) == DMA1_IT_HT4) || ((IT) == DMA1_IT_TE4) || \ |
mbed_official | 155:8435094ec241 | 300 | ((IT) == DMA1_IT_GL5) || ((IT) == DMA1_IT_TC5) || \ |
mbed_official | 155:8435094ec241 | 301 | ((IT) == DMA1_IT_HT5) || ((IT) == DMA1_IT_TE5) || \ |
mbed_official | 155:8435094ec241 | 302 | ((IT) == DMA1_IT_GL6) || ((IT) == DMA1_IT_TC6) || \ |
mbed_official | 155:8435094ec241 | 303 | ((IT) == DMA1_IT_HT6) || ((IT) == DMA1_IT_TE6) || \ |
mbed_official | 155:8435094ec241 | 304 | ((IT) == DMA1_IT_GL7) || ((IT) == DMA1_IT_TC7) || \ |
mbed_official | 155:8435094ec241 | 305 | ((IT) == DMA1_IT_HT7) || ((IT) == DMA1_IT_TE7) || \ |
mbed_official | 155:8435094ec241 | 306 | ((IT) == DMA2_IT_GL1) || ((IT) == DMA2_IT_TC1) || \ |
mbed_official | 155:8435094ec241 | 307 | ((IT) == DMA2_IT_HT1) || ((IT) == DMA2_IT_TE1) || \ |
mbed_official | 155:8435094ec241 | 308 | ((IT) == DMA2_IT_GL2) || ((IT) == DMA2_IT_TC2) || \ |
mbed_official | 155:8435094ec241 | 309 | ((IT) == DMA2_IT_HT2) || ((IT) == DMA2_IT_TE2) || \ |
mbed_official | 155:8435094ec241 | 310 | ((IT) == DMA2_IT_GL3) || ((IT) == DMA2_IT_TC3) || \ |
mbed_official | 155:8435094ec241 | 311 | ((IT) == DMA2_IT_HT3) || ((IT) == DMA2_IT_TE3) || \ |
mbed_official | 155:8435094ec241 | 312 | ((IT) == DMA2_IT_GL4) || ((IT) == DMA2_IT_TC4) || \ |
mbed_official | 155:8435094ec241 | 313 | ((IT) == DMA2_IT_HT4) || ((IT) == DMA2_IT_TE4) || \ |
mbed_official | 155:8435094ec241 | 314 | ((IT) == DMA2_IT_GL5) || ((IT) == DMA2_IT_TC5) || \ |
mbed_official | 155:8435094ec241 | 315 | ((IT) == DMA2_IT_HT5) || ((IT) == DMA2_IT_TE5)) |
mbed_official | 155:8435094ec241 | 316 | |
mbed_official | 155:8435094ec241 | 317 | /** |
mbed_official | 155:8435094ec241 | 318 | * @} |
mbed_official | 155:8435094ec241 | 319 | */ |
mbed_official | 155:8435094ec241 | 320 | |
mbed_official | 155:8435094ec241 | 321 | /** @defgroup DMA_flags_definition |
mbed_official | 155:8435094ec241 | 322 | * @{ |
mbed_official | 155:8435094ec241 | 323 | */ |
mbed_official | 155:8435094ec241 | 324 | |
mbed_official | 155:8435094ec241 | 325 | #define DMA1_FLAG_GL1 ((uint32_t)0x00000001) |
mbed_official | 155:8435094ec241 | 326 | #define DMA1_FLAG_TC1 ((uint32_t)0x00000002) |
mbed_official | 155:8435094ec241 | 327 | #define DMA1_FLAG_HT1 ((uint32_t)0x00000004) |
mbed_official | 155:8435094ec241 | 328 | #define DMA1_FLAG_TE1 ((uint32_t)0x00000008) |
mbed_official | 155:8435094ec241 | 329 | #define DMA1_FLAG_GL2 ((uint32_t)0x00000010) |
mbed_official | 155:8435094ec241 | 330 | #define DMA1_FLAG_TC2 ((uint32_t)0x00000020) |
mbed_official | 155:8435094ec241 | 331 | #define DMA1_FLAG_HT2 ((uint32_t)0x00000040) |
mbed_official | 155:8435094ec241 | 332 | #define DMA1_FLAG_TE2 ((uint32_t)0x00000080) |
mbed_official | 155:8435094ec241 | 333 | #define DMA1_FLAG_GL3 ((uint32_t)0x00000100) |
mbed_official | 155:8435094ec241 | 334 | #define DMA1_FLAG_TC3 ((uint32_t)0x00000200) |
mbed_official | 155:8435094ec241 | 335 | #define DMA1_FLAG_HT3 ((uint32_t)0x00000400) |
mbed_official | 155:8435094ec241 | 336 | #define DMA1_FLAG_TE3 ((uint32_t)0x00000800) |
mbed_official | 155:8435094ec241 | 337 | #define DMA1_FLAG_GL4 ((uint32_t)0x00001000) |
mbed_official | 155:8435094ec241 | 338 | #define DMA1_FLAG_TC4 ((uint32_t)0x00002000) |
mbed_official | 155:8435094ec241 | 339 | #define DMA1_FLAG_HT4 ((uint32_t)0x00004000) |
mbed_official | 155:8435094ec241 | 340 | #define DMA1_FLAG_TE4 ((uint32_t)0x00008000) |
mbed_official | 155:8435094ec241 | 341 | #define DMA1_FLAG_GL5 ((uint32_t)0x00010000) |
mbed_official | 155:8435094ec241 | 342 | #define DMA1_FLAG_TC5 ((uint32_t)0x00020000) |
mbed_official | 155:8435094ec241 | 343 | #define DMA1_FLAG_HT5 ((uint32_t)0x00040000) |
mbed_official | 155:8435094ec241 | 344 | #define DMA1_FLAG_TE5 ((uint32_t)0x00080000) |
mbed_official | 155:8435094ec241 | 345 | #define DMA1_FLAG_GL6 ((uint32_t)0x00100000) |
mbed_official | 155:8435094ec241 | 346 | #define DMA1_FLAG_TC6 ((uint32_t)0x00200000) |
mbed_official | 155:8435094ec241 | 347 | #define DMA1_FLAG_HT6 ((uint32_t)0x00400000) |
mbed_official | 155:8435094ec241 | 348 | #define DMA1_FLAG_TE6 ((uint32_t)0x00800000) |
mbed_official | 155:8435094ec241 | 349 | #define DMA1_FLAG_GL7 ((uint32_t)0x01000000) |
mbed_official | 155:8435094ec241 | 350 | #define DMA1_FLAG_TC7 ((uint32_t)0x02000000) |
mbed_official | 155:8435094ec241 | 351 | #define DMA1_FLAG_HT7 ((uint32_t)0x04000000) |
mbed_official | 155:8435094ec241 | 352 | #define DMA1_FLAG_TE7 ((uint32_t)0x08000000) |
mbed_official | 155:8435094ec241 | 353 | |
mbed_official | 155:8435094ec241 | 354 | #define DMA2_FLAG_GL1 ((uint32_t)0x10000001) |
mbed_official | 155:8435094ec241 | 355 | #define DMA2_FLAG_TC1 ((uint32_t)0x10000002) |
mbed_official | 155:8435094ec241 | 356 | #define DMA2_FLAG_HT1 ((uint32_t)0x10000004) |
mbed_official | 155:8435094ec241 | 357 | #define DMA2_FLAG_TE1 ((uint32_t)0x10000008) |
mbed_official | 155:8435094ec241 | 358 | #define DMA2_FLAG_GL2 ((uint32_t)0x10000010) |
mbed_official | 155:8435094ec241 | 359 | #define DMA2_FLAG_TC2 ((uint32_t)0x10000020) |
mbed_official | 155:8435094ec241 | 360 | #define DMA2_FLAG_HT2 ((uint32_t)0x10000040) |
mbed_official | 155:8435094ec241 | 361 | #define DMA2_FLAG_TE2 ((uint32_t)0x10000080) |
mbed_official | 155:8435094ec241 | 362 | #define DMA2_FLAG_GL3 ((uint32_t)0x10000100) |
mbed_official | 155:8435094ec241 | 363 | #define DMA2_FLAG_TC3 ((uint32_t)0x10000200) |
mbed_official | 155:8435094ec241 | 364 | #define DMA2_FLAG_HT3 ((uint32_t)0x10000400) |
mbed_official | 155:8435094ec241 | 365 | #define DMA2_FLAG_TE3 ((uint32_t)0x10000800) |
mbed_official | 155:8435094ec241 | 366 | #define DMA2_FLAG_GL4 ((uint32_t)0x10001000) |
mbed_official | 155:8435094ec241 | 367 | #define DMA2_FLAG_TC4 ((uint32_t)0x10002000) |
mbed_official | 155:8435094ec241 | 368 | #define DMA2_FLAG_HT4 ((uint32_t)0x10004000) |
mbed_official | 155:8435094ec241 | 369 | #define DMA2_FLAG_TE4 ((uint32_t)0x10008000) |
mbed_official | 155:8435094ec241 | 370 | #define DMA2_FLAG_GL5 ((uint32_t)0x10010000) |
mbed_official | 155:8435094ec241 | 371 | #define DMA2_FLAG_TC5 ((uint32_t)0x10020000) |
mbed_official | 155:8435094ec241 | 372 | #define DMA2_FLAG_HT5 ((uint32_t)0x10040000) |
mbed_official | 155:8435094ec241 | 373 | #define DMA2_FLAG_TE5 ((uint32_t)0x10080000) |
mbed_official | 155:8435094ec241 | 374 | |
mbed_official | 155:8435094ec241 | 375 | #define IS_DMA_CLEAR_FLAG(FLAG) (((((FLAG) & 0xF0000000) == 0x00) || (((FLAG) & 0xEFF00000) == 0x00)) && ((FLAG) != 0x00)) |
mbed_official | 155:8435094ec241 | 376 | |
mbed_official | 155:8435094ec241 | 377 | #define IS_DMA_GET_FLAG(FLAG) (((FLAG) == DMA1_FLAG_GL1) || ((FLAG) == DMA1_FLAG_TC1) || \ |
mbed_official | 155:8435094ec241 | 378 | ((FLAG) == DMA1_FLAG_HT1) || ((FLAG) == DMA1_FLAG_TE1) || \ |
mbed_official | 155:8435094ec241 | 379 | ((FLAG) == DMA1_FLAG_GL2) || ((FLAG) == DMA1_FLAG_TC2) || \ |
mbed_official | 155:8435094ec241 | 380 | ((FLAG) == DMA1_FLAG_HT2) || ((FLAG) == DMA1_FLAG_TE2) || \ |
mbed_official | 155:8435094ec241 | 381 | ((FLAG) == DMA1_FLAG_GL3) || ((FLAG) == DMA1_FLAG_TC3) || \ |
mbed_official | 155:8435094ec241 | 382 | ((FLAG) == DMA1_FLAG_HT3) || ((FLAG) == DMA1_FLAG_TE3) || \ |
mbed_official | 155:8435094ec241 | 383 | ((FLAG) == DMA1_FLAG_GL4) || ((FLAG) == DMA1_FLAG_TC4) || \ |
mbed_official | 155:8435094ec241 | 384 | ((FLAG) == DMA1_FLAG_HT4) || ((FLAG) == DMA1_FLAG_TE4) || \ |
mbed_official | 155:8435094ec241 | 385 | ((FLAG) == DMA1_FLAG_GL5) || ((FLAG) == DMA1_FLAG_TC5) || \ |
mbed_official | 155:8435094ec241 | 386 | ((FLAG) == DMA1_FLAG_HT5) || ((FLAG) == DMA1_FLAG_TE5) || \ |
mbed_official | 155:8435094ec241 | 387 | ((FLAG) == DMA1_FLAG_GL6) || ((FLAG) == DMA1_FLAG_TC6) || \ |
mbed_official | 155:8435094ec241 | 388 | ((FLAG) == DMA1_FLAG_HT6) || ((FLAG) == DMA1_FLAG_TE6) || \ |
mbed_official | 155:8435094ec241 | 389 | ((FLAG) == DMA1_FLAG_GL7) || ((FLAG) == DMA1_FLAG_TC7) || \ |
mbed_official | 155:8435094ec241 | 390 | ((FLAG) == DMA1_FLAG_HT7) || ((FLAG) == DMA1_FLAG_TE7) || \ |
mbed_official | 155:8435094ec241 | 391 | ((FLAG) == DMA2_FLAG_GL1) || ((FLAG) == DMA2_FLAG_TC1) || \ |
mbed_official | 155:8435094ec241 | 392 | ((FLAG) == DMA2_FLAG_HT1) || ((FLAG) == DMA2_FLAG_TE1) || \ |
mbed_official | 155:8435094ec241 | 393 | ((FLAG) == DMA2_FLAG_GL2) || ((FLAG) == DMA2_FLAG_TC2) || \ |
mbed_official | 155:8435094ec241 | 394 | ((FLAG) == DMA2_FLAG_HT2) || ((FLAG) == DMA2_FLAG_TE2) || \ |
mbed_official | 155:8435094ec241 | 395 | ((FLAG) == DMA2_FLAG_GL3) || ((FLAG) == DMA2_FLAG_TC3) || \ |
mbed_official | 155:8435094ec241 | 396 | ((FLAG) == DMA2_FLAG_HT3) || ((FLAG) == DMA2_FLAG_TE3) || \ |
mbed_official | 155:8435094ec241 | 397 | ((FLAG) == DMA2_FLAG_GL4) || ((FLAG) == DMA2_FLAG_TC4) || \ |
mbed_official | 155:8435094ec241 | 398 | ((FLAG) == DMA2_FLAG_HT4) || ((FLAG) == DMA2_FLAG_TE4) || \ |
mbed_official | 155:8435094ec241 | 399 | ((FLAG) == DMA2_FLAG_GL5) || ((FLAG) == DMA2_FLAG_TC5) || \ |
mbed_official | 155:8435094ec241 | 400 | ((FLAG) == DMA2_FLAG_HT5) || ((FLAG) == DMA2_FLAG_TE5)) |
mbed_official | 155:8435094ec241 | 401 | |
mbed_official | 155:8435094ec241 | 402 | /** |
mbed_official | 155:8435094ec241 | 403 | * @} |
mbed_official | 155:8435094ec241 | 404 | */ |
mbed_official | 155:8435094ec241 | 405 | |
mbed_official | 155:8435094ec241 | 406 | /** |
mbed_official | 155:8435094ec241 | 407 | * @} |
mbed_official | 155:8435094ec241 | 408 | */ |
mbed_official | 155:8435094ec241 | 409 | |
mbed_official | 155:8435094ec241 | 410 | /* Exported macro ------------------------------------------------------------*/ |
mbed_official | 155:8435094ec241 | 411 | /* Exported functions ------------------------------------------------------- */ |
mbed_official | 155:8435094ec241 | 412 | |
mbed_official | 155:8435094ec241 | 413 | /* Function used to set the DMA configuration to the default reset state ******/ |
mbed_official | 155:8435094ec241 | 414 | void DMA_DeInit(DMA_Channel_TypeDef* DMAy_Channelx); |
mbed_official | 155:8435094ec241 | 415 | |
mbed_official | 155:8435094ec241 | 416 | /* Initialization and Configuration functions *********************************/ |
mbed_official | 155:8435094ec241 | 417 | void DMA_Init(DMA_Channel_TypeDef* DMAy_Channelx, DMA_InitTypeDef* DMA_InitStruct); |
mbed_official | 155:8435094ec241 | 418 | void DMA_StructInit(DMA_InitTypeDef* DMA_InitStruct); |
mbed_official | 155:8435094ec241 | 419 | void DMA_Cmd(DMA_Channel_TypeDef* DMAy_Channelx, FunctionalState NewState); |
mbed_official | 155:8435094ec241 | 420 | |
mbed_official | 155:8435094ec241 | 421 | /* Data Counter functions******************************************************/ |
mbed_official | 155:8435094ec241 | 422 | void DMA_SetCurrDataCounter(DMA_Channel_TypeDef* DMAy_Channelx, uint16_t DataNumber); |
mbed_official | 155:8435094ec241 | 423 | uint16_t DMA_GetCurrDataCounter(DMA_Channel_TypeDef* DMAy_Channelx); |
mbed_official | 155:8435094ec241 | 424 | |
mbed_official | 155:8435094ec241 | 425 | /* Interrupts and flags management functions **********************************/ |
mbed_official | 155:8435094ec241 | 426 | void DMA_ITConfig(DMA_Channel_TypeDef* DMAy_Channelx, uint32_t DMA_IT, FunctionalState NewState); |
mbed_official | 155:8435094ec241 | 427 | FlagStatus DMA_GetFlagStatus(uint32_t DMAy_FLAG); |
mbed_official | 155:8435094ec241 | 428 | void DMA_ClearFlag(uint32_t DMAy_FLAG); |
mbed_official | 155:8435094ec241 | 429 | ITStatus DMA_GetITStatus(uint32_t DMAy_IT); |
mbed_official | 155:8435094ec241 | 430 | void DMA_ClearITPendingBit(uint32_t DMAy_IT); |
mbed_official | 155:8435094ec241 | 431 | |
mbed_official | 155:8435094ec241 | 432 | #ifdef __cplusplus |
mbed_official | 155:8435094ec241 | 433 | } |
mbed_official | 155:8435094ec241 | 434 | #endif |
mbed_official | 155:8435094ec241 | 435 | |
mbed_official | 155:8435094ec241 | 436 | #endif /*__STM32F30x_DMA_H */ |
mbed_official | 155:8435094ec241 | 437 | |
mbed_official | 155:8435094ec241 | 438 | /** |
mbed_official | 155:8435094ec241 | 439 | * @} |
mbed_official | 155:8435094ec241 | 440 | */ |
mbed_official | 155:8435094ec241 | 441 | |
mbed_official | 155:8435094ec241 | 442 | /** |
mbed_official | 155:8435094ec241 | 443 | * @} |
mbed_official | 155:8435094ec241 | 444 | */ |
mbed_official | 155:8435094ec241 | 445 | |
mbed_official | 155:8435094ec241 | 446 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |