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