annotate f103c8/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_dma_ex.h @ 2:0c59e7a7782a

Working on GPIO and RCC
author cin
date Mon, 16 Jan 2017 11:04:47 +0300
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
1 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
2 ******************************************************************************
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
3 * @file stm32f1xx_hal_dma_ex.h
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
4 * @author MCD Application Team
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
5 * @version V1.0.4
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
6 * @date 29-April-2016
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
7 * @brief Header file of DMA HAL extension module.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
8 ******************************************************************************
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
9 * @attention
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
10 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
11 * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
12 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
13 * Redistribution and use in source and binary forms, with or without modification,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
14 * are permitted provided that the following conditions are met:
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
15 * 1. Redistributions of source code must retain the above copyright notice,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
16 * this list of conditions and the following disclaimer.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
17 * 2. Redistributions in binary form must reproduce the above copyright notice,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
18 * this list of conditions and the following disclaimer in the documentation
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
19 * and/or other materials provided with the distribution.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
21 * may be used to endorse or promote products derived from this software
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
22 * without specific prior written permission.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
23 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
34 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
35 ******************************************************************************
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
36 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
37
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
38 /* Define to prevent recursive inclusion -------------------------------------*/
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
39 #ifndef __STM32F1xx_HAL_DMA_EX_H
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
40 #define __STM32F1xx_HAL_DMA_EX_H
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
41
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
42 #ifdef __cplusplus
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
43 extern "C" {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
44 #endif
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
45
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
46 /* Includes ------------------------------------------------------------------*/
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
47 #include "stm32f1xx_hal_def.h"
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
48
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
49 /** @addtogroup STM32F1xx_HAL_Driver
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
50 * @{
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
51 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
52
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
53 /** @defgroup DMAEx DMAEx
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
54 * @{
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
55 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
56
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
57 /* Exported types ------------------------------------------------------------*/
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
58 /* Exported constants --------------------------------------------------------*/
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
59 /* Exported macro ------------------------------------------------------------*/
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
60 /** @defgroup DMAEx_Exported_Macros DMA Extended Exported Macros
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
61 * @{
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
62 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
63 /* Interrupt & Flag management */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
64 #if defined (STM32F100xE) || defined (STM32F101xE) || defined (STM32F101xG) || defined (STM32F103xE) || \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
65 defined (STM32F103xG) || defined (STM32F105xC) || defined (STM32F107xC)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
66 /** @defgroup DMAEx_High_density_XL_density_Product_devices DMAEx High density and XL density product devices
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
67 * @{
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
68 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
69
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
70 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
71 * @brief Returns the current DMA Channel transfer complete flag.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
72 * @param __HANDLE__: DMA handle
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
73 * @retval The specified transfer complete flag index.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
74 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
75 #define __HAL_DMA_GET_TC_FLAG_INDEX(__HANDLE__) \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
76 (((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel1))? DMA_FLAG_TC1 :\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
77 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel2))? DMA_FLAG_TC2 :\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
78 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel3))? DMA_FLAG_TC3 :\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
79 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel4))? DMA_FLAG_TC4 :\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
80 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel5))? DMA_FLAG_TC5 :\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
81 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel6))? DMA_FLAG_TC6 :\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
82 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel7))? DMA_FLAG_TC7 :\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
83 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Channel1))? DMA_FLAG_TC1 :\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
84 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Channel2))? DMA_FLAG_TC2 :\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
85 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Channel3))? DMA_FLAG_TC3 :\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
86 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Channel4))? DMA_FLAG_TC4 :\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
87 DMA_FLAG_TC5)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
88
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
89 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
90 * @brief Returns the current DMA Channel half transfer complete flag.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
91 * @param __HANDLE__: DMA handle
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
92 * @retval The specified half transfer complete flag index.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
93 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
94 #define __HAL_DMA_GET_HT_FLAG_INDEX(__HANDLE__)\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
95 (((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel1))? DMA_FLAG_HT1 :\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
96 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel2))? DMA_FLAG_HT2 :\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
97 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel3))? DMA_FLAG_HT3 :\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
98 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel4))? DMA_FLAG_HT4 :\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
99 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel5))? DMA_FLAG_HT5 :\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
100 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel6))? DMA_FLAG_HT6 :\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
101 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel7))? DMA_FLAG_HT7 :\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
102 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Channel1))? DMA_FLAG_HT1 :\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
103 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Channel2))? DMA_FLAG_HT2 :\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
104 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Channel3))? DMA_FLAG_HT3 :\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
105 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Channel4))? DMA_FLAG_HT4 :\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
106 DMA_FLAG_HT5)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
107
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
108 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
109 * @brief Returns the current DMA Channel transfer error flag.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
110 * @param __HANDLE__: DMA handle
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
111 * @retval The specified transfer error flag index.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
112 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
113 #define __HAL_DMA_GET_TE_FLAG_INDEX(__HANDLE__)\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
114 (((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel1))? DMA_FLAG_TE1 :\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
115 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel2))? DMA_FLAG_TE2 :\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
116 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel3))? DMA_FLAG_TE3 :\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
117 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel4))? DMA_FLAG_TE4 :\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
118 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel5))? DMA_FLAG_TE5 :\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
119 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel6))? DMA_FLAG_TE6 :\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
120 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel7))? DMA_FLAG_TE7 :\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
121 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Channel1))? DMA_FLAG_TE1 :\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
122 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Channel2))? DMA_FLAG_TE2 :\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
123 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Channel3))? DMA_FLAG_TE3 :\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
124 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Channel4))? DMA_FLAG_TE4 :\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
125 DMA_FLAG_TE5)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
126
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
127 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
128 * @brief Get the DMA Channel pending flags.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
129 * @param __HANDLE__: DMA handle
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
130 * @param __FLAG__: Get the specified flag.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
131 * This parameter can be any combination of the following values:
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
132 * @arg DMA_FLAG_TCx: Transfer complete flag
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
133 * @arg DMA_FLAG_HTx: Half transfer complete flag
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
134 * @arg DMA_FLAG_TEx: Transfer error flag
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
135 * Where x can be 1_7 or 1_5 (depending on DMA1 or DMA2) to select the DMA Channel flag.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
136 * @retval The state of FLAG (SET or RESET).
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
137 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
138 #define __HAL_DMA_GET_FLAG(__HANDLE__, __FLAG__)\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
139 (((uint32_t)((__HANDLE__)->Instance) > (uint32_t)DMA1_Channel7)? (DMA2->ISR & (__FLAG__)) :\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
140 (DMA1->ISR & (__FLAG__)))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
141
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
142 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
143 * @brief Clears the DMA Channel pending flags.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
144 * @param __HANDLE__: DMA handle
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
145 * @param __FLAG__: specifies the flag to clear.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
146 * This parameter can be any combination of the following values:
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
147 * @arg DMA_FLAG_TCx: Transfer complete flag
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
148 * @arg DMA_FLAG_HTx: Half transfer complete flag
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
149 * @arg DMA_FLAG_TEx: Transfer error flag
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
150 * Where x can be 1_7 or 1_5 (depending on DMA1 or DMA2) to select the DMA Channel flag.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
151 * @retval None
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
152 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
153 #define __HAL_DMA_CLEAR_FLAG(__HANDLE__, __FLAG__) \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
154 (((uint32_t)((__HANDLE__)->Instance) > (uint32_t)DMA1_Channel7)? (DMA2->IFCR = (__FLAG__)) :\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
155 (DMA1->IFCR = (__FLAG__)))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
156
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
157 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
158 * @}
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
159 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
160
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
161 #else
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
162 /** @defgroup DMA_Low_density_Medium_density_Product_devices DMA Low density and Medium density product devices
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
163 * @{
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
164 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
165
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
166 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
167 * @brief Returns the current DMA Channel transfer complete flag.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
168 * @param __HANDLE__: DMA handle
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
169 * @retval The specified transfer complete flag index.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
170 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
171 #define __HAL_DMA_GET_TC_FLAG_INDEX(__HANDLE__) \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
172 (((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel1))? DMA_FLAG_TC1 :\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
173 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel2))? DMA_FLAG_TC2 :\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
174 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel3))? DMA_FLAG_TC3 :\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
175 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel4))? DMA_FLAG_TC4 :\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
176 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel5))? DMA_FLAG_TC5 :\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
177 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel6))? DMA_FLAG_TC6 :\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
178 DMA_FLAG_TC7)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
179
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
180 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
181 * @brief Returns the current DMA Channel half transfer complete flag.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
182 * @param __HANDLE__: DMA handle
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
183 * @retval The specified half transfer complete flag index.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
184 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
185 #define __HAL_DMA_GET_HT_FLAG_INDEX(__HANDLE__)\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
186 (((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel1))? DMA_FLAG_HT1 :\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
187 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel2))? DMA_FLAG_HT2 :\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
188 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel3))? DMA_FLAG_HT3 :\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
189 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel4))? DMA_FLAG_HT4 :\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
190 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel5))? DMA_FLAG_HT5 :\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
191 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel6))? DMA_FLAG_HT6 :\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
192 DMA_FLAG_HT7)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
193
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
194 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
195 * @brief Returns the current DMA Channel transfer error flag.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
196 * @param __HANDLE__: DMA handle
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
197 * @retval The specified transfer error flag index.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
198 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
199 #define __HAL_DMA_GET_TE_FLAG_INDEX(__HANDLE__)\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
200 (((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel1))? DMA_FLAG_TE1 :\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
201 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel2))? DMA_FLAG_TE2 :\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
202 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel3))? DMA_FLAG_TE3 :\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
203 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel4))? DMA_FLAG_TE4 :\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
204 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel5))? DMA_FLAG_TE5 :\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
205 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel6))? DMA_FLAG_TE6 :\
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
206 DMA_FLAG_TE7)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
207
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
208 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
209 * @brief Get the DMA Channel pending flags.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
210 * @param __HANDLE__: DMA handle
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
211 * @param __FLAG__: Get the specified flag.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
212 * This parameter can be any combination of the following values:
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
213 * @arg DMA_FLAG_TCx: Transfer complete flag
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
214 * @arg DMA_FLAG_HTx: Half transfer complete flag
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
215 * @arg DMA_FLAG_TEx: Transfer error flag
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
216 * Where x can be 1_7 to select the DMA Channel flag.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
217 * @retval The state of FLAG (SET or RESET).
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
218 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
219
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
220 #define __HAL_DMA_GET_FLAG(__HANDLE__, __FLAG__) (DMA1->ISR & (__FLAG__))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
221
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
222 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
223 * @brief Clears the DMA Channel pending flags.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
224 * @param __HANDLE__: DMA handle
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
225 * @param __FLAG__: specifies the flag to clear.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
226 * This parameter can be any combination of the following values:
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
227 * @arg DMA_FLAG_TCx: Transfer complete flag
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
228 * @arg DMA_FLAG_HTx: Half transfer complete flag
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
229 * @arg DMA_FLAG_TEx: Transfer error flag
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
230 * Where x can be 1_7 to select the DMA Channel flag.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
231 * @retval None
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
232 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
233 #define __HAL_DMA_CLEAR_FLAG(__HANDLE__, __FLAG__) (DMA1->IFCR = (__FLAG__))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
234
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
235 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
236 * @}
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
237 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
238
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
239 #endif
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
240
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
241 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
242 * @}
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
243 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
244
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
245 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
246 * @}
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
247 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
248
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
249 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
250 * @}
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
251 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
252
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
253 #ifdef __cplusplus
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
254 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
255 #endif /* STM32F100xE || STM32F101xE || STM32F101xG || STM32F103xE || */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
256 /* STM32F103xG || STM32F105xC || STM32F107xC */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
257
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
258 #endif /* __STM32F1xx_HAL_DMA_H */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
259
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
260 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/