Welcome to mirror list, hosted at ThFree Co, Russian Federation.

stm32wbxx_hal_dma_ex.h « Inc « STM32WBxx_HAL_Driver « Drivers - github.com/Flipper-Zero/STM32CubeWB.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 5c9321e16b84851b4a715d072f25a00b1b386ab7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
/**
  ******************************************************************************
  * @file    stm32wbxx_hal_dma_ex.h
  * @author  MCD Application Team
  * @brief   Header file of DMA HAL extension module.
  ******************************************************************************
  * @attention
  *
  * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics. 
  * All rights reserved.</center></h2>
  *
  * This software component is licensed by ST under BSD 3-Clause license,
  * the "License"; You may not use this file except in compliance with the 
  * License. You may obtain a copy of the License at:
  *                        opensource.org/licenses/BSD-3-Clause
  *
  ******************************************************************************
  */

/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef STM32WBxx_HAL_DMA_EX_H
#define STM32WBxx_HAL_DMA_EX_H

#ifdef __cplusplus
extern "C" {
#endif

/* Includes ------------------------------------------------------------------*/
#include "stm32wbxx_hal_def.h"
#include "stm32wbxx_ll_dmamux.h"

/** @addtogroup STM32WBxx_HAL_Driver
  * @{
  */

/** @addtogroup DMAEx
  * @{
  */

/* Exported types ------------------------------------------------------------*/
/** @defgroup DMAEx_Exported_Types DMAEx Exported Types
  * @{
  */

/**
  * @brief  HAL DMA Synchro definition
  */


/**
  * @brief  HAL DMAMUX Synchronization configuration structure definition
  */
typedef struct
{
  uint32_t SyncSignalID;        /*!< Specifies the synchronization signal gating the DMA request in periodic mode.
                                     This parameter can be a value of @ref DMAEx_DMAMUX_SyncSignalID_selection */

  uint32_t SyncPolarity;        /*!< Specifies the polarity of the signal on which the DMA request is synchronized.
                                     This parameter can be a value of @ref DMAEx_DMAMUX_SyncPolarity_selection */

  FunctionalState SyncEnable;   /*!< Specifies if the synchronization shall be enabled or disabled
                                     This parameter can take the value ENABLE or DISABLE*/

  FunctionalState EventEnable;  /*!< Specifies if an event shall be generated once the RequestNumber is reached.
                                     This parameter can take the value ENABLE or DISABLE */

  uint32_t RequestNumber;       /*!< Specifies the number of DMA request that will be authorized after a sync event
                                     This parameter must be a number between Min_Data = 1 and Max_Data = 32 */


} HAL_DMA_MuxSyncConfigTypeDef;


/**
  * @brief  HAL DMAMUX request generator parameters structure definition
  */
typedef struct
{
  uint32_t SignalID;             /*!< Specifies the ID of the signal used for DMAMUX request generator
                                     This parameter can be a value of @ref DMAEx_DMAMUX_SignalGeneratorID_selection */

  uint32_t Polarity;            /*!< Specifies the polarity of the signal on which the request is generated.
                                     This parameter can be a value of @ref DMAEx_DMAMUX_RequestGeneneratorPolarity_selection */

  uint32_t RequestNumber;       /*!< Specifies the number of DMA request that will be generated after a signal event
                                     This parameter must be a number between Min_Data = 1 and Max_Data = 32 */

} HAL_DMA_MuxRequestGeneratorConfigTypeDef;

/**
  * @}
  */

/* Exported constants --------------------------------------------------------*/
/** @defgroup DMAEx_Exported_Constants DMAEx Exported Constants
  * @{
  */

/** @defgroup DMAEx_DMAMUX_SyncSignalID_selection DMAMUX SyncSignalID selection
  * @{
  */
#define HAL_DMAMUX1_SYNC_EXTI0                  LL_DMAMUX_SYNC_EXTI_LINE0       /*!<  Synchronization Signal is EXTI0  IT   */
#define HAL_DMAMUX1_SYNC_EXTI1                  LL_DMAMUX_SYNC_EXTI_LINE1       /*!<  Synchronization Signal is EXTI1  IT   */
#define HAL_DMAMUX1_SYNC_EXTI2                  LL_DMAMUX_SYNC_EXTI_LINE2       /*!<  Synchronization Signal is EXTI2  IT   */
#define HAL_DMAMUX1_SYNC_EXTI3                  LL_DMAMUX_SYNC_EXTI_LINE3       /*!<  Synchronization Signal is EXTI3  IT   */
#define HAL_DMAMUX1_SYNC_EXTI4                  LL_DMAMUX_SYNC_EXTI_LINE4       /*!<  Synchronization Signal is EXTI4  IT   */
#define HAL_DMAMUX1_SYNC_EXTI5                  LL_DMAMUX_SYNC_EXTI_LINE5       /*!<  Synchronization Signal is EXTI5  IT   */
#define HAL_DMAMUX1_SYNC_EXTI6                  LL_DMAMUX_SYNC_EXTI_LINE6       /*!<  Synchronization Signal is EXTI6  IT   */
#define HAL_DMAMUX1_SYNC_EXTI7                  LL_DMAMUX_SYNC_EXTI_LINE7       /*!<  Synchronization Signal is EXTI7  IT   */
#define HAL_DMAMUX1_SYNC_EXTI8                  LL_DMAMUX_SYNC_EXTI_LINE8       /*!<  Synchronization Signal is EXTI8  IT   */
#define HAL_DMAMUX1_SYNC_EXTI9                  LL_DMAMUX_SYNC_EXTI_LINE9       /*!<  Synchronization Signal is EXTI9  IT   */
#define HAL_DMAMUX1_SYNC_EXTI10                 LL_DMAMUX_SYNC_EXTI_LINE10      /*!<  Synchronization Signal is EXTI10 IT   */
#define HAL_DMAMUX1_SYNC_EXTI11                 LL_DMAMUX_SYNC_EXTI_LINE11      /*!<  Synchronization Signal is EXTI11 IT   */
#define HAL_DMAMUX1_SYNC_EXTI12                 LL_DMAMUX_SYNC_EXTI_LINE12      /*!<  Synchronization Signal is EXTI12 IT   */
#define HAL_DMAMUX1_SYNC_EXTI13                 LL_DMAMUX_SYNC_EXTI_LINE13      /*!<  Synchronization Signal is EXTI13 IT   */
#define HAL_DMAMUX1_SYNC_EXTI14                 LL_DMAMUX_SYNC_EXTI_LINE14      /*!<  Synchronization Signal is EXTI14 IT   */
#define HAL_DMAMUX1_SYNC_EXTI15                 LL_DMAMUX_SYNC_EXTI_LINE15      /*!<  Synchronization Signal is EXTI15 IT   */
#define HAL_DMAMUX1_SYNC_DMAMUX1_CH0_EVT        LL_DMAMUX_SYNC_DMAMUX_CH0       /*!<  Synchronization Signal is DMAMUX1 Channel0 Event  */
#define HAL_DMAMUX1_SYNC_DMAMUX1_CH1_EVT        LL_DMAMUX_SYNC_DMAMUX_CH1       /*!<  Synchronization Signal is DMAMUX1 Channel1 Event  */
#define HAL_DMAMUX1_SYNC_LPTIM1_OUT             LL_DMAMUX_SYNC_LPTIM1_OUT       /*!<  Synchronization Signal is LPTIM1 OUT */
#define HAL_DMAMUX1_SYNC_LPTIM2_OUT             LL_DMAMUX_SYNC_LPTIM2_OUT       /*!<  Synchronization Signal is LPTIM2 OUT */

/**
  * @}
  */

/** @defgroup DMAEx_DMAMUX_SyncPolarity_selection DMAMUX SyncPolarity selection
  * @{
  */
#define HAL_DMAMUX_SYNC_NO_EVENT                LL_DMAMUX_SYNC_NO_EVENT            /*!< block synchronization events                    */
#define HAL_DMAMUX_SYNC_RISING                  LL_DMAMUX_SYNC_POL_RISING          /*!< synchronize with rising edge events             */
#define HAL_DMAMUX_SYNC_FALLING                 LL_DMAMUX_SYNC_POL_FALLING         /*!< synchronize with falling edge events            */
#define HAL_DMAMUX_SYNC_RISING_FALLING          LL_DMAMUX_SYNC_POL_RISING_FALLING  /*!< synchronize with rising and falling edge events */

/**
  * @}
  */

/** @defgroup DMAEx_DMAMUX_SignalGeneratorID_selection DMAMUX SignalGeneratorID selection
  * @{
  */
#define HAL_DMAMUX1_REQ_GEN_EXTI0               LL_DMAMUX_REQ_GEN_EXTI_LINE0    /*!< Request generator Signal is EXTI0 IT    */
#define HAL_DMAMUX1_REQ_GEN_EXTI1               LL_DMAMUX_REQ_GEN_EXTI_LINE1    /*!< Request generator Signal is EXTI1 IT    */
#define HAL_DMAMUX1_REQ_GEN_EXTI2               LL_DMAMUX_REQ_GEN_EXTI_LINE2    /*!< Request generator Signal is EXTI2 IT    */
#define HAL_DMAMUX1_REQ_GEN_EXTI3               LL_DMAMUX_REQ_GEN_EXTI_LINE3    /*!< Request generator Signal is EXTI3 IT    */
#define HAL_DMAMUX1_REQ_GEN_EXTI4               LL_DMAMUX_REQ_GEN_EXTI_LINE4    /*!< Request generator Signal is EXTI4 IT    */
#define HAL_DMAMUX1_REQ_GEN_EXTI5               LL_DMAMUX_REQ_GEN_EXTI_LINE5    /*!< Request generator Signal is EXTI5 IT    */
#define HAL_DMAMUX1_REQ_GEN_EXTI6               LL_DMAMUX_REQ_GEN_EXTI_LINE6    /*!< Request generator Signal is EXTI6 IT    */
#define HAL_DMAMUX1_REQ_GEN_EXTI7               LL_DMAMUX_REQ_GEN_EXTI_LINE7    /*!< Request generator Signal is EXTI7 IT    */
#define HAL_DMAMUX1_REQ_GEN_EXTI8               LL_DMAMUX_REQ_GEN_EXTI_LINE8    /*!< Request generator Signal is EXTI8 IT    */
#define HAL_DMAMUX1_REQ_GEN_EXTI9               LL_DMAMUX_REQ_GEN_EXTI_LINE9    /*!< Request generator Signal is EXTI9 IT    */
#define HAL_DMAMUX1_REQ_GEN_EXTI10              LL_DMAMUX_REQ_GEN_EXTI_LINE10   /*!< Request generator Signal is EXTI10 IT   */
#define HAL_DMAMUX1_REQ_GEN_EXTI11              LL_DMAMUX_REQ_GEN_EXTI_LINE11   /*!< Request generator Signal is EXTI11 IT   */
#define HAL_DMAMUX1_REQ_GEN_EXTI12              LL_DMAMUX_REQ_GEN_EXTI_LINE12   /*!< Request generator Signal is EXTI12 IT   */
#define HAL_DMAMUX1_REQ_GEN_EXTI13              LL_DMAMUX_REQ_GEN_EXTI_LINE13   /*!< Request generator Signal is EXTI13 IT   */
#define HAL_DMAMUX1_REQ_GEN_EXTI14              LL_DMAMUX_REQ_GEN_EXTI_LINE14   /*!< Request generator Signal is EXTI14 IT   */
#define HAL_DMAMUX1_REQ_GEN_EXTI15              LL_DMAMUX_REQ_GEN_EXTI_LINE15   /*!< Request generator Signal is EXTI15 IT   */
#define HAL_DMAMUX1_REQ_GEN_DMAMUX1_CH0_EVT     LL_DMAMUX_REQ_GEN_DMAMUX_CH0    /*!< Request generator Signal is DMAMUX1 Channel0 Event */
#define HAL_DMAMUX1_REQ_GEN_DMAMUX1_CH1_EVT     LL_DMAMUX_REQ_GEN_DMAMUX_CH1    /*!< Request generator Signal is DMAMUX1 Channel1 Event */
#define HAL_DMAMUX1_REQ_GEN_LPTIM1_OUT          LL_DMAMUX_REQ_GEN_LPTIM1_OUT    /*!< Request generator Signal is LPTIM1 OUT  */
#define HAL_DMAMUX1_REQ_GEN_LPTIM2_OUT          LL_DMAMUX_REQ_GEN_LPTIM2_OUT    /*!< Request generator Signal is LPTIM2 OUT  */

/**
  * @}
  */

/** @defgroup DMAEx_DMAMUX_RequestGeneneratorPolarity_selection DMAMUX RequestGeneneratorPolarity selection
  * @{
  */
#define HAL_DMAMUX_REQ_GEN_NO_EVENT             LL_DMAMUX_REQ_GEN_NO_EVENT              /*!< block request generator events                     */
#define HAL_DMAMUX_REQ_GEN_RISING               LL_DMAMUX_REQ_GEN_POL_RISING            /*!< generate request on rising edge events             */
#define HAL_DMAMUX_REQ_GEN_FALLING              LL_DMAMUX_REQ_GEN_POL_FALLING           /*!< generate request on falling edge events            */
#define HAL_DMAMUX_REQ_GEN_RISING_FALLING       LL_DMAMUX_REQ_GEN_POL_RISING_FALLING    /*!< generate request on rising and falling edge events */

/**
  * @}
  */

/**
  * @}
  */

/* Exported macro ------------------------------------------------------------*/

/* Exported functions --------------------------------------------------------*/
/** @addtogroup DMAEx_Exported_Functions
  * @{
  */

/* IO operation functions *****************************************************/
/** @addtogroup DMAEx_Exported_Functions_Group1
  * @{
  */

/* ------------------------- REQUEST -----------------------------------------*/
HAL_StatusTypeDef HAL_DMAEx_ConfigMuxRequestGenerator(DMA_HandleTypeDef *hdma,
                                                      HAL_DMA_MuxRequestGeneratorConfigTypeDef *pRequestGeneratorConfig);
HAL_StatusTypeDef HAL_DMAEx_EnableMuxRequestGenerator(DMA_HandleTypeDef *hdma);
HAL_StatusTypeDef HAL_DMAEx_DisableMuxRequestGenerator(DMA_HandleTypeDef *hdma);
/* -------------------------------------------------------------------------- */

/* ------------------------- SYNCHRO -----------------------------------------*/
HAL_StatusTypeDef HAL_DMAEx_ConfigMuxSync(DMA_HandleTypeDef *hdma, HAL_DMA_MuxSyncConfigTypeDef *pSyncConfig);
/* -------------------------------------------------------------------------- */

void HAL_DMAEx_MUX_IRQHandler(DMA_HandleTypeDef *hdma);

/**
  * @}
  */

/**
  * @}
  */


/* Private macros ------------------------------------------------------------*/
/** @defgroup DMAEx_Private_Macros DMAEx Private Macros
  * @brief    DMAEx private macros
  * @{
  */

#define IS_DMAMUX_SYNC_SIGNAL_ID(SIGNAL_ID)                     ((SIGNAL_ID) <= HAL_DMAMUX1_SYNC_LPTIM2_OUT)

#define IS_DMAMUX_SYNC_REQUEST_NUMBER(REQUEST_NUMBER)           (((REQUEST_NUMBER) > 0U) && ((REQUEST_NUMBER) <= 32U))

#define IS_DMAMUX_SYNC_POLARITY(POLARITY)                       (((POLARITY) == HAL_DMAMUX_SYNC_NO_EVENT)     || \
                                                                 ((POLARITY) == HAL_DMAMUX_SYNC_RISING)       || \
                                                                 ((POLARITY) == HAL_DMAMUX_SYNC_FALLING)      || \
                                                                 ((POLARITY) == HAL_DMAMUX_SYNC_RISING_FALLING))

