mbed library sources

Dependents:   frdm_kl05z_gpio_test

Fork of mbed-src by mbed official

Committer:
mbed_official
Date:
Wed Feb 26 09:45:12 2014 +0000
Revision:
106:ced8cbb51063
Parent:
76:aeb1df146756
Synchronized with git revision 4222735eff5868389433f0e9271976b39c8115cd

Full URL: https://github.com/mbedmicro/mbed/commit/4222735eff5868389433f0e9271976b39c8115cd/

[NUCLEO_xxx] Update STM32CubeF4 driver V1.0.0 + update license

Who changed what in which revision?

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