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