#define IS_DMAMUX_SYNC_STATE(SYNC)                              (((SYNC) == DISABLE)   || ((SYNC) == ENABLE))

#define IS_DMAMUX_SYNC_EVENT(EVENT)                             (((EVENT) == DISABLE)   || \
                                                                 ((EVENT) == ENABLE))

#define IS_DMAMUX_REQUEST_GEN_SIGNAL_ID(SIGNAL_ID)              ((SIGNAL_ID) <= HAL_DMAMUX1_REQ_GEN_LPTIM2_OUT)

#define IS_DMAMUX_REQUEST_GEN_REQUEST_NUMBER(REQUEST_NUMBER)    (((REQUEST_NUMBER) > 0U) && ((REQUEST_NUMBER) <= 32U))

#define IS_DMAMUX_REQUEST_GEN_POLARITY(POLARITY)                (((POLARITY) == HAL_DMAMUX_REQ_GEN_NO_EVENT)    || \
                                                                 ((POLARITY) == HAL_DMAMUX_REQ_GEN_RISING)      || \
                                                                 ((POLARITY) == HAL_DMAMUX_REQ_GEN_FALLING)     || \
                                                                 ((POLARITY) == HAL_DMAMUX_REQ_GEN_RISING_FALLING))

/**
  * @}
  */


/**
  * @}
  */

/**
  * @}
  */

#ifdef __cplusplus
}
#endif

#endif /* STM32WBxx_HAL_DMA_EX_H */

/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/