mbed library sources modified for open wear
Dependents: openwear-lifelogger-example
Fork of mbed-src by
targets/cmsis/TARGET_STM/TARGET_NUCLEO_F030R8/stm32f0xx_dma.h@76:aeb1df146756, 2014-01-27 (annotated)
- Committer:
- mbed_official
- Date:
- Mon Jan 27 14:30:07 2014 +0000
- Revision:
- 76:aeb1df146756
- Child:
- 106:ced8cbb51063
Synchronized with git revision a31ec9c5f7bcb5c8a1b2eced103f6a1dfa921abd
Full URL: https://github.com/mbedmicro/mbed/commit/a31ec9c5f7bcb5c8a1b2eced103f6a1dfa921abd/
Add NUCLEO_L152RE
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mbed_official | 76:aeb1df146756 | 1 | /** |
mbed_official | 76:aeb1df146756 | 2 | ****************************************************************************** |
mbed_official | 76:aeb1df146756 | 3 | * @file stm32f0xx_dma.h |
mbed_official | 76:aeb1df146756 | 4 | * @author MCD Application Team |
mbed_official | 76:aeb1df146756 | 5 | * @version V1.3.0 |
mbed_official | 76:aeb1df146756 | 6 | * @date 16-January-2014 |
mbed_official | 76:aeb1df146756 | 7 | * @brief This file contains all the functions prototypes for the DMA firmware |
mbed_official | 76:aeb1df146756 | 8 | * library. |
mbed_official | 76:aeb1df146756 | 9 | ****************************************************************************** |
mbed_official | 76:aeb1df146756 | 10 | * @attention |
mbed_official | 76:aeb1df146756 | 11 | * |
mbed_official | 76:aeb1df146756 | 12 | * <h2><center>© COPYRIGHT 2014 STMicroelectronics</center></h2> |
mbed_official | 76:aeb1df146756 | 13 | * |
mbed_official | 76:aeb1df146756 | 14 | * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); |
mbed_official | 76:aeb1df146756 | 15 | * You may not use this file except in compliance with the License. |
mbed_official | 76:aeb1df146756 | 16 | * You may obtain a copy of the License at: |
mbed_official | 76:aeb1df146756 | 17 | * |
mbed_official | 76:aeb1df146756 | 18 | * http://www.st.com/software_license_agreement_liberty_v2 |
mbed_official | 76:aeb1df146756 | 19 | * |
mbed_official | 76:aeb1df146756 | 20 | * Unless required by applicable law or agreed to in writing, software |
mbed_official | 76:aeb1df146756 | 21 | * distributed under the License is distributed on an "AS IS" BASIS, |
mbed_official | 76:aeb1df146756 | 22 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
mbed_official | 76:aeb1df146756 | 23 | * See the License for the specific language governing permissions and |
mbed_official | 76:aeb1df146756 | 24 | * limitations under the License. |
mbed_official | 76:aeb1df146756 | 25 | * |
mbed_official | 76:aeb1df146756 | 26 | ****************************************************************************** |
mbed_official | 76:aeb1df146756 | 27 | */ |
mbed_official | 76:aeb1df146756 | 28 | |
mbed_official | 76:aeb1df146756 | 29 | /* Define to prevent recursive inclusion -------------------------------------*/ |
mbed_official | 76:aeb1df146756 | 30 | #ifndef __STM32F0XX_DMA_H |
mbed_official | 76:aeb1df146756 | 31 | #define __STM32F0XX_DMA_H |
mbed_official | 76:aeb1df146756 | 32 | |
mbed_official | 76:aeb1df146756 | 33 | #ifdef __cplusplus |
mbed_official | 76:aeb1df146756 | 34 | extern "C" { |
mbed_official | 76:aeb1df146756 | 35 | #endif |
mbed_official | 76:aeb1df146756 | 36 | |
mbed_official | 76:aeb1df146756 | 37 | /* Includes ------------------------------------------------------------------*/ |
mbed_official | 76:aeb1df146756 | 38 | #include "stm32f0xx.h" |
mbed_official | 76:aeb1df146756 | 39 | |
mbed_official | 76:aeb1df146756 | 40 | /** @addtogroup STM32F0xx_StdPeriph_Driver |
mbed_official | 76:aeb1df146756 | 41 | * @{ |
mbed_official | 76:aeb1df146756 | 42 | */ |
mbed_official | 76:aeb1df146756 | 43 | |
mbed_official | 76:aeb1df146756 | 44 | /** @addtogroup DMA |
mbed_official | 76:aeb1df146756 | 45 | * @{ |
mbed_official | 76:aeb1df146756 | 46 | */ |
mbed_official | 76:aeb1df146756 | 47 | /* Exported types ------------------------------------------------------------*/ |
mbed_official | 76:aeb1df146756 | 48 | |
mbed_official | 76:aeb1df146756 | 49 | /** |
mbed_official | 76:aeb1df146756 | 50 | * @brief DMA Init structures definition |
mbed_official | 76:aeb1df146756 | 51 | */ |
mbed_official | 76:aeb1df146756 | 52 | typedef struct |
mbed_official | 76:aeb1df146756 | 53 | { |
mbed_official | 76:aeb1df146756 | 54 | uint32_t DMA_PeripheralBaseAddr; /*!< Specifies the peripheral base address for DMAy Channelx. */ |
mbed_official | 76:aeb1df146756 | 55 | |
mbed_official | 76:aeb1df146756 | 56 | uint32_t DMA_MemoryBaseAddr; /*!< Specifies the memory base address for DMAy Channelx. */ |
mbed_official | 76:aeb1df146756 | 57 | |
mbed_official | 76:aeb1df146756 | 58 | uint32_t DMA_DIR; /*!< Specifies if the peripheral is the source or destination. |
mbed_official | 76:aeb1df146756 | 59 | This parameter can be a value of @ref DMA_data_transfer_direction */ |
mbed_official | 76:aeb1df146756 | 60 | |
mbed_official | 76:aeb1df146756 | 61 | uint32_t DMA_BufferSize; /*!< Specifies the buffer size, in data unit, of the specified Channel. |
mbed_official | 76:aeb1df146756 | 62 | The data unit is equal to the configuration set in DMA_PeripheralDataSize |
mbed_official | 76:aeb1df146756 | 63 | or DMA_MemoryDataSize members depending in the transfer direction */ |
mbed_official | 76:aeb1df146756 | 64 | |
mbed_official | 76:aeb1df146756 | 65 | uint32_t DMA_PeripheralInc; /*!< Specifies whether the Peripheral address register is incremented or not. |
mbed_official | 76:aeb1df146756 | 66 | This parameter can be a value of @ref DMA_peripheral_incremented_mode */ |
mbed_official | 76:aeb1df146756 | 67 | |
mbed_official | 76:aeb1df146756 | 68 | uint32_t DMA_MemoryInc; /*!< Specifies whether the memory address register is incremented or not. |
mbed_official | 76:aeb1df146756 | 69 | This parameter can be a value of @ref DMA_memory_incremented_mode */ |
mbed_official | 76:aeb1df146756 | 70 | |
mbed_official | 76:aeb1df146756 | 71 | uint32_t DMA_PeripheralDataSize; /*!< Specifies the Peripheral data width. |
mbed_official | 76:aeb1df146756 | 72 | This parameter can be a value of @ref DMA_peripheral_data_size */ |
mbed_official | 76:aeb1df146756 | 73 | |
mbed_official | 76:aeb1df146756 | 74 | uint32_t DMA_MemoryDataSize; /*!< Specifies the Memory data width. |
mbed_official | 76:aeb1df146756 | 75 | This parameter can be a value of @ref DMA_memory_data_size */ |
mbed_official | 76:aeb1df146756 | 76 | |
mbed_official | 76:aeb1df146756 | 77 | uint32_t DMA_Mode; /*!< Specifies the operation mode of the DMAy Channelx. |
mbed_official | 76:aeb1df146756 | 78 | This parameter can be a value of @ref DMA_circular_normal_mode |
mbed_official | 76:aeb1df146756 | 79 | @note: The circular buffer mode cannot be used if the memory-to-memory |
mbed_official | 76:aeb1df146756 | 80 | data transfer is configured on the selected Channel */ |
mbed_official | 76:aeb1df146756 | 81 | |
mbed_official | 76:aeb1df146756 | 82 | uint32_t DMA_Priority; /*!< Specifies the software priority for the DMAy Channelx. |
mbed_official | 76:aeb1df146756 | 83 | This parameter can be a value of @ref DMA_priority_level */ |
mbed_official | 76:aeb1df146756 | 84 | |
mbed_official | 76:aeb1df146756 | 85 | uint32_t DMA_M2M; /*!< Specifies if the DMAy Channelx will be used in memory-to-memory transfer. |
mbed_official | 76:aeb1df146756 | 86 | This parameter can be a value of @ref DMA_memory_to_memory */ |
mbed_official | 76:aeb1df146756 | 87 | }DMA_InitTypeDef; |
mbed_official | 76:aeb1df146756 | 88 | |
mbed_official | 76:aeb1df146756 | 89 | /* Exported constants --------------------------------------------------------*/ |
mbed_official | 76:aeb1df146756 | 90 | |
mbed_official | 76:aeb1df146756 | 91 | /** @defgroup DMA_Exported_Constants |
mbed_official | 76:aeb1df146756 | 92 | * @{ |
mbed_official | 76:aeb1df146756 | 93 | */ |
mbed_official | 76:aeb1df146756 | 94 | |
mbed_official | 76:aeb1df146756 | 95 | #define IS_DMA_ALL_PERIPH(PERIPH) (((PERIPH) == DMA1_Channel1) || \ |
mbed_official | 76:aeb1df146756 | 96 | ((PERIPH) == DMA1_Channel2) || \ |
mbed_official | 76:aeb1df146756 | 97 | ((PERIPH) == DMA1_Channel3) || \ |
mbed_official | 76:aeb1df146756 | 98 | ((PERIPH) == DMA1_Channel4) || \ |
mbed_official | 76:aeb1df146756 | 99 | ((PERIPH) == DMA1_Channel5) || \ |
mbed_official | 76:aeb1df146756 | 100 | ((PERIPH) == DMA1_Channel6) || \ |
mbed_official | 76:aeb1df146756 | 101 | ((PERIPH) == DMA1_Channel7)) |
mbed_official | 76:aeb1df146756 | 102 | |
mbed_official | 76:aeb1df146756 | 103 | /** @defgroup DMA_data_transfer_direction |
mbed_official | 76:aeb1df146756 | 104 | * @{ |
mbed_official | 76:aeb1df146756 | 105 | */ |
mbed_official | 76:aeb1df146756 | 106 | |
mbed_official | 76:aeb1df146756 | 107 | #define DMA_DIR_PeripheralSRC ((uint32_t)0x00000000) |
mbed_official | 76:aeb1df146756 | 108 | #define DMA_DIR_PeripheralDST DMA_CCR_DIR |
mbed_official | 76:aeb1df146756 | 109 | |
mbed_official | 76:aeb1df146756 | 110 | #define IS_DMA_DIR(DIR) (((DIR) == DMA_DIR_PeripheralSRC) || \ |
mbed_official | 76:aeb1df146756 | 111 | ((DIR) == DMA_DIR_PeripheralDST)) |
mbed_official | 76:aeb1df146756 | 112 | /** |
mbed_official | 76:aeb1df146756 | 113 | * @} |
mbed_official | 76:aeb1df146756 | 114 | */ |
mbed_official | 76:aeb1df146756 | 115 | |
mbed_official | 76:aeb1df146756 | 116 | /** @defgroup DMA_peripheral_incremented_mode |
mbed_official | 76:aeb1df146756 | 117 | * @{ |
mbed_official | 76:aeb1df146756 | 118 | */ |
mbed_official | 76:aeb1df146756 | 119 | |
mbed_official | 76:aeb1df146756 | 120 | #define DMA_PeripheralInc_Disable ((uint32_t)0x00000000) |
mbed_official | 76:aeb1df146756 | 121 | #define DMA_PeripheralInc_Enable DMA_CCR_PINC |
mbed_official | 76:aeb1df146756 | 122 | |
mbed_official | 76:aeb1df146756 | 123 | #define IS_DMA_PERIPHERAL_INC_STATE(STATE) (((STATE) == DMA_PeripheralInc_Disable) || \ |
mbed_official | 76:aeb1df146756 | 124 | ((STATE) == DMA_PeripheralInc_Enable)) |
mbed_official | 76:aeb1df146756 | 125 | /** |
mbed_official | 76:aeb1df146756 | 126 | * @} |
mbed_official | 76:aeb1df146756 | 127 | */ |
mbed_official | 76:aeb1df146756 | 128 | |
mbed_official | 76:aeb1df146756 | 129 | /** @defgroup DMA_memory_incremented_mode |
mbed_official | 76:aeb1df146756 | 130 | * @{ |
mbed_official | 76:aeb1df146756 | 131 | */ |
mbed_official | 76:aeb1df146756 | 132 | |
mbed_official | 76:aeb1df146756 | 133 | #define DMA_MemoryInc_Disable ((uint32_t)0x00000000) |
mbed_official | 76:aeb1df146756 | 134 | #define DMA_MemoryInc_Enable DMA_CCR_MINC |
mbed_official | 76:aeb1df146756 | 135 | |
mbed_official | 76:aeb1df146756 | 136 | #define IS_DMA_MEMORY_INC_STATE(STATE) (((STATE) == DMA_MemoryInc_Disable) || \ |
mbed_official | 76:aeb1df146756 | 137 | ((STATE) == DMA_MemoryInc_Enable)) |
mbed_official | 76:aeb1df146756 | 138 | /** |
mbed_official | 76:aeb1df146756 | 139 | * @} |
mbed_official | 76:aeb1df146756 | 140 | */ |
mbed_official | 76:aeb1df146756 | 141 | |
mbed_official | 76:aeb1df146756 | 142 | /** @defgroup DMA_peripheral_data_size |
mbed_official | 76:aeb1df146756 | 143 | * @{ |
mbed_official | 76:aeb1df146756 | 144 | */ |
mbed_official | 76:aeb1df146756 | 145 | |
mbed_official | 76:aeb1df146756 | 146 | #define DMA_PeripheralDataSize_Byte ((uint32_t)0x00000000) |
mbed_official | 76:aeb1df146756 | 147 | #define DMA_PeripheralDataSize_HalfWord DMA_CCR_PSIZE_0 |
mbed_official | 76:aeb1df146756 | 148 | #define DMA_PeripheralDataSize_Word DMA_CCR_PSIZE_1 |
mbed_official | 76:aeb1df146756 | 149 | |
mbed_official | 76:aeb1df146756 | 150 | #define IS_DMA_PERIPHERAL_DATA_SIZE(SIZE) (((SIZE) == DMA_PeripheralDataSize_Byte) || \ |
mbed_official | 76:aeb1df146756 | 151 | ((SIZE) == DMA_PeripheralDataSize_HalfWord) || \ |
mbed_official | 76:aeb1df146756 | 152 | ((SIZE) == DMA_PeripheralDataSize_Word)) |
mbed_official | 76:aeb1df146756 | 153 | /** |
mbed_official | 76:aeb1df146756 | 154 | * @} |
mbed_official | 76:aeb1df146756 | 155 | */ |
mbed_official | 76:aeb1df146756 | 156 | |
mbed_official | 76:aeb1df146756 | 157 | /** @defgroup DMA_memory_data_size |
mbed_official | 76:aeb1df146756 | 158 | * @{ |
mbed_official | 76:aeb1df146756 | 159 | */ |
mbed_official | 76:aeb1df146756 | 160 | |
mbed_official | 76:aeb1df146756 | 161 | #define DMA_MemoryDataSize_Byte ((uint32_t)0x00000000) |
mbed_official | 76:aeb1df146756 | 162 | #define DMA_MemoryDataSize_HalfWord DMA_CCR_MSIZE_0 |
mbed_official | 76:aeb1df146756 | 163 | #define DMA_MemoryDataSize_Word DMA_CCR_MSIZE_1 |
mbed_official | 76:aeb1df146756 | 164 | |
mbed_official | 76:aeb1df146756 | 165 | #define IS_DMA_MEMORY_DATA_SIZE(SIZE) (((SIZE) == DMA_MemoryDataSize_Byte) || \ |
mbed_official | 76:aeb1df146756 | 166 | ((SIZE) == DMA_MemoryDataSize_HalfWord) || \ |
mbed_official | 76:aeb1df146756 | 167 | ((SIZE) == DMA_MemoryDataSize_Word)) |
mbed_official | 76:aeb1df146756 | 168 | /** |
mbed_official | 76:aeb1df146756 | 169 | * @} |
mbed_official | 76:aeb1df146756 | 170 | */ |
mbed_official | 76:aeb1df146756 | 171 | |
mbed_official | 76:aeb1df146756 | 172 | /** @defgroup DMA_circular_normal_mode |
mbed_official | 76:aeb1df146756 | 173 | * @{ |
mbed_official | 76:aeb1df146756 | 174 | */ |
mbed_official | 76:aeb1df146756 | 175 | |
mbed_official | 76:aeb1df146756 | 176 | #define DMA_Mode_Normal ((uint32_t)0x00000000) |
mbed_official | 76:aeb1df146756 | 177 | #define DMA_Mode_Circular DMA_CCR_CIRC |
mbed_official | 76:aeb1df146756 | 178 | |
mbed_official | 76:aeb1df146756 | 179 | #define IS_DMA_MODE(MODE) (((MODE) == DMA_Mode_Normal) || ((MODE) == DMA_Mode_Circular)) |
mbed_official | 76:aeb1df146756 | 180 | /** |
mbed_official | 76:aeb1df146756 | 181 | * @} |
mbed_official | 76:aeb1df146756 | 182 | */ |
mbed_official | 76:aeb1df146756 | 183 | |
mbed_official | 76:aeb1df146756 | 184 | /** @defgroup DMA_priority_level |
mbed_official | 76:aeb1df146756 | 185 | * @{ |
mbed_official | 76:aeb1df146756 | 186 | */ |
mbed_official | 76:aeb1df146756 | 187 | |
mbed_official | 76:aeb1df146756 | 188 | #define DMA_Priority_VeryHigh DMA_CCR_PL |
mbed_official | 76:aeb1df146756 | 189 | #define DMA_Priority_High DMA_CCR_PL_1 |
mbed_official | 76:aeb1df146756 | 190 | #define DMA_Priority_Medium DMA_CCR_PL_0 |
mbed_official | 76:aeb1df146756 | 191 | #define DMA_Priority_Low ((uint32_t)0x00000000) |
mbed_official | 76:aeb1df146756 | 192 | |
mbed_official | 76:aeb1df146756 | 193 | #define IS_DMA_PRIORITY(PRIORITY) (((PRIORITY) == DMA_Priority_VeryHigh) || \ |
mbed_official | 76:aeb1df146756 | 194 | ((PRIORITY) == DMA_Priority_High) || \ |
mbed_official | 76:aeb1df146756 | 195 | ((PRIORITY) == DMA_Priority_Medium) || \ |
mbed_official | 76:aeb1df146756 | 196 | ((PRIORITY) == DMA_Priority_Low)) |
mbed_official | 76:aeb1df146756 | 197 | /** |
mbed_official | 76:aeb1df146756 | 198 | * @} |
mbed_official | 76:aeb1df146756 | 199 | */ |
mbed_official | 76:aeb1df146756 | 200 | |
mbed_official | 76:aeb1df146756 | 201 | /** @defgroup DMA_memory_to_memory |
mbed_official | 76:aeb1df146756 | 202 | * @{ |
mbed_official | 76:aeb1df146756 | 203 | */ |
mbed_official | 76:aeb1df146756 | 204 | |
mbed_official | 76:aeb1df146756 | 205 | #define DMA_M2M_Disable ((uint32_t)0x00000000) |
mbed_official | 76:aeb1df146756 | 206 | #define DMA_M2M_Enable DMA_CCR_MEM2MEM |
mbed_official | 76:aeb1df146756 | 207 | |
mbed_official | 76:aeb1df146756 | 208 | #define IS_DMA_M2M_STATE(STATE) (((STATE) == DMA_M2M_Disable) || ((STATE) == DMA_M2M_Enable)) |
mbed_official | 76:aeb1df146756 | 209 | |
mbed_official | 76:aeb1df146756 | 210 | /** |
mbed_official | 76:aeb1df146756 | 211 | * @} |
mbed_official | 76:aeb1df146756 | 212 | */ |
mbed_official | 76:aeb1df146756 | 213 | |
mbed_official | 76:aeb1df146756 | 214 | /** @defgroup DMA_interrupts_definition |
mbed_official | 76:aeb1df146756 | 215 | * @{ |
mbed_official | 76:aeb1df146756 | 216 | */ |
mbed_official | 76:aeb1df146756 | 217 | |
mbed_official | 76:aeb1df146756 | 218 | #define DMA_IT_TC DMA_CCR_TCIE |
mbed_official | 76:aeb1df146756 | 219 | #define DMA_IT_HT DMA_CCR_HTIE |
mbed_official | 76:aeb1df146756 | 220 | #define DMA_IT_TE DMA_CCR_TEIE |
mbed_official | 76:aeb1df146756 | 221 | |
mbed_official | 76:aeb1df146756 | 222 | #define IS_DMA_CONFIG_IT(IT) ((((IT) & 0xFFFFFFF1) == 0x00) && ((IT) != 0x00)) |
mbed_official | 76:aeb1df146756 | 223 | |
mbed_official | 76:aeb1df146756 | 224 | #define DMA1_IT_GL1 DMA_ISR_GIF1 |
mbed_official | 76:aeb1df146756 | 225 | #define DMA1_IT_TC1 DMA_ISR_TCIF1 |
mbed_official | 76:aeb1df146756 | 226 | #define DMA1_IT_HT1 DMA_ISR_HTIF1 |
mbed_official | 76:aeb1df146756 | 227 | #define DMA1_IT_TE1 DMA_ISR_TEIF1 |
mbed_official | 76:aeb1df146756 | 228 | #define DMA1_IT_GL2 DMA_ISR_GIF2 |
mbed_official | 76:aeb1df146756 | 229 | #define DMA1_IT_TC2 DMA_ISR_TCIF2 |
mbed_official | 76:aeb1df146756 | 230 | #define DMA1_IT_HT2 DMA_ISR_HTIF2 |
mbed_official | 76:aeb1df146756 | 231 | #define DMA1_IT_TE2 DMA_ISR_TEIF2 |
mbed_official | 76:aeb1df146756 | 232 | #define DMA1_IT_GL3 DMA_ISR_GIF3 |
mbed_official | 76:aeb1df146756 | 233 | #define DMA1_IT_TC3 DMA_ISR_TCIF3 |
mbed_official | 76:aeb1df146756 | 234 | #define DMA1_IT_HT3 DMA_ISR_HTIF3 |
mbed_official | 76:aeb1df146756 | 235 | #define DMA1_IT_TE3 DMA_ISR_TEIF3 |
mbed_official | 76:aeb1df146756 | 236 | #define DMA1_IT_GL4 DMA_ISR_GIF4 |
mbed_official | 76:aeb1df146756 | 237 | #define DMA1_IT_TC4 DMA_ISR_TCIF4 |
mbed_official | 76:aeb1df146756 | 238 | #define DMA1_IT_HT4 DMA_ISR_HTIF4 |
mbed_official | 76:aeb1df146756 | 239 | #define DMA1_IT_TE4 DMA_ISR_TEIF4 |
mbed_official | 76:aeb1df146756 | 240 | #define DMA1_IT_GL5 DMA_ISR_GIF5 |
mbed_official | 76:aeb1df146756 | 241 | #define DMA1_IT_TC5 DMA_ISR_TCIF5 |
mbed_official | 76:aeb1df146756 | 242 | #define DMA1_IT_HT5 DMA_ISR_HTIF5 |
mbed_official | 76:aeb1df146756 | 243 | #define DMA1_IT_TE5 DMA_ISR_TEIF5 |
mbed_official | 76:aeb1df146756 | 244 | #define DMA1_IT_GL6 DMA_ISR_GIF6 /*!< Only applicable for STM32F072 devices */ |
mbed_official | 76:aeb1df146756 | 245 | #define DMA1_IT_TC6 DMA_ISR_TCIF6 /*!< Only applicable for STM32F072 devices */ |
mbed_official | 76:aeb1df146756 | 246 | #define DMA1_IT_HT6 DMA_ISR_HTIF6 /*!< Only applicable for STM32F072 devices */ |
mbed_official | 76:aeb1df146756 | 247 | #define DMA1_IT_TE6 DMA_ISR_TEIF6 /*!< Only applicable for STM32F072 devices */ |
mbed_official | 76:aeb1df146756 | 248 | #define DMA1_IT_GL7 DMA_ISR_GIF7 /*!< Only applicable for STM32F072 devices */ |
mbed_official | 76:aeb1df146756 | 249 | #define DMA1_IT_TC7 DMA_ISR_TCIF7 /*!< Only applicable for STM32F072 devices */ |
mbed_official | 76:aeb1df146756 | 250 | #define DMA1_IT_HT7 DMA_ISR_HTIF7 /*!< Only applicable for STM32F072 devices */ |
mbed_official | 76:aeb1df146756 | 251 | #define DMA1_IT_TE7 DMA_ISR_TEIF7 /*!< Only applicable for STM32F072 devices */ |
mbed_official | 76:aeb1df146756 | 252 | |
mbed_official | 76:aeb1df146756 | 253 | #define IS_DMA_CLEAR_IT(IT) ((((IT) & 0xF0000000) == 0x00) && ((IT) != 0x00)) |
mbed_official | 76:aeb1df146756 | 254 | |
mbed_official | 76:aeb1df146756 | 255 | #define IS_DMA_GET_IT(IT) (((IT) == DMA1_IT_GL1) || ((IT) == DMA1_IT_TC1) || \ |
mbed_official | 76:aeb1df146756 | 256 | ((IT) == DMA1_IT_HT1) || ((IT) == DMA1_IT_TE1) || \ |
mbed_official | 76:aeb1df146756 | 257 | ((IT) == DMA1_IT_GL2) || ((IT) == DMA1_IT_TC2) || \ |
mbed_official | 76:aeb1df146756 | 258 | ((IT) == DMA1_IT_HT2) || ((IT) == DMA1_IT_TE2) || \ |
mbed_official | 76:aeb1df146756 | 259 | ((IT) == DMA1_IT_GL3) || ((IT) == DMA1_IT_TC3) || \ |
mbed_official | 76:aeb1df146756 | 260 | ((IT) == DMA1_IT_HT3) || ((IT) == DMA1_IT_TE3) || \ |
mbed_official | 76:aeb1df146756 | 261 | ((IT) == DMA1_IT_GL4) || ((IT) == DMA1_IT_TC4) || \ |
mbed_official | 76:aeb1df146756 | 262 | ((IT) == DMA1_IT_HT4) || ((IT) == DMA1_IT_TE4) || \ |
mbed_official | 76:aeb1df146756 | 263 | ((IT) == DMA1_IT_GL5) || ((IT) == DMA1_IT_TC5) || \ |
mbed_official | 76:aeb1df146756 | 264 | ((IT) == DMA1_IT_HT5) || ((IT) == DMA1_IT_TE5) || \ |
mbed_official | 76:aeb1df146756 | 265 | ((IT) == DMA1_IT_GL6) || ((IT) == DMA1_IT_TC6) || \ |
mbed_official | 76:aeb1df146756 | 266 | ((IT) == DMA1_IT_HT6) || ((IT) == DMA1_IT_TE6) || \ |
mbed_official | 76:aeb1df146756 | 267 | ((IT) == DMA1_IT_GL7) || ((IT) == DMA1_IT_TC7) || \ |
mbed_official | 76:aeb1df146756 | 268 | ((IT) == DMA1_IT_HT7) || ((IT) == DMA1_IT_TE7)) |
mbed_official | 76:aeb1df146756 | 269 | |
mbed_official | 76:aeb1df146756 | 270 | /** |
mbed_official | 76:aeb1df146756 | 271 | * @} |
mbed_official | 76:aeb1df146756 | 272 | */ |
mbed_official | 76:aeb1df146756 | 273 | |
mbed_official | 76:aeb1df146756 | 274 | /** @defgroup DMA_flags_definition |
mbed_official | 76:aeb1df146756 | 275 | * @{ |
mbed_official | 76:aeb1df146756 | 276 | */ |
mbed_official | 76:aeb1df146756 | 277 | #define DMA1_FLAG_GL1 DMA_ISR_GIF1 |
mbed_official | 76:aeb1df146756 | 278 | #define DMA1_FLAG_TC1 DMA_ISR_TCIF1 |
mbed_official | 76:aeb1df146756 | 279 | #define DMA1_FLAG_HT1 DMA_ISR_HTIF1 |
mbed_official | 76:aeb1df146756 | 280 | #define DMA1_FLAG_TE1 DMA_ISR_TEIF1 |
mbed_official | 76:aeb1df146756 | 281 | #define DMA1_FLAG_GL2 DMA_ISR_GIF2 |
mbed_official | 76:aeb1df146756 | 282 | #define DMA1_FLAG_TC2 DMA_ISR_TCIF2 |
mbed_official | 76:aeb1df146756 | 283 | #define DMA1_FLAG_HT2 DMA_ISR_HTIF2 |
mbed_official | 76:aeb1df146756 | 284 | #define DMA1_FLAG_TE2 DMA_ISR_TEIF2 |
mbed_official | 76:aeb1df146756 | 285 | #define DMA1_FLAG_GL3 DMA_ISR_GIF3 |
mbed_official | 76:aeb1df146756 | 286 | #define DMA1_FLAG_TC3 DMA_ISR_TCIF3 |
mbed_official | 76:aeb1df146756 | 287 | #define DMA1_FLAG_HT3 DMA_ISR_HTIF3 |
mbed_official | 76:aeb1df146756 | 288 | #define DMA1_FLAG_TE3 DMA_ISR_TEIF3 |
mbed_official | 76:aeb1df146756 | 289 | #define DMA1_FLAG_GL4 DMA_ISR_GIF4 |
mbed_official | 76:aeb1df146756 | 290 | #define DMA1_FLAG_TC4 DMA_ISR_TCIF4 |
mbed_official | 76:aeb1df146756 | 291 | #define DMA1_FLAG_HT4 DMA_ISR_HTIF4 |
mbed_official | 76:aeb1df146756 | 292 | #define DMA1_FLAG_TE4 DMA_ISR_TEIF4 |
mbed_official | 76:aeb1df146756 | 293 | #define DMA1_FLAG_GL5 DMA_ISR_GIF5 |
mbed_official | 76:aeb1df146756 | 294 | #define DMA1_FLAG_TC5 DMA_ISR_TCIF5 |
mbed_official | 76:aeb1df146756 | 295 | #define DMA1_FLAG_HT5 DMA_ISR_HTIF5 |
mbed_official | 76:aeb1df146756 | 296 | #define DMA1_FLAG_TE5 DMA_ISR_TEIF5 |
mbed_official | 76:aeb1df146756 | 297 | #define DMA1_FLAG_GL6 DMA_ISR_GIF6 /*!< Only applicable for STM32F072 devices */ |
mbed_official | 76:aeb1df146756 | 298 | #define DMA1_FLAG_TC6 DMA_ISR_TCIF6 /*!< Only applicable for STM32F072 devices */ |
mbed_official | 76:aeb1df146756 | 299 | #define DMA1_FLAG_HT6 DMA_ISR_HTIF6 /*!< Only applicable for STM32F072 devices */ |
mbed_official | 76:aeb1df146756 | 300 | #define DMA1_FLAG_TE6 DMA_ISR_TEIF6 /*!< Only applicable for STM32F072 devices */ |
mbed_official | 76:aeb1df146756 | 301 | #define DMA1_FLAG_GL7 DMA_ISR_GIF7 /*!< Only applicable for STM32F072 devices */ |
mbed_official | 76:aeb1df146756 | 302 | #define DMA1_FLAG_TC7 DMA_ISR_TCIF7 /*!< Only applicable for STM32F072 devices */ |
mbed_official | 76:aeb1df146756 | 303 | #define DMA1_FLAG_HT7 DMA_ISR_HTIF7 /*!< Only applicable for STM32F072 devices */ |
mbed_official | 76:aeb1df146756 | 304 | #define DMA1_FLAG_TE7 DMA_ISR_TEIF7 /*!< Only applicable for STM32F072 devices */ |
mbed_official | 76:aeb1df146756 | 305 | |
mbed_official | 76:aeb1df146756 | 306 | #define IS_DMA_CLEAR_FLAG(FLAG) ((((FLAG) & 0xF0000000) == 0x00) && ((FLAG) != 0x00)) |
mbed_official | 76:aeb1df146756 | 307 | |
mbed_official | 76:aeb1df146756 | 308 | #define IS_DMA_GET_FLAG(FLAG) (((FLAG) == DMA1_FLAG_GL1) || ((FLAG) == DMA1_FLAG_TC1) || \ |
mbed_official | 76:aeb1df146756 | 309 | ((FLAG) == DMA1_FLAG_HT1) || ((FLAG) == DMA1_FLAG_TE1) || \ |
mbed_official | 76:aeb1df146756 | 310 | ((FLAG) == DMA1_FLAG_GL2) || ((FLAG) == DMA1_FLAG_TC2) || \ |
mbed_official | 76:aeb1df146756 | 311 | ((FLAG) == DMA1_FLAG_HT2) || ((FLAG) == DMA1_FLAG_TE2) || \ |
mbed_official | 76:aeb1df146756 | 312 | ((FLAG) == DMA1_FLAG_GL3) || ((FLAG) == DMA1_FLAG_TC3) || \ |
mbed_official | 76:aeb1df146756 | 313 | ((FLAG) == DMA1_FLAG_HT3) || ((FLAG) == DMA1_FLAG_TE3) || \ |
mbed_official | 76:aeb1df146756 | 314 | ((FLAG) == DMA1_FLAG_GL4) || ((FLAG) == DMA1_FLAG_TC4) || \ |
mbed_official | 76:aeb1df146756 | 315 | ((FLAG) == DMA1_FLAG_HT4) || ((FLAG) == DMA1_FLAG_TE4) || \ |
mbed_official | 76:aeb1df146756 | 316 | ((FLAG) == DMA1_FLAG_GL5) || ((FLAG) == DMA1_FLAG_TC5) || \ |
mbed_official | 76:aeb1df146756 | 317 | ((FLAG) == DMA1_FLAG_HT5) || ((FLAG) == DMA1_FLAG_TE5) || \ |
mbed_official | 76:aeb1df146756 | 318 | ((FLAG) == DMA1_FLAG_GL6) || ((FLAG) == DMA1_FLAG_TC6) || \ |
mbed_official | 76:aeb1df146756 | 319 | ((FLAG) == DMA1_FLAG_HT6) || ((FLAG) == DMA1_FLAG_TE6) || \ |
mbed_official | 76:aeb1df146756 | 320 | ((FLAG) == DMA1_FLAG_GL7) || ((FLAG) == DMA1_FLAG_TC7) || \ |
mbed_official | 76:aeb1df146756 | 321 | ((FLAG) == DMA1_FLAG_HT7) || ((FLAG) == DMA1_FLAG_TE7)) |
mbed_official | 76:aeb1df146756 | 322 | |
mbed_official | 76:aeb1df146756 | 323 | /** |
mbed_official | 76:aeb1df146756 | 324 | * @} |
mbed_official | 76:aeb1df146756 | 325 | */ |
mbed_official | 76:aeb1df146756 | 326 | |
mbed_official | 76:aeb1df146756 | 327 | /** @defgroup DMA_Buffer_Size |
mbed_official | 76:aeb1df146756 | 328 | * @{ |
mbed_official | 76:aeb1df146756 | 329 | */ |
mbed_official | 76:aeb1df146756 | 330 | |
mbed_official | 76:aeb1df146756 | 331 | #define IS_DMA_BUFFER_SIZE(SIZE) (((SIZE) >= 0x1) && ((SIZE) < 0x10000)) |
mbed_official | 76:aeb1df146756 | 332 | |
mbed_official | 76:aeb1df146756 | 333 | /** |
mbed_official | 76:aeb1df146756 | 334 | * @} |
mbed_official | 76:aeb1df146756 | 335 | */ |
mbed_official | 76:aeb1df146756 | 336 | |
mbed_official | 76:aeb1df146756 | 337 | /** |
mbed_official | 76:aeb1df146756 | 338 | * @} |
mbed_official | 76:aeb1df146756 | 339 | */ |
mbed_official | 76:aeb1df146756 | 340 | |
mbed_official | 76:aeb1df146756 | 341 | /* Exported macro ------------------------------------------------------------*/ |
mbed_official | 76:aeb1df146756 | 342 | /* Exported functions ------------------------------------------------------- */ |
mbed_official | 76:aeb1df146756 | 343 | |
mbed_official | 76:aeb1df146756 | 344 | /* Function used to set the DMA configuration to the default reset state ******/ |
mbed_official | 76:aeb1df146756 | 345 | void DMA_DeInit(DMA_Channel_TypeDef* DMAy_Channelx); |
mbed_official | 76:aeb1df146756 | 346 | |
mbed_official | 76:aeb1df146756 | 347 | /* Initialization and Configuration functions *********************************/ |
mbed_official | 76:aeb1df146756 | 348 | void DMA_Init(DMA_Channel_TypeDef* DMAy_Channelx, DMA_InitTypeDef* DMA_InitStruct); |
mbed_official | 76:aeb1df146756 | 349 | void DMA_StructInit(DMA_InitTypeDef* DMA_InitStruct); |
mbed_official | 76:aeb1df146756 | 350 | void DMA_Cmd(DMA_Channel_TypeDef* DMAy_Channelx, FunctionalState NewState); |
mbed_official | 76:aeb1df146756 | 351 | |
mbed_official | 76:aeb1df146756 | 352 | /* Data Counter functions******************************************************/ |
mbed_official | 76:aeb1df146756 | 353 | void DMA_SetCurrDataCounter(DMA_Channel_TypeDef* DMAy_Channelx, uint16_t DataNumber); |
mbed_official | 76:aeb1df146756 | 354 | uint16_t DMA_GetCurrDataCounter(DMA_Channel_TypeDef* DMAy_Channelx); |
mbed_official | 76:aeb1df146756 | 355 | |
mbed_official | 76:aeb1df146756 | 356 | /* Interrupts and flags management functions **********************************/ |
mbed_official | 76:aeb1df146756 | 357 | void DMA_ITConfig(DMA_Channel_TypeDef* DMAy_Channelx, uint32_t DMA_IT, FunctionalState NewState); |
mbed_official | 76:aeb1df146756 | 358 | FlagStatus DMA_GetFlagStatus(uint32_t DMA_FLAG); |
mbed_official | 76:aeb1df146756 | 359 | void DMA_ClearFlag(uint32_t DMA_FLAG); |
mbed_official | 76:aeb1df146756 | 360 | ITStatus DMA_GetITStatus(uint32_t DMA_IT); |
mbed_official | 76:aeb1df146756 | 361 | void DMA_ClearITPendingBit(uint32_t DMA_IT); |
mbed_official | 76:aeb1df146756 | 362 | |
mbed_official | 76:aeb1df146756 | 363 | #ifdef __cplusplus |
mbed_official | 76:aeb1df146756 | 364 | } |
mbed_official | 76:aeb1df146756 | 365 | #endif |
mbed_official | 76:aeb1df146756 | 366 | |
mbed_official | 76:aeb1df146756 | 367 | #endif /*__STM32F0XX_DMA_H */ |
mbed_official | 76:aeb1df146756 | 368 | |
mbed_official | 76:aeb1df146756 | 369 | /** |
mbed_official | 76:aeb1df146756 | 370 | * @} |
mbed_official | 76:aeb1df146756 | 371 | */ |
mbed_official | 76:aeb1df146756 | 372 | |
mbed_official | 76:aeb1df146756 | 373 | /** |
mbed_official | 76:aeb1df146756 | 374 | * @} |
mbed_official | 76:aeb1df146756 | 375 | */ |
mbed_official | 76:aeb1df146756 | 376 | |
mbed_official | 76:aeb1df146756 | 377 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |