annotate Common/Drivers/STM32F4xx_HAL_DRIVER_v120/Inc/stm32f4xx_hal_dma.h @ 112:fdf0272e9213 FlipDisplay

Added new nvm parameter"FlipDisplay" indicating the screen orientation
author Ideenmodellierer
date Tue, 01 Jan 2019 21:03:33 +0100
parents 5f11787b4f42
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2 ******************************************************************************
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3 * @file stm32f4xx_hal_dma.h
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4 * @author MCD Application Team
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5 * @version V1.2.0
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6 * @date 26-December-2014
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
7 * @brief Header file of DMA HAL module.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
8 ******************************************************************************
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
9 * @attention
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
10 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
11 * <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
12 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
13 * Redistribution and use in source and binary forms, with or without modification,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
14 * are permitted provided that the following conditions are met:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
15 * 1. Redistributions of source code must retain the above copyright notice,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
16 * this list of conditions and the following disclaimer.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
17 * 2. Redistributions in binary form must reproduce the above copyright notice,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
18 * this list of conditions and the following disclaimer in the documentation
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
19 * and/or other materials provided with the distribution.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
21 * may be used to endorse or promote products derived from this software
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
22 * without specific prior written permission.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
23 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
34 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
35 ******************************************************************************
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
36 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
37
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
38 /* Define to prevent recursive inclusion -------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
39 #ifndef __STM32F4xx_HAL_DMA_H
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
40 #define __STM32F4xx_HAL_DMA_H
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
41
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
42 #ifdef __cplusplus
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
43 extern "C" {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
44 #endif
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
45
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
46 /* Includes ------------------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
47 #include "stm32f4xx_hal_def.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
48
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
49 /** @addtogroup STM32F4xx_HAL_Driver
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
50 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
51 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
52
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
53 /** @addtogroup DMA
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
54 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
55 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
56
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
57 /* Exported types ------------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
58
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
59 /** @defgroup DMA_Exported_Types DMA Exported Types
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
60 * @brief DMA Exported Types
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
61 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
62 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
63
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
64 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
65 * @brief DMA Configuration Structure definition
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
66 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
67 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
68 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
69 uint32_t Channel; /*!< Specifies the channel used for the specified stream.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
70 This parameter can be a value of @ref DMA_Channel_selection */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
71
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
72 uint32_t Direction; /*!< Specifies if the data will be transferred from memory to peripheral,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
73 from memory to memory or from peripheral to memory.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
74 This parameter can be a value of @ref DMA_Data_transfer_direction */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
75
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
76 uint32_t PeriphInc; /*!< Specifies whether the Peripheral address register should be incremented or not.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
77 This parameter can be a value of @ref DMA_Peripheral_incremented_mode */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
78
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
79 uint32_t MemInc; /*!< Specifies whether the memory address register should be incremented or not.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
80 This parameter can be a value of @ref DMA_Memory_incremented_mode */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
81
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
82 uint32_t PeriphDataAlignment; /*!< Specifies the Peripheral data width.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
83 This parameter can be a value of @ref DMA_Peripheral_data_size */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
84
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
85 uint32_t MemDataAlignment; /*!< Specifies the Memory data width.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
86 This parameter can be a value of @ref DMA_Memory_data_size */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
87
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
88 uint32_t Mode; /*!< Specifies the operation mode of the DMAy Streamx.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
89 This parameter can be a value of @ref DMA_mode
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
90 @note The circular buffer mode cannot be used if the memory-to-memory
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
91 data transfer is configured on the selected Stream */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
92
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
93 uint32_t Priority; /*!< Specifies the software priority for the DMAy Streamx.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
94 This parameter can be a value of @ref DMA_Priority_level */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
95
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
96 uint32_t FIFOMode; /*!< Specifies if the FIFO mode or Direct mode will be used for the specified stream.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
97 This parameter can be a value of @ref DMA_FIFO_direct_mode
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
98 @note The Direct mode (FIFO mode disabled) cannot be used if the
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
99 memory-to-memory data transfer is configured on the selected stream */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
100
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
101 uint32_t FIFOThreshold; /*!< Specifies the FIFO threshold level.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
102 This parameter can be a value of @ref DMA_FIFO_threshold_level */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
103
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
104 uint32_t MemBurst; /*!< Specifies the Burst transfer configuration for the memory transfers.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
105 It specifies the amount of data to be transferred in a single non interruptible
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
106 transaction.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
107 This parameter can be a value of @ref DMA_Memory_burst
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
108 @note The burst mode is possible only if the address Increment mode is enabled. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
109
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
110 uint32_t PeriphBurst; /*!< Specifies the Burst transfer configuration for the peripheral transfers.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
111 It specifies the amount of data to be transferred in a single non interruptable
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
112 transaction.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
113 This parameter can be a value of @ref DMA_Peripheral_burst
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
114 @note The burst mode is possible only if the address Increment mode is enabled. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
115 }DMA_InitTypeDef;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
116
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
117
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
118 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
119 * @brief HAL DMA State structures definition
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
120 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
121 typedef enum
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
122 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
123 HAL_DMA_STATE_RESET = 0x00, /*!< DMA not yet initialized or disabled */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
124 HAL_DMA_STATE_READY = 0x01, /*!< DMA initialized and ready for use */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
125 HAL_DMA_STATE_READY_MEM0 = 0x11, /*!< DMA Mem0 process success */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
126 HAL_DMA_STATE_READY_MEM1 = 0x21, /*!< DMA Mem1 process success */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
127 HAL_DMA_STATE_READY_HALF_MEM0 = 0x31, /*!< DMA Mem0 Half process success */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
128 HAL_DMA_STATE_READY_HALF_MEM1 = 0x41, /*!< DMA Mem1 Half process success */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
129 HAL_DMA_STATE_BUSY = 0x02, /*!< DMA process is ongoing */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
130 HAL_DMA_STATE_BUSY_MEM0 = 0x12, /*!< DMA Mem0 process is ongoing */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
131 HAL_DMA_STATE_BUSY_MEM1 = 0x22, /*!< DMA Mem1 process is ongoing */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
132 HAL_DMA_STATE_TIMEOUT = 0x03, /*!< DMA timeout state */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
133 HAL_DMA_STATE_ERROR = 0x04, /*!< DMA error state */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
134 }HAL_DMA_StateTypeDef;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
135
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
136 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
137 * @brief HAL DMA Error Code structure definition
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
138 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
139 typedef enum
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
140 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
141 HAL_DMA_FULL_TRANSFER = 0x00, /*!< Full transfer */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
142 HAL_DMA_HALF_TRANSFER = 0x01, /*!< Half Transfer */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
143 }HAL_DMA_LevelCompleteTypeDef;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
144
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
145 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
146 * @brief DMA handle Structure definition
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
147 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
148 typedef struct __DMA_HandleTypeDef
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
149 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
150 DMA_Stream_TypeDef *Instance; /*!< Register base address */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
151
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
152 DMA_InitTypeDef Init; /*!< DMA communication parameters */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
153
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
154 HAL_LockTypeDef Lock; /*!< DMA locking object */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
155
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
156 __IO HAL_DMA_StateTypeDef State; /*!< DMA transfer state */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
157
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
158 void *Parent; /*!< Parent object state */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
159
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
160 void (* XferCpltCallback)( struct __DMA_HandleTypeDef * hdma); /*!< DMA transfer complete callback */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
161
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
162 void (* XferHalfCpltCallback)( struct __DMA_HandleTypeDef * hdma); /*!< DMA Half transfer complete callback */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
163
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
164 void (* XferM1CpltCallback)( struct __DMA_HandleTypeDef * hdma); /*!< DMA transfer complete Memory1 callback */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
165
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
166 void (* XferErrorCallback)( struct __DMA_HandleTypeDef * hdma); /*!< DMA transfer error callback */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
167
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
168 __IO uint32_t ErrorCode; /*!< DMA Error code */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
169 }DMA_HandleTypeDef;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
170
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
171 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
172 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
173 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
174
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
175 /* Exported constants --------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
176
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
177 /** @defgroup DMA_Exported_Constants DMA Exported Constants
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
178 * @brief DMA Exported constants
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
179 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
180 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
181
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
182 /** @defgroup DMA_Error_Code DMA Error Code
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
183 * @brief DMA Error Code
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
184 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
185 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
186 #define HAL_DMA_ERROR_NONE ((uint32_t)0x00000000) /*!< No error */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
187 #define HAL_DMA_ERROR_TE ((uint32_t)0x00000001) /*!< Transfer error */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
188 #define HAL_DMA_ERROR_FE ((uint32_t)0x00000002) /*!< FIFO error */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
189 #define HAL_DMA_ERROR_DME ((uint32_t)0x00000004) /*!< Direct Mode error */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
190 #define HAL_DMA_ERROR_TIMEOUT ((uint32_t)0x00000020) /*!< Timeout error */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
191 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
192 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
193 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
194
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
195 /** @defgroup DMA_Channel_selection DMA Channel selection
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
196 * @brief DMA channel selection
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
197 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
198 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
199 #define DMA_CHANNEL_0 ((uint32_t)0x00000000) /*!< DMA Channel 0 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
200 #define DMA_CHANNEL_1 ((uint32_t)0x02000000) /*!< DMA Channel 1 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
201 #define DMA_CHANNEL_2 ((uint32_t)0x04000000) /*!< DMA Channel 2 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
202 #define DMA_CHANNEL_3 ((uint32_t)0x06000000) /*!< DMA Channel 3 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
203 #define DMA_CHANNEL_4 ((uint32_t)0x08000000) /*!< DMA Channel 4 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
204 #define DMA_CHANNEL_5 ((uint32_t)0x0A000000) /*!< DMA Channel 5 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
205 #define DMA_CHANNEL_6 ((uint32_t)0x0C000000) /*!< DMA Channel 6 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
206 #define DMA_CHANNEL_7 ((uint32_t)0x0E000000) /*!< DMA Channel 7 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
207 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
208 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
209 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
210
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
211 /** @defgroup DMA_Data_transfer_direction DMA Data transfer direction
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
212 * @brief DMA data transfer direction
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
213 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
214 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
215 #define DMA_PERIPH_TO_MEMORY ((uint32_t)0x00000000) /*!< Peripheral to memory direction */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
216 #define DMA_MEMORY_TO_PERIPH ((uint32_t)DMA_SxCR_DIR_0) /*!< Memory to peripheral direction */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
217 #define DMA_MEMORY_TO_MEMORY ((uint32_t)DMA_SxCR_DIR_1) /*!< Memory to memory direction */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
218 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
219 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
220 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
221
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
222 /** @defgroup DMA_Peripheral_incremented_mode DMA Peripheral incremented mode
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
223 * @brief DMA peripheral incremented mode
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
224 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
225 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
226 #define DMA_PINC_ENABLE ((uint32_t)DMA_SxCR_PINC) /*!< Peripheral increment mode enable */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
227 #define DMA_PINC_DISABLE ((uint32_t)0x00000000) /*!< Peripheral increment mode disable */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
228 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
229 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
230 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
231
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
232 /** @defgroup DMA_Memory_incremented_mode DMA Memory incremented mode
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
233 * @brief DMA memory incremented mode
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
234 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
235 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
236 #define DMA_MINC_ENABLE ((uint32_t)DMA_SxCR_MINC) /*!< Memory increment mode enable */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
237 #define DMA_MINC_DISABLE ((uint32_t)0x00000000) /*!< Memory increment mode disable */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
238 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
239 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
240 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
241
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
242 /** @defgroup DMA_Peripheral_data_size DMA Peripheral data size
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
243 * @brief DMA peripheral data size
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
244 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
245 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
246 #define DMA_PDATAALIGN_BYTE ((uint32_t)0x00000000) /*!< Peripheral data alignment: Byte */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
247 #define DMA_PDATAALIGN_HALFWORD ((uint32_t)DMA_SxCR_PSIZE_0) /*!< Peripheral data alignment: HalfWord */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
248 #define DMA_PDATAALIGN_WORD ((uint32_t)DMA_SxCR_PSIZE_1) /*!< Peripheral data alignment: Word */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
249 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
250 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
251 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
252
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
253 /** @defgroup DMA_Memory_data_size DMA Memory data size
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
254 * @brief DMA memory data size
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
255 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
256 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
257 #define DMA_MDATAALIGN_BYTE ((uint32_t)0x00000000) /*!< Memory data alignment: Byte */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
258 #define DMA_MDATAALIGN_HALFWORD ((uint32_t)DMA_SxCR_MSIZE_0) /*!< Memory data alignment: HalfWord */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
259 #define DMA_MDATAALIGN_WORD ((uint32_t)DMA_SxCR_MSIZE_1) /*!< Memory data alignment: Word */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
260 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
261 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
262 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
263
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
264 /** @defgroup DMA_mode DMA mode
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
265 * @brief DMA mode
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
266 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
267 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
268 #define DMA_NORMAL ((uint32_t)0x00000000) /*!< Normal mode */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
269 #define DMA_CIRCULAR ((uint32_t)DMA_SxCR_CIRC) /*!< Circular mode */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
270 #define DMA_PFCTRL ((uint32_t)DMA_SxCR_PFCTRL) /*!< Peripheral flow control mode */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
271 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
272 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
273 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
274
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
275 /** @defgroup DMA_Priority_level DMA Priority level
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
276 * @brief DMA priority levels
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
277 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
278 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
279 #define DMA_PRIORITY_LOW ((uint32_t)0x00000000) /*!< Priority level: Low */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
280 #define DMA_PRIORITY_MEDIUM ((uint32_t)DMA_SxCR_PL_0) /*!< Priority level: Medium */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
281 #define DMA_PRIORITY_HIGH ((uint32_t)DMA_SxCR_PL_1) /*!< Priority level: High */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
282 #define DMA_PRIORITY_VERY_HIGH ((uint32_t)DMA_SxCR_PL) /*!< Priority level: Very High */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
283 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
284 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
285 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
286
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
287 /** @defgroup DMA_FIFO_direct_mode DMA FIFO direct mode
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
288 * @brief DMA FIFO direct mode
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
289 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
290 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
291 #define DMA_FIFOMODE_DISABLE ((uint32_t)0x00000000) /*!< FIFO mode disable */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
292 #define DMA_FIFOMODE_ENABLE ((uint32_t)DMA_SxFCR_DMDIS) /*!< FIFO mode enable */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
293 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
294 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
295 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
296
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
297 /** @defgroup DMA_FIFO_threshold_level DMA FIFO threshold level
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
298 * @brief DMA FIFO level
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
299 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
300 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
301 #define DMA_FIFO_THRESHOLD_1QUARTERFULL ((uint32_t)0x00000000) /*!< FIFO threshold 1 quart full configuration */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
302 #define DMA_FIFO_THRESHOLD_HALFFULL ((uint32_t)DMA_SxFCR_FTH_0) /*!< FIFO threshold half full configuration */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
303 #define DMA_FIFO_THRESHOLD_3QUARTERSFULL ((uint32_t)DMA_SxFCR_FTH_1) /*!< FIFO threshold 3 quarts full configuration */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
304 #define DMA_FIFO_THRESHOLD_FULL ((uint32_t)DMA_SxFCR_FTH) /*!< FIFO threshold full configuration */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
305 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
306 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
307 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
308
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
309 /** @defgroup DMA_Memory_burst DMA Memory burst
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
310 * @brief DMA memory burst
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
311 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
312 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
313 #define DMA_MBURST_SINGLE ((uint32_t)0x00000000)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
314 #define DMA_MBURST_INC4 ((uint32_t)DMA_SxCR_MBURST_0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
315 #define DMA_MBURST_INC8 ((uint32_t)DMA_SxCR_MBURST_1)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
316 #define DMA_MBURST_INC16 ((uint32_t)DMA_SxCR_MBURST)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
317 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
318 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
319 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
320
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
321 /** @defgroup DMA_Peripheral_burst DMA Peripheral burst
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
322 * @brief DMA peripheral burst
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
323 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
324 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
325 #define DMA_PBURST_SINGLE ((uint32_t)0x00000000)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
326 #define DMA_PBURST_INC4 ((uint32_t)DMA_SxCR_PBURST_0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
327 #define DMA_PBURST_INC8 ((uint32_t)DMA_SxCR_PBURST_1)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
328 #define DMA_PBURST_INC16 ((uint32_t)DMA_SxCR_PBURST)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
329 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
330 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
331 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
332
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
333 /** @defgroup DMA_interrupt_enable_definitions DMA interrupt enable definitions
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
334 * @brief DMA interrupts definition
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
335 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
336 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
337 #define DMA_IT_TC ((uint32_t)DMA_SxCR_TCIE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
338 #define DMA_IT_HT ((uint32_t)DMA_SxCR_HTIE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
339 #define DMA_IT_TE ((uint32_t)DMA_SxCR_TEIE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
340 #define DMA_IT_DME ((uint32_t)DMA_SxCR_DMEIE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
341 #define DMA_IT_FE ((uint32_t)0x00000080)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
342 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
343 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
344 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
345
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
346 /** @defgroup DMA_flag_definitions DMA flag definitions
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
347 * @brief DMA flag definitions
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
348 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
349 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
350 #define DMA_FLAG_FEIF0_4 ((uint32_t)0x00800001)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
351 #define DMA_FLAG_DMEIF0_4 ((uint32_t)0x00800004)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
352 #define DMA_FLAG_TEIF0_4 ((uint32_t)0x00000008)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
353 #define DMA_FLAG_HTIF0_4 ((uint32_t)0x00000010)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
354 #define DMA_FLAG_TCIF0_4 ((uint32_t)0x00000020)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
355 #define DMA_FLAG_FEIF1_5 ((uint32_t)0x00000040)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
356 #define DMA_FLAG_DMEIF1_5 ((uint32_t)0x00000100)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
357 #define DMA_FLAG_TEIF1_5 ((uint32_t)0x00000200)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
358 #define DMA_FLAG_HTIF1_5 ((uint32_t)0x00000400)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
359 #define DMA_FLAG_TCIF1_5 ((uint32_t)0x00000800)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
360 #define DMA_FLAG_FEIF2_6 ((uint32_t)0x00010000)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
361 #define DMA_FLAG_DMEIF2_6 ((uint32_t)0x00040000)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
362 #define DMA_FLAG_TEIF2_6 ((uint32_t)0x00080000)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
363 #define DMA_FLAG_HTIF2_6 ((uint32_t)0x00100000)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
364 #define DMA_FLAG_TCIF2_6 ((uint32_t)0x00200000)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
365 #define DMA_FLAG_FEIF3_7 ((uint32_t)0x00400000)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
366 #define DMA_FLAG_DMEIF3_7 ((uint32_t)0x01000000)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
367 #define DMA_FLAG_TEIF3_7 ((uint32_t)0x02000000)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
368 #define DMA_FLAG_HTIF3_7 ((uint32_t)0x04000000)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
369 #define DMA_FLAG_TCIF3_7 ((uint32_t)0x08000000)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
370 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
371 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
372 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
373
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
374 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
375 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
376 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
377
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
378 /* Exported macro ------------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
379
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
380 /** @brief Reset DMA handle state
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
381 * @param __HANDLE__: specifies the DMA handle.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
382 * @retval None
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
383 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
384 #define __HAL_DMA_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_DMA_STATE_RESET)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
385
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
386 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
387 * @brief Return the current DMA Stream FIFO filled level.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
388 * @param __HANDLE__: DMA handle
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
389 * @retval The FIFO filling state.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
390 * - DMA_FIFOStatus_Less1QuarterFull: when FIFO is less than 1 quarter-full
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
391 * and not empty.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
392 * - DMA_FIFOStatus_1QuarterFull: if more than 1 quarter-full.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
393 * - DMA_FIFOStatus_HalfFull: if more than 1 half-full.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
394 * - DMA_FIFOStatus_3QuartersFull: if more than 3 quarters-full.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
395 * - DMA_FIFOStatus_Empty: when FIFO is empty
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
396 * - DMA_FIFOStatus_Full: when FIFO is full
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
397 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
398 #define __HAL_DMA_GET_FS(__HANDLE__) (((__HANDLE__)->Instance->FCR & (DMA_SxFCR_FS)))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
399
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
400 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
401 * @brief Enable the specified DMA Stream.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
402 * @param __HANDLE__: DMA handle
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
403 * @retval None
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
404 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
405 #define __HAL_DMA_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= DMA_SxCR_EN)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
406
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
407 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
408 * @brief Disable the specified DMA Stream.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
409 * @param __HANDLE__: DMA handle
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
410 * @retval None
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
411 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
412 #define __HAL_DMA_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~DMA_SxCR_EN)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
413
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
414 /* Interrupt & Flag management */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
415
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
416 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
417 * @brief Return the current DMA Stream transfer complete flag.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
418 * @param __HANDLE__: DMA handle
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
419 * @retval The specified transfer complete flag index.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
420 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
421 #define __HAL_DMA_GET_TC_FLAG_INDEX(__HANDLE__) \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
422 (((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream0))? DMA_FLAG_TCIF0_4 :\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
423 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream0))? DMA_FLAG_TCIF0_4 :\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
424 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream4))? DMA_FLAG_TCIF0_4 :\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
425 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream4))? DMA_FLAG_TCIF0_4 :\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
426 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream1))? DMA_FLAG_TCIF1_5 :\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
427 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream1))? DMA_FLAG_TCIF1_5 :\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
428 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream5))? DMA_FLAG_TCIF1_5 :\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
429 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream5))? DMA_FLAG_TCIF1_5 :\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
430 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream2))? DMA_FLAG_TCIF2_6 :\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
431 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream2))? DMA_FLAG_TCIF2_6 :\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
432 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream6))? DMA_FLAG_TCIF2_6 :\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
433 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream6))? DMA_FLAG_TCIF2_6 :\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
434 DMA_FLAG_TCIF3_7)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
435
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
436 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
437 * @brief Return the current DMA Stream half transfer complete flag.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
438 * @param __HANDLE__: DMA handle
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
439 * @retval The specified half transfer complete flag index.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
440 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
441 #define __HAL_DMA_GET_HT_FLAG_INDEX(__HANDLE__)\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
442 (((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream0))? DMA_FLAG_HTIF0_4 :\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
443 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream0))? DMA_FLAG_HTIF0_4 :\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
444 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream4))? DMA_FLAG_HTIF0_4 :\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
445 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream4))? DMA_FLAG_HTIF0_4 :\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
446 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream1))? DMA_FLAG_HTIF1_5 :\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
447 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream1))? DMA_FLAG_HTIF1_5 :\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
448 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream5))? DMA_FLAG_HTIF1_5 :\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
449 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream5))? DMA_FLAG_HTIF1_5 :\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
450 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream2))? DMA_FLAG_HTIF2_6 :\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
451 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream2))? DMA_FLAG_HTIF2_6 :\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
452 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream6))? DMA_FLAG_HTIF2_6 :\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
453 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream6))? DMA_FLAG_HTIF2_6 :\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
454 DMA_FLAG_HTIF3_7)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
455
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
456 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
457 * @brief Return the current DMA Stream transfer error flag.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
458 * @param __HANDLE__: DMA handle
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
459 * @retval The specified transfer error flag index.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
460 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
461 #define __HAL_DMA_GET_TE_FLAG_INDEX(__HANDLE__)\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
462 (((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream0))? DMA_FLAG_TEIF0_4 :\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
463 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream0))? DMA_FLAG_TEIF0_4 :\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
464 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream4))? DMA_FLAG_TEIF0_4 :\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
465 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream4))? DMA_FLAG_TEIF0_4 :\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
466 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream1))? DMA_FLAG_TEIF1_5 :\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
467 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream1))? DMA_FLAG_TEIF1_5 :\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
468 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream5))? DMA_FLAG_TEIF1_5 :\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
469 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream5))? DMA_FLAG_TEIF1_5 :\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
470 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream2))? DMA_FLAG_TEIF2_6 :\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
471 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream2))? DMA_FLAG_TEIF2_6 :\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
472 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream6))? DMA_FLAG_TEIF2_6 :\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
473 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream6))? DMA_FLAG_TEIF2_6 :\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
474 DMA_FLAG_TEIF3_7)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
475
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
476 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
477 * @brief Return the current DMA Stream FIFO error flag.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
478 * @param __HANDLE__: DMA handle
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
479 * @retval The specified FIFO error flag index.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
480 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
481 #define __HAL_DMA_GET_FE_FLAG_INDEX(__HANDLE__)\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
482 (((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream0))? DMA_FLAG_FEIF0_4 :\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
483 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream0))? DMA_FLAG_FEIF0_4 :\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
484 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream4))? DMA_FLAG_FEIF0_4 :\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
485 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream4))? DMA_FLAG_FEIF0_4 :\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
486 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream1))? DMA_FLAG_FEIF1_5 :\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
487 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream1))? DMA_FLAG_FEIF1_5 :\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
488 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream5))? DMA_FLAG_FEIF1_5 :\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
489 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream5))? DMA_FLAG_FEIF1_5 :\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
490 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream2))? DMA_FLAG_FEIF2_6 :\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
491 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream2))? DMA_FLAG_FEIF2_6 :\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
492 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream6))? DMA_FLAG_FEIF2_6 :\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
493 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream6))? DMA_FLAG_FEIF2_6 :\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
494 DMA_FLAG_FEIF3_7)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
495
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
496 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
497 * @brief Return the current DMA Stream direct mode error flag.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
498 * @param __HANDLE__: DMA handle
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
499 * @retval The specified direct mode error flag index.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
500 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
501 #define __HAL_DMA_GET_DME_FLAG_INDEX(__HANDLE__)\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
502 (((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream0))? DMA_FLAG_DMEIF0_4 :\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
503 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream0))? DMA_FLAG_DMEIF0_4 :\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
504 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream4))? DMA_FLAG_DMEIF0_4 :\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
505 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream4))? DMA_FLAG_DMEIF0_4 :\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
506 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream1))? DMA_FLAG_DMEIF1_5 :\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
507 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream1))? DMA_FLAG_DMEIF1_5 :\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
508 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream5))? DMA_FLAG_DMEIF1_5 :\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
509 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream5))? DMA_FLAG_DMEIF1_5 :\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
510 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream2))? DMA_FLAG_DMEIF2_6 :\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
511 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream2))? DMA_FLAG_DMEIF2_6 :\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
512 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream6))? DMA_FLAG_DMEIF2_6 :\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
513 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream6))? DMA_FLAG_DMEIF2_6 :\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
514 DMA_FLAG_DMEIF3_7)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
515
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
516 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
517 * @brief Get the DMA Stream pending flags.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
518 * @param __HANDLE__: DMA handle
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
519 * @param __FLAG__: Get the specified flag.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
520 * This parameter can be any combination of the following values:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
521 * @arg DMA_FLAG_TCIFx: Transfer complete flag.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
522 * @arg DMA_FLAG_HTIFx: Half transfer complete flag.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
523 * @arg DMA_FLAG_TEIFx: Transfer error flag.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
524 * @arg DMA_FLAG_DMEIFx: Direct mode error flag.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
525 * @arg DMA_FLAG_FEIFx: FIFO error flag.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
526 * Where x can be 0_4, 1_5, 2_6 or 3_7 to select the DMA Stream flag.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
527 * @retval The state of FLAG (SET or RESET).
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
528 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
529 #define __HAL_DMA_GET_FLAG(__HANDLE__, __FLAG__)\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
530 (((uint32_t)((__HANDLE__)->Instance) > (uint32_t)DMA2_Stream3)? (DMA2->HISR & (__FLAG__)) :\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
531 ((uint32_t)((__HANDLE__)->Instance) > (uint32_t)DMA1_Stream7)? (DMA2->LISR & (__FLAG__)) :\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
532 ((uint32_t)((__HANDLE__)->Instance) > (uint32_t)DMA1_Stream3)? (DMA1->HISR & (__FLAG__)) : (DMA1->LISR & (__FLAG__)))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
533
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
534 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
535 * @brief Clear the DMA Stream pending flags.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
536 * @param __HANDLE__: DMA handle
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
537 * @param __FLAG__: specifies the flag to clear.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
538 * This parameter can be any combination of the following values:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
539 * @arg DMA_FLAG_TCIFx: Transfer complete flag.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
540 * @arg DMA_FLAG_HTIFx: Half transfer complete flag.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
541 * @arg DMA_FLAG_TEIFx: Transfer error flag.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
542 * @arg DMA_FLAG_DMEIFx: Direct mode error flag.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
543 * @arg DMA_FLAG_FEIFx: FIFO error flag.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
544 * Where x can be 0_4, 1_5, 2_6 or 3_7 to select the DMA Stream flag.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
545 * @retval None
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
546 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
547 #define __HAL_DMA_CLEAR_FLAG(__HANDLE__, __FLAG__) \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
548 (((uint32_t)((__HANDLE__)->Instance) > (uint32_t)DMA2_Stream3)? (DMA2->HIFCR = (__FLAG__)) :\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
549 ((uint32_t)((__HANDLE__)->Instance) > (uint32_t)DMA1_Stream7)? (DMA2->LIFCR = (__FLAG__)) :\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
550 ((uint32_t)((__HANDLE__)->Instance) > (uint32_t)DMA1_Stream3)? (DMA1->HIFCR = (__FLAG__)) : (DMA1->LIFCR = (__FLAG__)))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
551
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
552 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
553 * @brief Enable the specified DMA Stream interrupts.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
554 * @param __HANDLE__: DMA handle
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
555 * @param __INTERRUPT__: specifies the DMA interrupt sources to be enabled or disabled.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
556 * This parameter can be any combination of the following values:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
557 * @arg DMA_IT_TC: Transfer complete interrupt mask.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
558 * @arg DMA_IT_HT: Half transfer complete interrupt mask.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
559 * @arg DMA_IT_TE: Transfer error interrupt mask.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
560 * @arg DMA_IT_FE: FIFO error interrupt mask.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
561 * @arg DMA_IT_DME: Direct mode error interrupt.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
562 * @retval None
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
563 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
564 #define __HAL_DMA_ENABLE_IT(__HANDLE__, __INTERRUPT__) (((__INTERRUPT__) != DMA_IT_FE)? \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
565 ((__HANDLE__)->Instance->CR |= (__INTERRUPT__)) : ((__HANDLE__)->Instance->FCR |= (__INTERRUPT__)))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
566
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
567 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
568 * @brief Disable the specified DMA Stream interrupts.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
569 * @param __HANDLE__: DMA handle
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
570 * @param __INTERRUPT__: specifies the DMA interrupt sources to be enabled or disabled.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
571 * This parameter can be any combination of the following values:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
572 * @arg DMA_IT_TC: Transfer complete interrupt mask.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
573 * @arg DMA_IT_HT: Half transfer complete interrupt mask.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
574 * @arg DMA_IT_TE: Transfer error interrupt mask.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
575 * @arg DMA_IT_FE: FIFO error interrupt mask.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
576 * @arg DMA_IT_DME: Direct mode error interrupt.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
577 * @retval None
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
578 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
579 #define __HAL_DMA_DISABLE_IT(__HANDLE__, __INTERRUPT__) (((__INTERRUPT__) != DMA_IT_FE)? \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
580 ((__HANDLE__)->Instance->CR &= ~(__INTERRUPT__)) : ((__HANDLE__)->Instance->FCR &= ~(__INTERRUPT__)))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
581
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
582 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
583 * @brief Check whether the specified DMA Stream interrupt has occurred or not.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
584 * @param __HANDLE__: DMA handle
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
585 * @param __INTERRUPT__: specifies the DMA interrupt source to check.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
586 * This parameter can be one of the following values:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
587 * @arg DMA_IT_TC: Transfer complete interrupt mask.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
588 * @arg DMA_IT_HT: Half transfer complete interrupt mask.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
589 * @arg DMA_IT_TE: Transfer error interrupt mask.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
590 * @arg DMA_IT_FE: FIFO error interrupt mask.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
591 * @arg DMA_IT_DME: Direct mode error interrupt.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
592 * @retval The state of DMA_IT.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
593 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
594 #define __HAL_DMA_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((__INTERRUPT__) != DMA_IT_FE)? \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
595 ((__HANDLE__)->Instance->CR & (__INTERRUPT__)) : \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
596 ((__HANDLE__)->Instance->FCR & (__INTERRUPT__)))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
597
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
598 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
599 * @brief Writes the number of data units to be transferred on the DMA Stream.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
600 * @param __HANDLE__: DMA handle
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
601 * @param __COUNTER__: Number of data units to be transferred (from 0 to 65535)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
602 * Number of data items depends only on the Peripheral data format.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
603 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
604 * @note If Peripheral data format is Bytes: number of data units is equal
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
605 * to total number of bytes to be transferred.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
606 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
607 * @note If Peripheral data format is Half-Word: number of data units is
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
608 * equal to total number of bytes to be transferred / 2.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
609 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
610 * @note If Peripheral data format is Word: number of data units is equal
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
611 * to total number of bytes to be transferred / 4.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
612 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
613 * @retval The number of remaining data units in the current DMAy Streamx transfer.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
614 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
615 #define __HAL_DMA_SET_COUNTER(__HANDLE__, __COUNTER__) ((__HANDLE__)->Instance->NDTR = (uint16_t)(__COUNTER__))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
616
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
617 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
618 * @brief Returns the number of remaining data units in the current DMAy Streamx transfer.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
619 * @param __HANDLE__: DMA handle
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
620 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
621 * @retval The number of remaining data units in the current DMA Stream transfer.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
622 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
623 #define __HAL_DMA_GET_COUNTER(__HANDLE__) ((__HANDLE__)->Instance->NDTR)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
624
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
625
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
626 /* Include DMA HAL Extension module */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
627 #include "stm32f4xx_hal_dma_ex.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
628
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
629 /* Exported functions --------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
630
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
631 /** @defgroup DMA_Exported_Functions DMA Exported Functions
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
632 * @brief DMA Exported functions
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
633 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
634 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
635
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
636 /** @defgroup DMA_Exported_Functions_Group1 Initialization and de-initialization functions
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
637 * @brief Initialization and de-initialization functions
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
638 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
639 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
640 HAL_StatusTypeDef HAL_DMA_Init(DMA_HandleTypeDef *hdma);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
641 HAL_StatusTypeDef HAL_DMA_DeInit(DMA_HandleTypeDef *hdma);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
642 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
643 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
644 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
645
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
646 /** @defgroup DMA_Exported_Functions_Group2 I/O operation functions
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
647 * @brief I/O operation functions
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
648 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
649 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
650 HAL_StatusTypeDef HAL_DMA_Start (DMA_HandleTypeDef *hdma, uint32_t SrcAddress, uint32_t DstAddress, uint32_t DataLength);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
651 HAL_StatusTypeDef HAL_DMA_Start_IT(DMA_HandleTypeDef *hdma, uint32_t SrcAddress, uint32_t DstAddress, uint32_t DataLength);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
652 HAL_StatusTypeDef HAL_DMA_Abort(DMA_HandleTypeDef *hdma);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
653 HAL_StatusTypeDef HAL_DMA_PollForTransfer(DMA_HandleTypeDef *hdma, uint32_t CompleteLevel, uint32_t Timeout);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
654 void HAL_DMA_IRQHandler(DMA_HandleTypeDef *hdma);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
655 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
656 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
657 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
658
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
659 /** @defgroup DMA_Exported_Functions_Group3 Peripheral State functions
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
660 * @brief Peripheral State functions
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
661 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
662 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
663 HAL_DMA_StateTypeDef HAL_DMA_GetState(DMA_HandleTypeDef *hdma);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
664 uint32_t HAL_DMA_GetError(DMA_HandleTypeDef *hdma);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
665 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
666 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
667 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
668 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
669 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
670 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
671 /* Private Constants -------------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
672 /** @defgroup DMA_Private_Constants DMA Private Constants
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
673 * @brief DMA private defines and constants
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
674 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
675 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
676 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
677 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
678 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
679
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
680 /* Private macros ------------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
681 /** @defgroup DMA_Private_Macros DMA Private Macros
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
682 * @brief DMA private macros
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
683 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
684 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
685 #define IS_DMA_CHANNEL(CHANNEL) (((CHANNEL) == DMA_CHANNEL_0) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
686 ((CHANNEL) == DMA_CHANNEL_1) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
687 ((CHANNEL) == DMA_CHANNEL_2) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
688 ((CHANNEL) == DMA_CHANNEL_3) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
689 ((CHANNEL) == DMA_CHANNEL_4) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
690 ((CHANNEL) == DMA_CHANNEL_5) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
691 ((CHANNEL) == DMA_CHANNEL_6) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
692 ((CHANNEL) == DMA_CHANNEL_7))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
693
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
694 #define IS_DMA_DIRECTION(DIRECTION) (((DIRECTION) == DMA_PERIPH_TO_MEMORY ) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
695 ((DIRECTION) == DMA_MEMORY_TO_PERIPH) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
696 ((DIRECTION) == DMA_MEMORY_TO_MEMORY))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
697
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
698 #define IS_DMA_BUFFER_SIZE(SIZE) (((SIZE) >= 0x1) && ((SIZE) < 0x10000))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
699
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
700 #define IS_DMA_PERIPHERAL_INC_STATE(STATE) (((STATE) == DMA_PINC_ENABLE) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
701 ((STATE) == DMA_PINC_DISABLE))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
702
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
703 #define IS_DMA_MEMORY_INC_STATE(STATE) (((STATE) == DMA_MINC_ENABLE) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
704 ((STATE) == DMA_MINC_DISABLE))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
705
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
706 #define IS_DMA_PERIPHERAL_DATA_SIZE(SIZE) (((SIZE) == DMA_PDATAALIGN_BYTE) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
707 ((SIZE) == DMA_PDATAALIGN_HALFWORD) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
708 ((SIZE) == DMA_PDATAALIGN_WORD))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
709
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
710 #define IS_DMA_MEMORY_DATA_SIZE(SIZE) (((SIZE) == DMA_MDATAALIGN_BYTE) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
711 ((SIZE) == DMA_MDATAALIGN_HALFWORD) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
712 ((SIZE) == DMA_MDATAALIGN_WORD ))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
713
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
714 #define IS_DMA_MODE(MODE) (((MODE) == DMA_NORMAL ) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
715 ((MODE) == DMA_CIRCULAR) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
716 ((MODE) == DMA_PFCTRL))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
717
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
718 #define IS_DMA_PRIORITY(PRIORITY) (((PRIORITY) == DMA_PRIORITY_LOW ) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
719 ((PRIORITY) == DMA_PRIORITY_MEDIUM) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
720 ((PRIORITY) == DMA_PRIORITY_HIGH) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
721 ((PRIORITY) == DMA_PRIORITY_VERY_HIGH))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
722
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
723 #define IS_DMA_FIFO_MODE_STATE(STATE) (((STATE) == DMA_FIFOMODE_DISABLE ) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
724 ((STATE) == DMA_FIFOMODE_ENABLE))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
725
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
726 #define IS_DMA_FIFO_THRESHOLD(THRESHOLD) (((THRESHOLD) == DMA_FIFO_THRESHOLD_1QUARTERFULL ) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
727 ((THRESHOLD) == DMA_FIFO_THRESHOLD_HALFFULL) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
728 ((THRESHOLD) == DMA_FIFO_THRESHOLD_3QUARTERSFULL) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
729 ((THRESHOLD) == DMA_FIFO_THRESHOLD_FULL))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
730
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
731 #define IS_DMA_MEMORY_BURST(BURST) (((BURST) == DMA_MBURST_SINGLE) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
732 ((BURST) == DMA_MBURST_INC4) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
733 ((BURST) == DMA_MBURST_INC8) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
734 ((BURST) == DMA_MBURST_INC16))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
735
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
736 #define IS_DMA_PERIPHERAL_BURST(BURST) (((BURST) == DMA_PBURST_SINGLE) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
737 ((BURST) == DMA_PBURST_INC4) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
738 ((BURST) == DMA_PBURST_INC8) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
739 ((BURST) == DMA_PBURST_INC16))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
740 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
741 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
742 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
743
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
744 /* Private functions ---------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
745 /** @defgroup DMA_Private_Functions DMA Private Functions
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
746 * @brief DMA private functions
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
747 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
748 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
749 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
750 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
751 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
752
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
753 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
754 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
755 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
756
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
757 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
758 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
759 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
760
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
761 #ifdef __cplusplus
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
762 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
763 #endif
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
764
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
765 #endif /* __STM32F4xx_HAL_DMA_H */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
766
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
767 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/