annotate f103c8/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_dma.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.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 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_H
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
40 #define __STM32F1xx_HAL_DMA_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 /** @addtogroup DMA
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
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
59 /** @defgroup DMA_Exported_Types DMA Exported Types
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
60 * @{
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 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
64 * @brief DMA Configuration Structure definition
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
65 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
66 typedef struct
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
67 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
68 uint32_t Direction; /*!< Specifies if the data will be transferred from memory to peripheral,
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
69 from memory to memory or from peripheral to memory.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
70 This parameter can be a value of @ref DMA_Data_transfer_direction */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
71
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
72 uint32_t PeriphInc; /*!< Specifies whether the Peripheral address register should be incremented or not.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
73 This parameter can be a value of @ref DMA_Peripheral_incremented_mode */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
74
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
75 uint32_t MemInc; /*!< Specifies whether the memory address register should be incremented or not.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
76 This parameter can be a value of @ref DMA_Memory_incremented_mode */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
77
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
78 uint32_t PeriphDataAlignment; /*!< Specifies the Peripheral data width.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
79 This parameter can be a value of @ref DMA_Peripheral_data_size */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
80
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
81 uint32_t MemDataAlignment; /*!< Specifies the Memory data width.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
82 This parameter can be a value of @ref DMA_Memory_data_size */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
83
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
84 uint32_t Mode; /*!< Specifies the operation mode of the DMAy Channelx.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
85 This parameter can be a value of @ref DMA_mode
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
86 @note The circular buffer mode cannot be used if the memory-to-memory
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
87 data transfer is configured on the selected Channel */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
88
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
89 uint32_t Priority; /*!< Specifies the software priority for the DMAy Channelx.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
90 This parameter can be a value of @ref DMA_Priority_level */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
91 } DMA_InitTypeDef;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
92
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
93 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
94 * @brief DMA Configuration enumeration values definition
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
95 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
96 typedef enum
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
97 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
98 DMA_MODE = 0, /*!< Control related DMA mode Parameter in DMA_InitTypeDef */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
99 DMA_PRIORITY = 1, /*!< Control related priority level Parameter in DMA_InitTypeDef */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
100
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
101 } DMA_ControlTypeDef;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
102
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
103 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
104 * @brief HAL DMA State structures definition
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
105 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
106 typedef enum
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
107 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
108 HAL_DMA_STATE_RESET = 0x00, /*!< DMA not yet initialized or disabled */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
109 HAL_DMA_STATE_READY = 0x01, /*!< DMA initialized and ready for use */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
110 HAL_DMA_STATE_READY_HALF = 0x11, /*!< DMA Half process success */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
111 HAL_DMA_STATE_BUSY = 0x02, /*!< DMA process is ongoing */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
112 HAL_DMA_STATE_TIMEOUT = 0x03, /*!< DMA timeout state */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
113 HAL_DMA_STATE_ERROR = 0x04, /*!< DMA error state */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
114 }HAL_DMA_StateTypeDef;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
115
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
116 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
117 * @brief HAL DMA Error Code structure definition
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
118 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
119 typedef enum
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
120 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
121 HAL_DMA_FULL_TRANSFER = 0x00, /*!< Full transfer */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
122 HAL_DMA_HALF_TRANSFER = 0x01, /*!< Half Transfer */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
123 }HAL_DMA_LevelCompleteTypeDef;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
124
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
125 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
126 * @brief DMA handle Structure definition
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
127 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
128 typedef struct __DMA_HandleTypeDef
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
129 {
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
130 DMA_Channel_TypeDef *Instance; /*!< Register base address */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
131
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
132 DMA_InitTypeDef Init; /*!< DMA communication parameters */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
133
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
134 HAL_LockTypeDef Lock; /*!< DMA locking object */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
135
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
136 HAL_DMA_StateTypeDef State; /*!< DMA transfer state */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
137
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
138 void *Parent; /*!< Parent object state */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
139
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
140 void (* XferCpltCallback)( struct __DMA_HandleTypeDef * hdma); /*!< DMA transfer complete callback */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
141
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
142 void (* XferHalfCpltCallback)( struct __DMA_HandleTypeDef * hdma); /*!< DMA Half transfer complete callback */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
143
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
144 void (* XferErrorCallback)( struct __DMA_HandleTypeDef * hdma); /*!< DMA transfer error callback */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
145
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
146 __IO uint32_t ErrorCode; /*!< DMA Error code */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
147 } DMA_HandleTypeDef;
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
148 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
149 * @}
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
150 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
151
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
152 /* Exported constants --------------------------------------------------------*/
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
153
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
154 /** @defgroup DMA_Exported_Constants DMA Exported Constants
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
155 * @{
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 /** @defgroup DMA_Error_Code DMA Error Code
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 #define HAL_DMA_ERROR_NONE ((uint32_t)0x00) /*!< No error */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
162 #define HAL_DMA_ERROR_TE ((uint32_t)0x01) /*!< Transfer error */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
163 #define HAL_DMA_ERROR_TIMEOUT ((uint32_t)0x20) /*!< Timeout error */
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 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
168
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
169 /** @defgroup DMA_Data_transfer_direction DMA Data transfer direction
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
170 * @{
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
171 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
172 #define DMA_PERIPH_TO_MEMORY ((uint32_t)0x00000000) /*!< Peripheral to memory direction */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
173 #define DMA_MEMORY_TO_PERIPH ((uint32_t)DMA_CCR_DIR) /*!< Memory to peripheral direction */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
174 #define DMA_MEMORY_TO_MEMORY ((uint32_t)DMA_CCR_MEM2MEM) /*!< Memory to memory direction */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
175
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
176 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
177 * @}
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
178 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
179
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
180 /** @defgroup DMA_Peripheral_incremented_mode DMA Peripheral incremented mode
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
181 * @{
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
182 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
183 #define DMA_PINC_ENABLE ((uint32_t)DMA_CCR_PINC) /*!< Peripheral increment mode Enable */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
184 #define DMA_PINC_DISABLE ((uint32_t)0x00000000) /*!< Peripheral increment mode Disable */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
185 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
186 * @}
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
187 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
188
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
189 /** @defgroup DMA_Memory_incremented_mode DMA Memory incremented mode
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
190 * @{
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
191 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
192 #define DMA_MINC_ENABLE ((uint32_t)DMA_CCR_MINC) /*!< Memory increment mode Enable */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
193 #define DMA_MINC_DISABLE ((uint32_t)0x00000000) /*!< Memory increment mode Disable */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
194 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
195 * @}
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
196 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
197
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
198 /** @defgroup DMA_Peripheral_data_size DMA Peripheral data size
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
199 * @{
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
200 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
201 #define DMA_PDATAALIGN_BYTE ((uint32_t)0x00000000) /*!< Peripheral data alignment: Byte */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
202 #define DMA_PDATAALIGN_HALFWORD ((uint32_t)DMA_CCR_PSIZE_0) /*!< Peripheral data alignment: HalfWord */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
203 #define DMA_PDATAALIGN_WORD ((uint32_t)DMA_CCR_PSIZE_1) /*!< Peripheral data alignment: Word */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
204 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
205 * @}
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
206 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
207
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
208 /** @defgroup DMA_Memory_data_size DMA Memory data size
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
209 * @{
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
210 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
211 #define DMA_MDATAALIGN_BYTE ((uint32_t)0x00000000) /*!< Memory data alignment: Byte */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
212 #define DMA_MDATAALIGN_HALFWORD ((uint32_t)DMA_CCR_MSIZE_0) /*!< Memory data alignment: HalfWord */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
213 #define DMA_MDATAALIGN_WORD ((uint32_t)DMA_CCR_MSIZE_1) /*!< Memory data alignment: Word */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
214 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
215 * @}
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
216 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
217
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
218 /** @defgroup DMA_mode DMA mode
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
219 * @{
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
220 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
221 #define DMA_NORMAL ((uint32_t)0x00000000) /*!< Normal mode */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
222 #define DMA_CIRCULAR ((uint32_t)DMA_CCR_CIRC) /*!< Circular mode */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
223 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
224 * @}
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
225 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
226
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
227 /** @defgroup DMA_Priority_level DMA Priority level
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
228 * @{
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
229 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
230 #define DMA_PRIORITY_LOW ((uint32_t)0x00000000) /*!< Priority level : Low */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
231 #define DMA_PRIORITY_MEDIUM ((uint32_t)DMA_CCR_PL_0) /*!< Priority level : Medium */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
232 #define DMA_PRIORITY_HIGH ((uint32_t)DMA_CCR_PL_1) /*!< Priority level : High */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
233 #define DMA_PRIORITY_VERY_HIGH ((uint32_t)DMA_CCR_PL) /*!< Priority level : Very_High */
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 /** @defgroup DMA_interrupt_enable_definitions DMA interrupt enable definitions
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 #define DMA_IT_TC ((uint32_t)DMA_CCR_TCIE)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
243 #define DMA_IT_HT ((uint32_t)DMA_CCR_HTIE)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
244 #define DMA_IT_TE ((uint32_t)DMA_CCR_TEIE)
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 /** @defgroup DMA_flag_definitions DMA flag definitions
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 #define DMA_FLAG_GL1 ((uint32_t)0x00000001)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
253 #define DMA_FLAG_TC1 ((uint32_t)0x00000002)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
254 #define DMA_FLAG_HT1 ((uint32_t)0x00000004)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
255 #define DMA_FLAG_TE1 ((uint32_t)0x00000008)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
256 #define DMA_FLAG_GL2 ((uint32_t)0x00000010)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
257 #define DMA_FLAG_TC2 ((uint32_t)0x00000020)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
258 #define DMA_FLAG_HT2 ((uint32_t)0x00000040)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
259 #define DMA_FLAG_TE2 ((uint32_t)0x00000080)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
260 #define DMA_FLAG_GL3 ((uint32_t)0x00000100)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
261 #define DMA_FLAG_TC3 ((uint32_t)0x00000200)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
262 #define DMA_FLAG_HT3 ((uint32_t)0x00000400)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
263 #define DMA_FLAG_TE3 ((uint32_t)0x00000800)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
264 #define DMA_FLAG_GL4 ((uint32_t)0x00001000)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
265 #define DMA_FLAG_TC4 ((uint32_t)0x00002000)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
266 #define DMA_FLAG_HT4 ((uint32_t)0x00004000)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
267 #define DMA_FLAG_TE4 ((uint32_t)0x00008000)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
268 #define DMA_FLAG_GL5 ((uint32_t)0x00010000)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
269 #define DMA_FLAG_TC5 ((uint32_t)0x00020000)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
270 #define DMA_FLAG_HT5 ((uint32_t)0x00040000)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
271 #define DMA_FLAG_TE5 ((uint32_t)0x00080000)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
272 #define DMA_FLAG_GL6 ((uint32_t)0x00100000)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
273 #define DMA_FLAG_TC6 ((uint32_t)0x00200000)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
274 #define DMA_FLAG_HT6 ((uint32_t)0x00400000)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
275 #define DMA_FLAG_TE6 ((uint32_t)0x00800000)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
276 #define DMA_FLAG_GL7 ((uint32_t)0x01000000)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
277 #define DMA_FLAG_TC7 ((uint32_t)0x02000000)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
278 #define DMA_FLAG_HT7 ((uint32_t)0x04000000)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
279 #define DMA_FLAG_TE7 ((uint32_t)0x08000000)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
280 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
281 * @}
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
282 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
283
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
284 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
285 * @}
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
286 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
287
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
288
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
289 /* Exported macro ------------------------------------------------------------*/
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
290 /** @defgroup DMA_Exported_Macros DMA Exported Macros
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
291 * @{
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
292 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
293
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
294 /** @brief Reset DMA handle state
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
295 * @param __HANDLE__: DMA handle.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
296 * @retval None
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
297 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
298 #define __HAL_DMA_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_DMA_STATE_RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
299
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
300 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
301 * @brief Enable the specified DMA Channel.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
302 * @param __HANDLE__: DMA handle
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
303 * @retval None.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
304 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
305 #define __HAL_DMA_ENABLE(__HANDLE__) (SET_BIT((__HANDLE__)->Instance->CCR, DMA_CCR_EN))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
306
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
307 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
308 * @brief Disable the specified DMA Channel.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
309 * @param __HANDLE__: DMA handle
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
310 * @retval None.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
311 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
312 #define __HAL_DMA_DISABLE(__HANDLE__) (CLEAR_BIT((__HANDLE__)->Instance->CCR, DMA_CCR_EN))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
313
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
314
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
315 /* Interrupt & Flag management */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
316
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
317 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
318 * @brief Enables the specified DMA Channel interrupts.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
319 * @param __HANDLE__: DMA handle
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
320 * @param __INTERRUPT__: specifies the DMA interrupt sources to be enabled or disabled.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
321 * This parameter can be any combination of the following values:
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
322 * @arg DMA_IT_TC: Transfer complete interrupt mask
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
323 * @arg DMA_IT_HT: Half transfer complete interrupt mask
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
324 * @arg DMA_IT_TE: Transfer error interrupt mask
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
325 * @retval None
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
326 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
327 #define __HAL_DMA_ENABLE_IT(__HANDLE__, __INTERRUPT__) (SET_BIT((__HANDLE__)->Instance->CCR, (__INTERRUPT__)))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
328
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
329 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
330 * @brief Disables the specified DMA Channel interrupts.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
331 * @param __HANDLE__: DMA handle
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
332 * @param __INTERRUPT__: specifies the DMA interrupt sources to be enabled or disabled.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
333 * This parameter can be any combination of the following values:
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
334 * @arg DMA_IT_TC: Transfer complete interrupt mask
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
335 * @arg DMA_IT_HT: Half transfer complete interrupt mask
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
336 * @arg DMA_IT_TE: Transfer error interrupt mask
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
337 * @retval None
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
338 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
339 #define __HAL_DMA_DISABLE_IT(__HANDLE__, __INTERRUPT__) (CLEAR_BIT((__HANDLE__)->Instance->CCR , (__INTERRUPT__)))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
340
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
341 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
342 * @brief Checks whether the specified DMA Channel interrupt is enabled or disabled.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
343 * @param __HANDLE__: DMA handle
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
344 * @param __INTERRUPT__: specifies the DMA interrupt source to check.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
345 * This parameter can be one of the following values:
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
346 * @arg DMA_IT_TC: Transfer complete interrupt mask
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
347 * @arg DMA_IT_HT: Half transfer complete interrupt mask
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
348 * @arg DMA_IT_TE: Transfer error interrupt mask
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
349 * @retval The state of DMA_IT (SET or RESET).
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
350 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
351 #define __HAL_DMA_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) ((((__HANDLE__)->Instance->CCR & (__INTERRUPT__)) == (__INTERRUPT__)) ? SET : RESET)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
352
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
353 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
354 * @brief Returns the number of remaining data units in the current DMAy Channelx transfer.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
355 * @param __HANDLE__: DMA handle
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
356 *
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
357 * @retval The number of remaining data units in the current DMA Channel transfer.
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
358 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
359 #define __HAL_DMA_GET_COUNTER(__HANDLE__) ((__HANDLE__)->Instance->CNDTR)
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
360
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
361 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
362 * @}
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
363 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
364
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
365 /* Include DMA HAL Extension module */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
366 #include "stm32f1xx_hal_dma_ex.h"
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
367
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
368 /* Exported functions --------------------------------------------------------*/
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
369 /** @addtogroup DMA_Exported_Functions DMA Exported Functions
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
370 * @{
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
371 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
372
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
373 /** @addtogroup DMA_Exported_Functions_Group1 Initialization and de-initialization functions
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
374 * @{
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
375 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
376 /* Initialization and de-initialization functions *****************************/
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
377 HAL_StatusTypeDef HAL_DMA_Init(DMA_HandleTypeDef *hdma);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
378 HAL_StatusTypeDef HAL_DMA_DeInit (DMA_HandleTypeDef *hdma);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
379 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
380 * @}
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
381 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
382
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
383 /** @addtogroup DMA_Exported_Functions_Group2 Input and Output operation functions
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
384 * @{
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
385 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
386 /* IO operation functions *****************************************************/
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
387 HAL_StatusTypeDef HAL_DMA_Start (DMA_HandleTypeDef *hdma, uint32_t SrcAddress, uint32_t DstAddress, uint32_t DataLength);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
388 HAL_StatusTypeDef HAL_DMA_Start_IT(DMA_HandleTypeDef *hdma, uint32_t SrcAddress, uint32_t DstAddress, uint32_t DataLength);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
389 HAL_StatusTypeDef HAL_DMA_Abort(DMA_HandleTypeDef *hdma);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
390 HAL_StatusTypeDef HAL_DMA_PollForTransfer(DMA_HandleTypeDef *hdma, uint32_t CompleteLevel, uint32_t Timeout);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
391 void HAL_DMA_IRQHandler(DMA_HandleTypeDef *hdma);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
392 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
393 * @}
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
394 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
395
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
396 /** @addtogroup DMA_Exported_Functions_Group3 Peripheral State functions
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
397 * @{
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
398 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
399 /* Peripheral State and Error functions ***************************************/
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
400 HAL_DMA_StateTypeDef HAL_DMA_GetState(DMA_HandleTypeDef *hdma);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
401 uint32_t HAL_DMA_GetError(DMA_HandleTypeDef *hdma);
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
402 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
403 * @}
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
404 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
405
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
406 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
407 * @}
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
408 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
409
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
410 /* Private Constants -------------------------------------------------------------*/
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
411 /** @defgroup DMA_Private_Constants DMA Private Constants
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
412 * @brief DMA private defines and constants
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
413 * @{
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
414 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
415 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
416 * @}
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
417 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
418
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
419 /* Private macros ------------------------------------------------------------*/
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
420 /** @defgroup DMA_Private_Macros DMA Private Macros
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
421 * @brief DMA private macros
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
422 * @{
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
423 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
424
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
425 #define IS_DMA_BUFFER_SIZE(SIZE) (((SIZE) >= 0x1) && ((SIZE) < 0x10000))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
426
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
427 #define IS_DMA_DIRECTION(DIRECTION) (((DIRECTION) == DMA_PERIPH_TO_MEMORY ) || \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
428 ((DIRECTION) == DMA_MEMORY_TO_PERIPH) || \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
429 ((DIRECTION) == DMA_MEMORY_TO_MEMORY))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
430
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
431 #define IS_DMA_PERIPHERAL_INC_STATE(STATE) (((STATE) == DMA_PINC_ENABLE) || \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
432 ((STATE) == DMA_PINC_DISABLE))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
433
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
434 #define IS_DMA_MEMORY_INC_STATE(STATE) (((STATE) == DMA_MINC_ENABLE) || \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
435 ((STATE) == DMA_MINC_DISABLE))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
436
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
437 #define IS_DMA_PERIPHERAL_DATA_SIZE(SIZE) (((SIZE) == DMA_PDATAALIGN_BYTE) || \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
438 ((SIZE) == DMA_PDATAALIGN_HALFWORD) || \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
439 ((SIZE) == DMA_PDATAALIGN_WORD))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
440
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
441 #define IS_DMA_MEMORY_DATA_SIZE(SIZE) (((SIZE) == DMA_MDATAALIGN_BYTE) || \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
442 ((SIZE) == DMA_MDATAALIGN_HALFWORD) || \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
443 ((SIZE) == DMA_MDATAALIGN_WORD ))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
444
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
445 #define IS_DMA_MODE(MODE) (((MODE) == DMA_NORMAL ) || \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
446 ((MODE) == DMA_CIRCULAR))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
447
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
448 #define IS_DMA_PRIORITY(PRIORITY) (((PRIORITY) == DMA_PRIORITY_LOW ) || \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
449 ((PRIORITY) == DMA_PRIORITY_MEDIUM) || \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
450 ((PRIORITY) == DMA_PRIORITY_HIGH) || \
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
451 ((PRIORITY) == DMA_PRIORITY_VERY_HIGH))
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
452
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
453 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
454 * @}
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
455 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
456
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
457 /* Private functions ---------------------------------------------------------*/
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
458 /** @defgroup DMA_Private_Functions DMA Private Functions
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
459 * @brief DMA private functions
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
460 * @{
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
461 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
462 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
463 * @}
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
464 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
465
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
466 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
467 * @}
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
468 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
469
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
470 /**
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
471 * @}
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
472 */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
473
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
474 #ifdef __cplusplus
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
475 }
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
476 #endif
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
477
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
478 #endif /* __STM32F1xx_HAL_DMA_H */
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
479
0c59e7a7782a Working on GPIO and RCC
cin
parents:
diff changeset
480 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/