1 /**
2   ******************************************************************************
3   * @file    stm32c0xx_ll_dmamux.h
4   * @author  MCD Application Team
5   * @brief   Header file of DMAMUX LL module.
6   ******************************************************************************
7   * @attention
8   *
9   * Copyright (c) 2022 STMicroelectronics.
10   * All rights reserved.
11   *
12   * This software is licensed under terms that can be found in the LICENSE file
13   * in the root directory of this software component.
14   * If no LICENSE file comes with this software, it is provided AS-IS.
15   *
16   ******************************************************************************
17   */
18 
19 /* Define to prevent recursive inclusion -------------------------------------*/
20 #ifndef STM32C0xx_LL_DMAMUX_H
21 #define STM32C0xx_LL_DMAMUX_H
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 /* Includes ------------------------------------------------------------------*/
28 #include "stm32c0xx.h"
29 
30 /** @addtogroup STM32C0xx_LL_Driver
31   * @{
32   */
33 
34 #if defined (DMAMUX1)
35 
36 /** @defgroup DMAMUX_LL DMAMUX
37   * @{
38   */
39 
40 /* Private types -------------------------------------------------------------*/
41 /* Private variables ---------------------------------------------------------*/
42 /* Private constants ---------------------------------------------------------*/
43 /** @defgroup DMAMUX_LL_Private_Constants DMAMUX Private Constants
44   * @{
45   */
46 /* Define used to get DMAMUX CCR register size */
47 #define DMAMUX_CCR_SIZE                   0x00000004UL
48 
49 /* Define used to get DMAMUX RGCR register size */
50 #define DMAMUX_RGCR_SIZE                  0x00000004UL
51 /**
52   * @}
53   */
54 
55 /* Private macros ------------------------------------------------------------*/
56 /* Exported types ------------------------------------------------------------*/
57 /* Exported constants --------------------------------------------------------*/
58 /** @defgroup DMAMUX_LL_Exported_Constants DMAMUX Exported Constants
59   * @{
60   */
61 /** @defgroup DMAMUX_LL_EC_CLEAR_FLAG Clear Flags Defines
62   * @brief    Flags defines which can be used with LL_DMAMUX_WriteReg function
63   * @{
64   */
65 #define LL_DMAMUX_CFR_CSOF0               DMAMUX_CFR_CSOF0       /*!< Synchronization Event Overrun Flag Channel 0  */
66 #define LL_DMAMUX_CFR_CSOF1               DMAMUX_CFR_CSOF1       /*!< Synchronization Event Overrun Flag Channel 1  */
67 #define LL_DMAMUX_CFR_CSOF2               DMAMUX_CFR_CSOF2       /*!< Synchronization Event Overrun Flag Channel 2  */
68 
69 #define LL_DMAMUX_RGCFR_RGCOF0            DMAMUX_RGCFR_COF0      /*!< Request Generator 0 Trigger Event Overrun Flag */
70 #define LL_DMAMUX_RGCFR_RGCOF1            DMAMUX_RGCFR_COF1      /*!< Request Generator 1 Trigger Event Overrun Flag */
71 #define LL_DMAMUX_RGCFR_RGCOF2            DMAMUX_RGCFR_COF2      /*!< Request Generator 2 Trigger Event Overrun Flag */
72 
73 /**
74   * @}
75   */
76 
77 /** @defgroup DMAMUX_LL_EC_GET_FLAG Get Flags Defines
78   * @brief    Flags defines which can be used with LL_DMAMUX_ReadReg function
79   * @{
80   */
81 #define LL_DMAMUX_CSR_SOF0                DMAMUX_CSR_SOF0       /*!< Synchronization Event Overrun Flag Channel 0  */
82 #define LL_DMAMUX_CSR_SOF1                DMAMUX_CSR_SOF1       /*!< Synchronization Event Overrun Flag Channel 1  */
83 #define LL_DMAMUX_CSR_SOF2                DMAMUX_CSR_SOF2       /*!< Synchronization Event Overrun Flag Channel 2  */
84 
85 #define LL_DMAMUX_RGSR_RGOF0              DMAMUX_RGSR_OF0       /*!< Request Generator 0 Trigger Event Overrun Flag */
86 #define LL_DMAMUX_RGSR_RGOF1              DMAMUX_RGSR_OF1       /*!< Request Generator 1 Trigger Event Overrun Flag */
87 #define LL_DMAMUX_RGSR_RGOF2              DMAMUX_RGSR_OF2       /*!< Request Generator 2 Trigger Event Overrun Flag */
88 /**
89   * @}
90   */
91 
92 /** @defgroup DMAMUX_LL_EC_IT IT Defines
93   * @brief    IT defines which can be used with LL_DMA_ReadReg and  LL_DMAMUX_WriteReg functions
94   * @{
95   */
96 #define LL_DMAMUX_CCR_SOIE                DMAMUX_CxCR_SOIE     /*!< Synchronization Event Overrun Interrupt */
97 #define LL_DMAMUX_RGCR_RGOIE              DMAMUX_RGxCR_OIE     /*!< Request Generation Trigger Event Overrun Interrupt*/
98 /**
99   * @}
100   */
101 
102 /** @defgroup DMAMUX_LL_EC_REQUEST Transfer request
103   * @{
104   */
105 #define LL_DMAMUX_REQ_MEM2MEM             0x00000000U  /*!< memory to memory transfer  */
106 #define LL_DMAMUX_REQ_GENERATOR0          0x00000001U  /*!< DMAMUX request generator 0 */
107 #define LL_DMAMUX_REQ_GENERATOR1          0x00000002U  /*!< DMAMUX request generator 1 */
108 #define LL_DMAMUX_REQ_GENERATOR2          0x00000003U  /*!< DMAMUX request generator 2 */
109 #define LL_DMAMUX_REQ_GENERATOR3          0x00000004U  /*!< DMAMUX request generator 3 */
110 #define LL_DMAMUX_REQ_ADC1                0x00000005U  /*!< DMAMUX ADC1 request        */
111 #define LL_DMAMUX_REQ_I2C1_RX             0x0000000AU  /*!< DMAMUX I2C1 RX request     */
112 #define LL_DMAMUX_REQ_I2C1_TX             0x0000000BU  /*!< DMAMUX I2C1 TX request     */
113 #define LL_DMAMUX_REQ_SPI1_RX             0x00000010U  /*!< DMAMUX SPI1 RX request     */
114 #define LL_DMAMUX_REQ_SPI1_TX             0x00000011U  /*!< DMAMUX SPI1 TX request     */
115 #define LL_DMAMUX_REQ_TIM1_CH1            0x00000014U  /*!< DMAMUX TIM1 CH1 request    */
116 #define LL_DMAMUX_REQ_TIM1_CH2            0x00000015U  /*!< DMAMUX TIM1 CH2 request    */
117 #define LL_DMAMUX_REQ_TIM1_CH3            0x00000016U  /*!< DMAMUX TIM1 CH3 request    */
118 #define LL_DMAMUX_REQ_TIM1_CH4            0x00000017U  /*!< DMAMUX TIM1 CH4 request    */
119 #define LL_DMAMUX_REQ_TIM1_TRIG_COM       0x00000018U  /*!< DMAMUX TIM1 TRIG COM request */
120 #define LL_DMAMUX_REQ_TIM1_UP             0x00000019U  /*!< DMAMUX TIM1 UP request     */
121 #define LL_DMAMUX_REQ_TIM3_CH1            0x00000020U  /*!< DMAMUX TIM3 CH1 request    */
122 #define LL_DMAMUX_REQ_TIM3_CH2            0x00000021U  /*!< DMAMUX TIM3 CH2 request    */
123 #define LL_DMAMUX_REQ_TIM3_CH3            0x00000022U  /*!< DMAMUX TIM3 CH3 request    */
124 #define LL_DMAMUX_REQ_TIM3_CH4            0x00000023U  /*!< DMAMUX TIM3 CH4 request    */
125 #define LL_DMAMUX_REQ_TIM3_TRIG           0x00000024U  /*!< DMAMUX TIM3 TRIG request   */
126 #define LL_DMAMUX_REQ_TIM3_UP             0x00000025U  /*!< DMAMUX TIM3 UP request     */
127 #define LL_DMAMUX_REQ_TIM16_CH1           0x0000002CU  /*!< DMAMUX TIM16 CH1 request   */
128 #define LL_DMAMUX_REQ_TIM16_TRIG_COM      0x0000002DU  /*!< DMAMUX TIM16 TRIG COM request */
129 #define LL_DMAMUX_REQ_TIM16_UP            0x0000002EU  /*!< DMAMUX TIM16 UP request    */
130 #define LL_DMAMUX_REQ_TIM17_CH1           0x0000002FU  /*!< DMAMUX TIM17 CH1 request    */
131 #define LL_DMAMUX_REQ_TIM17_TRIG_COM      0x00000030U  /*!< DMAMUX TIM17 TRIG COM request */
132 #define LL_DMAMUX_REQ_TIM17_UP            0x00000031U  /*!< DMAMUX TIM17 UP request    */
133 #define LL_DMAMUX_REQ_USART1_RX           0x00000032U  /*!< DMAMUX USART1 RX request  */
134 #define LL_DMAMUX_REQ_USART1_TX           0x00000033U  /*!< DMAMUX USART1 TX request  */
135 #define LL_DMAMUX_REQ_USART2_RX           0x00000034U  /*!< DMAMUX USART2 RX request  */
136 #define LL_DMAMUX_REQ_USART2_TX           0x00000035U  /*!< DMAMUX USART2 TX request  */
137 
138 /**
139   * @}
140   */
141 
142 /** @defgroup DMAMUX_LL_EC_CHANNEL DMAMUX Channel
143   * @{
144   */
145 #define LL_DMAMUX_CHANNEL_0               0x00000000U             /*!< DMAMUX Channel 0 connected to DMA1 Channel 1  */
146 #define LL_DMAMUX_CHANNEL_1               0x00000001U             /*!< DMAMUX Channel 1 connected to DMA1 Channel 2  */
147 #define LL_DMAMUX_CHANNEL_2               0x00000002U             /*!< DMAMUX Channel 2 connected to DMA1 Channel 3  */
148 /**
149   * @}
150   */
151 
152 /** @defgroup DMAMUX_LL_EC_SYNC_NO Synchronization Signal Polarity
153   * @{
154   */
155 #define LL_DMAMUX_SYNC_NO_EVENT            0x00000000U                               /*!< All requests are blocked   */
156 #define LL_DMAMUX_SYNC_POL_RISING          DMAMUX_CxCR_SPOL_0                        /*!< Synchronization on event
157                                                                                      on rising edge */
158 #define LL_DMAMUX_SYNC_POL_FALLING         DMAMUX_CxCR_SPOL_1                        /*!< Synchronization on event
159                                                                                      on falling edge */
160 #define LL_DMAMUX_SYNC_POL_RISING_FALLING  (DMAMUX_CxCR_SPOL_0 | DMAMUX_CxCR_SPOL_1) /*!< Synchronization on event on
161                                                                                      rising and falling edge */
162 /**
163   * @}
164   */
165 
166 /** @defgroup DMAMUX_LL_EC_SYNC_EVT Synchronization Signal Event
167   * @{
168   */
169 #define LL_DMAMUX_SYNC_EXTI_LINE0         0x00000000U                                                                                     /*!< Synchronization signal from EXTI Line0  */
170 #define LL_DMAMUX_SYNC_EXTI_LINE1         DMAMUX_CxCR_SYNC_ID_0                                                                           /*!< Synchronization signal from EXTI Line1  */
171 #define LL_DMAMUX_SYNC_EXTI_LINE2         DMAMUX_CxCR_SYNC_ID_1                                                                           /*!< Synchronization signal from EXTI Line2  */
172 #define LL_DMAMUX_SYNC_EXTI_LINE3         (DMAMUX_CxCR_SYNC_ID_1 | DMAMUX_CxCR_SYNC_ID_0)                                                 /*!< Synchronization signal from EXTI Line3  */
173 #define LL_DMAMUX_SYNC_EXTI_LINE4         DMAMUX_CxCR_SYNC_ID_2                                                                           /*!< Synchronization signal from EXTI Line4  */
174 #define LL_DMAMUX_SYNC_EXTI_LINE5         (DMAMUX_CxCR_SYNC_ID_2 | DMAMUX_CxCR_SYNC_ID_0)                                                 /*!< Synchronization signal from EXTI Line5  */
175 #define LL_DMAMUX_SYNC_EXTI_LINE6         (DMAMUX_CxCR_SYNC_ID_2 | DMAMUX_CxCR_SYNC_ID_1)                                                 /*!< Synchronization signal from EXTI Line6  */
176 #define LL_DMAMUX_SYNC_EXTI_LINE7         (DMAMUX_CxCR_SYNC_ID_2 | DMAMUX_CxCR_SYNC_ID_1 | DMAMUX_CxCR_SYNC_ID_0)                         /*!< Synchronization signal from EXTI Line7  */
177 #define LL_DMAMUX_SYNC_EXTI_LINE8         DMAMUX_CxCR_SYNC_ID_3                                                                           /*!< Synchronization signal from EXTI Line8  */
178 #define LL_DMAMUX_SYNC_EXTI_LINE9         (DMAMUX_CxCR_SYNC_ID_3 | DMAMUX_CxCR_SYNC_ID_0)                                                 /*!< Synchronization signal from EXTI Line9  */
179 #define LL_DMAMUX_SYNC_EXTI_LINE10        (DMAMUX_CxCR_SYNC_ID_3 | DMAMUX_CxCR_SYNC_ID_1)                                                 /*!< Synchronization signal from EXTI Line10  */
180 #define LL_DMAMUX_SYNC_EXTI_LINE11        (DMAMUX_CxCR_SYNC_ID_3 | DMAMUX_CxCR_SYNC_ID_1 | DMAMUX_CxCR_SYNC_ID_0)                         /*!< Synchronization signal from EXTI Line11  */
181 #define LL_DMAMUX_SYNC_EXTI_LINE12        (DMAMUX_CxCR_SYNC_ID_3 | DMAMUX_CxCR_SYNC_ID_2)                                                 /*!< Synchronization signal from EXTI Line12  */
182 #define LL_DMAMUX_SYNC_EXTI_LINE13        (DMAMUX_CxCR_SYNC_ID_3 | DMAMUX_CxCR_SYNC_ID_2 | DMAMUX_CxCR_SYNC_ID_0)                         /*!< Synchronization signal from EXTI Line1 3 */
183 #define LL_DMAMUX_SYNC_EXTI_LINE14        (DMAMUX_CxCR_SYNC_ID_3 | DMAMUX_CxCR_SYNC_ID_2 | DMAMUX_CxCR_SYNC_ID_1)                         /*!< Synchronization signal from EXTI Line1 4 */
184 #define LL_DMAMUX_SYNC_EXTI_LINE15        (DMAMUX_CxCR_SYNC_ID_3 | DMAMUX_CxCR_SYNC_ID_2 | DMAMUX_CxCR_SYNC_ID_1 | DMAMUX_CxCR_SYNC_ID_0) /*!< Synchronization signal from EXTI Line1 5 */
185 #define LL_DMAMUX_SYNC_DMAMUX_CH0         DMAMUX_CxCR_SYNC_ID_4                                                                           /*!< Synchronization signal from DMAMUX channel0 Event */
186 #define LL_DMAMUX_SYNC_DMAMUX_CH1         (DMAMUX_CxCR_SYNC_ID_4 | DMAMUX_CxCR_SYNC_ID_0)                                                 /*!< Synchronization signal from DMAMUX channel1 Event */
187 #define LL_DMAMUX_SYNC_DMAMUX_CH2         (DMAMUX_CxCR_SYNC_ID_4 | DMAMUX_CxCR_SYNC_ID_1)                                                 /*!< Synchronization signal from DMAMUX channel2 Event */
188 #define LL_DMAMUX_SYNC_TIM14_OC           (DMAMUX_CxCR_SYNC_ID_4 | DMAMUX_CxCR_SYNC_ID_2 | DMAMUX_CxCR_SYNC_ID_1)                         /*!< Synchronization signal from TIM14 OC */
189 /**
190   * @}
191   */
192 
193 /** @defgroup DMAMUX_LL_EC_REQUEST_GENERATOR Request Generator Channel
194   * @{
195   */
196 #define LL_DMAMUX_REQ_GEN_0               0x00000000U
197 #define LL_DMAMUX_REQ_GEN_1               0x00000001U
198 #define LL_DMAMUX_REQ_GEN_2               0x00000002U
199 #define LL_DMAMUX_REQ_GEN_3               0x00000003U
200 /**
201   * @}
202   */
203 
204 /** @defgroup DMAMUX_LL_EC_REQUEST_GEN_POLARITY External Request Signal Generation Polarity
205   * @{
206   */
207 #define LL_DMAMUX_REQ_GEN_NO_EVENT           0x00000000U                                 /*!< No external DMA request
208                                                                                          generation */
209 #define LL_DMAMUX_REQ_GEN_POL_RISING         DMAMUX_RGxCR_GPOL_0                         /*!< External DMA request
210                                                                                          generation on event on rising
211                                                                                          edge */
212 #define LL_DMAMUX_REQ_GEN_POL_FALLING        DMAMUX_RGxCR_GPOL_1                         /*!< External DMA request
213                                                                                          generation on event on falling
214                                                                                          edge */
215 #define LL_DMAMUX_REQ_GEN_POL_RISING_FALLING (DMAMUX_RGxCR_GPOL_0 | DMAMUX_RGxCR_GPOL_1) /*!< External DMA request
216                                                                                          generation on rising and
217                                                                                          falling edge */
218 /**
219   * @}
220   */
221 
222 /** @defgroup DMAMUX_LL_EC_REQUEST_GEN External Request Signal Generation
223   * @{
224   */
225 #define LL_DMAMUX_REQ_GEN_EXTI_LINE0      0x00000000U                                                                                     /*!< Request signal generation from EXTI Line0  */
226 #define LL_DMAMUX_REQ_GEN_EXTI_LINE1      DMAMUX_RGxCR_SIG_ID_0                                                                           /*!< Request signal generation from EXTI Line1  */
227 #define LL_DMAMUX_REQ_GEN_EXTI_LINE2      DMAMUX_RGxCR_SIG_ID_1                                                                           /*!< Request signal generation from EXTI Line2  */
228 #define LL_DMAMUX_REQ_GEN_EXTI_LINE3      (DMAMUX_RGxCR_SIG_ID_1 |DMAMUX_RGxCR_SIG_ID_0)                                                  /*!< Request signal generation from EXTI Line3  */
229 #define LL_DMAMUX_REQ_GEN_EXTI_LINE4      DMAMUX_RGxCR_SIG_ID_2                                                                           /*!< Request signal generation from EXTI Line4  */
230 #define LL_DMAMUX_REQ_GEN_EXTI_LINE5      (DMAMUX_RGxCR_SIG_ID_2 | DMAMUX_RGxCR_SIG_ID_0)                                                 /*!< Request signal generation from EXTI Line5  */
231 #define LL_DMAMUX_REQ_GEN_EXTI_LINE6      (DMAMUX_RGxCR_SIG_ID_2 | DMAMUX_RGxCR_SIG_ID_1)                                                 /*!< Request signal generation from EXTI Line6  */
232 #define LL_DMAMUX_REQ_GEN_EXTI_LINE7      (DMAMUX_RGxCR_SIG_ID_2 | DMAMUX_RGxCR_SIG_ID_1 | DMAMUX_RGxCR_SIG_ID_0)                         /*!< Request signal generation from EXTI Line7  */
233 #define LL_DMAMUX_REQ_GEN_EXTI_LINE8      DMAMUX_RGxCR_SIG_ID_3                                                                           /*!< Request signal generation from EXTI Line8  */
234 #define LL_DMAMUX_REQ_GEN_EXTI_LINE9      (DMAMUX_RGxCR_SIG_ID_3 | DMAMUX_RGxCR_SIG_ID_0)                                                 /*!< Request signal generation from EXTI Line9  */
235 #define LL_DMAMUX_REQ_GEN_EXTI_LINE10     (DMAMUX_RGxCR_SIG_ID_3 | DMAMUX_RGxCR_SIG_ID_1)                                                 /*!< Request signal generation from EXTI Line10 */
236 #define LL_DMAMUX_REQ_GEN_EXTI_LINE11     (DMAMUX_RGxCR_SIG_ID_3 | DMAMUX_RGxCR_SIG_ID_1 | DMAMUX_RGxCR_SIG_ID_0)                         /*!< Request signal generation from EXTI Line11 */
237 #define LL_DMAMUX_REQ_GEN_EXTI_LINE12     (DMAMUX_RGxCR_SIG_ID_3 | DMAMUX_RGxCR_SIG_ID_2)                                                 /*!< Request signal generation from EXTI Line12 */
238 #define LL_DMAMUX_REQ_GEN_EXTI_LINE13     (DMAMUX_RGxCR_SIG_ID_3 | DMAMUX_RGxCR_SIG_ID_2 | DMAMUX_RGxCR_SIG_ID_0)                         /*!< Request signal generation from EXTI Line13 */
239 #define LL_DMAMUX_REQ_GEN_EXTI_LINE14     (DMAMUX_RGxCR_SIG_ID_3 | DMAMUX_RGxCR_SIG_ID_2 | DMAMUX_RGxCR_SIG_ID_1)                         /*!< Request signal generation from EXTI Line14 */
240 #define LL_DMAMUX_REQ_GEN_EXTI_LINE15     (DMAMUX_RGxCR_SIG_ID_3 | DMAMUX_RGxCR_SIG_ID_2 | DMAMUX_RGxCR_SIG_ID_1 | DMAMUX_RGxCR_SIG_ID_0) /*!< Request signal generation from EXTI Line15 */
241 #define LL_DMAMUX_REQ_GEN_DMAMUX_CH0      DMAMUX_RGxCR_SIG_ID_4                                                                           /*!< Request signal generation from DMAMUX channel0 Event */
242 #define LL_DMAMUX_REQ_GEN_DMAMUX_CH1      (DMAMUX_RGxCR_SIG_ID_4 | DMAMUX_RGxCR_SIG_ID_0)                                                 /*!< Request signal generation from DMAMUX channel1 Event */
243 #define LL_DMAMUX_REQ_GEN_DMAMUX_CH2      (DMAMUX_RGxCR_SIG_ID_4 | DMAMUX_RGxCR_SIG_ID_1)                                                 /*!< Request signal generation from DMAMUX channel2 Event */
244 #define LL_DMAMUX_REQ_GEN_TIM14_OC        (DMAMUX_RGxCR_SIG_ID_4 | DMAMUX_RGxCR_SIG_ID_2 | DMAMUX_RGxCR_SIG_ID_1)                         /*!< Request signal generation from TIM14 OC */
245 /**
246   * @}
247   */
248 
249 /**
250   * @}
251   */
252 
253 /* Exported macro ------------------------------------------------------------*/
254 /** @defgroup DMAMUX_LL_Exported_Macros DMAMUX Exported Macros
255   * @{
256   */
257 
258 /** @defgroup DMAMUX_LL_EM_WRITE_READ Common Write and read registers macros
259   * @{
260   */
261 /**
262   * @brief  Write a value in DMAMUX register
263   * @param  __INSTANCE__ DMAMUX Instance
264   * @param  __REG__ Register to be written
265   * @param  __VALUE__ Value to be written in the register
266   * @retval None
267   */
268 #define LL_DMAMUX_WriteReg(__INSTANCE__, __REG__, __VALUE__) WRITE_REG(__INSTANCE__->__REG__, (__VALUE__))
269 
270 /**
271   * @brief  Read a value in DMAMUX register
272   * @param  __INSTANCE__ DMAMUX Instance
273   * @param  __REG__ Register to be read
274   * @retval Register value
275   */
276 #define LL_DMAMUX_ReadReg(__INSTANCE__, __REG__) READ_REG(__INSTANCE__->__REG__)
277 /**
278   * @}
279   */
280 
281 /**
282   * @}
283   */
284 
285 /* Exported functions --------------------------------------------------------*/
286 /** @defgroup DMAMUX_LL_Exported_Functions DMAMUX Exported Functions
287   * @{
288   */
289 
290 /** @defgroup DMAMUX_LL_EF_Configuration Configuration
291   * @{
292   */
293 /**
294   * @brief  Set DMAMUX request ID for DMAMUX Channel x.
295   * @note   DMAMUX channel 0 to 2 are mapped to DMA1 channel 1 to 3.
296   * @rmtoll CxCR         DMAREQ_ID     LL_DMAMUX_SetRequestID
297   * @param  DMAMUXx DMAMUXx Instance
298   * @param  Channel This parameter can be one of the following values:
299   *         @arg @ref LL_DMAMUX_CHANNEL_0
300   *         @arg @ref LL_DMAMUX_CHANNEL_1
301   *         @arg @ref LL_DMAMUX_CHANNEL_2
302   * @param  Request This parameter can be one of the following values:
303   *         @arg @ref LL_DMAMUX_REQ_MEM2MEM
304   *         @arg @ref LL_DMAMUX_REQ_GENERATOR0
305   *         @arg @ref LL_DMAMUX_REQ_GENERATOR1
306   *         @arg @ref LL_DMAMUX_REQ_GENERATOR2
307   *         @arg @ref LL_DMAMUX_REQ_GENERATOR3
308   *         @arg @ref LL_DMAMUX_REQ_ADC1
309   *         @arg @ref LL_DMAMUX_REQ_I2C1_RX
310   *         @arg @ref LL_DMAMUX_REQ_I2C1_TX
311   *         @arg @ref LL_DMAMUX_REQ_SPI1_RX
312   *         @arg @ref LL_DMAMUX_REQ_SPI1_TX
313   *         @arg @ref LL_DMAMUX_REQ_TIM1_CH1
314   *         @arg @ref LL_DMAMUX_REQ_TIM1_CH2
315   *         @arg @ref LL_DMAMUX_REQ_TIM1_CH3
316   *         @arg @ref LL_DMAMUX_REQ_TIM1_CH4
317   *         @arg @ref LL_DMAMUX_REQ_TIM1_TRIG_COM
318   *         @arg @ref LL_DMAMUX_REQ_TIM1_UP
319   *         @arg @ref LL_DMAMUX_REQ_TIM3_CH1
320   *         @arg @ref LL_DMAMUX_REQ_TIM3_CH2
321   *         @arg @ref LL_DMAMUX_REQ_TIM3_CH3
322   *         @arg @ref LL_DMAMUX_REQ_TIM3_CH4
323   *         @arg @ref LL_DMAMUX_REQ_TIM3_TRIG
324   *         @arg @ref LL_DMAMUX_REQ_TIM3_UP
325   *         @arg @ref LL_DMAMUX_REQ_TIM16_CH1
326   *         @arg @ref LL_DMAMUX_REQ_TIM16_TRIG_COM
327   *         @arg @ref LL_DMAMUX_REQ_TIM16_UP
328   *         @arg @ref LL_DMAMUX_REQ_TIM17_CH1
329   *         @arg @ref LL_DMAMUX_REQ_TIM17_TRIG_COM
330   *         @arg @ref LL_DMAMUX_REQ_TIM17_UP
331   *         @arg @ref LL_DMAMUX_REQ_USART1_RX
332   *         @arg @ref LL_DMAMUX_REQ_USART1_TX
333   *         @arg @ref LL_DMAMUX_REQ_USART2_RX
334   *         @arg @ref LL_DMAMUX_REQ_USART2_TX
335   * @retval None
336   */
LL_DMAMUX_SetRequestID(DMAMUX_Channel_TypeDef * DMAMUXx,uint32_t Channel,uint32_t Request)337 __STATIC_INLINE void LL_DMAMUX_SetRequestID(DMAMUX_Channel_TypeDef *DMAMUXx, uint32_t Channel, uint32_t Request)
338 {
339   (void)(DMAMUXx);
340   MODIFY_REG((DMAMUX1_Channel0 + Channel)->CCR, DMAMUX_CxCR_DMAREQ_ID, Request);
341 }
342 
343 /**
344   * @brief  Get DMAMUX request ID for DMAMUX Channel x.
345   * @note   DMAMUX channel 0 to 2 are mapped to DMA1 channel 1 to 3.
346   * @rmtoll CxCR         DMAREQ_ID     LL_DMAMUX_GetRequestID
347   * @param  DMAMUXx DMAMUXx Instance
348   * @param  Channel This parameter can be one of the following values:
349   *         @arg @ref LL_DMAMUX_CHANNEL_0
350   *         @arg @ref LL_DMAMUX_CHANNEL_1
351   *         @arg @ref LL_DMAMUX_CHANNEL_2
352   * @retval Returned value can be one of the following values:
353   *         @arg @ref LL_DMAMUX_REQ_MEM2MEM
354   *         @arg @ref LL_DMAMUX_REQ_GENERATOR0
355   *         @arg @ref LL_DMAMUX_REQ_GENERATOR1
356   *         @arg @ref LL_DMAMUX_REQ_GENERATOR2
357   *         @arg @ref LL_DMAMUX_REQ_GENERATOR3
358   *         @arg @ref LL_DMAMUX_REQ_ADC1
359   *         @arg @ref LL_DMAMUX_REQ_I2C1_RX
360   *         @arg @ref LL_DMAMUX_REQ_I2C1_TX
361   *         @arg @ref LL_DMAMUX_REQ_SPI1_RX
362   *         @arg @ref LL_DMAMUX_REQ_SPI1_TX
363   *         @arg @ref LL_DMAMUX_REQ_TIM1_CH1
364   *         @arg @ref LL_DMAMUX_REQ_TIM1_CH2
365   *         @arg @ref LL_DMAMUX_REQ_TIM1_CH3
366   *         @arg @ref LL_DMAMUX_REQ_TIM1_CH4
367   *         @arg @ref LL_DMAMUX_REQ_TIM1_TRIG_COM
368   *         @arg @ref LL_DMAMUX_REQ_TIM1_UP
369   *         @arg @ref LL_DMAMUX_REQ_TIM3_CH1
370   *         @arg @ref LL_DMAMUX_REQ_TIM3_CH2
371   *         @arg @ref LL_DMAMUX_REQ_TIM3_CH3
372   *         @arg @ref LL_DMAMUX_REQ_TIM3_CH4
373   *         @arg @ref LL_DMAMUX_REQ_TIM3_TRIG
374   *         @arg @ref LL_DMAMUX_REQ_TIM3_UP
375   *         @arg @ref LL_DMAMUX_REQ_TIM16_CH1
376   *         @arg @ref LL_DMAMUX_REQ_TIM16_TRIG_COM
377   *         @arg @ref LL_DMAMUX_REQ_TIM16_UP
378   *         @arg @ref LL_DMAMUX_REQ_TIM17_CH1
379   *         @arg @ref LL_DMAMUX_REQ_TIM17_TRIG_COM
380   *         @arg @ref LL_DMAMUX_REQ_TIM17_UP
381   *         @arg @ref LL_DMAMUX_REQ_USART1_RX
382   *         @arg @ref LL_DMAMUX_REQ_USART1_TX
383   *         @arg @ref LL_DMAMUX_REQ_USART2_RX
384   *         @arg @ref LL_DMAMUX_REQ_USART2_TX
385   */
LL_DMAMUX_GetRequestID(DMAMUX_Channel_TypeDef * DMAMUXx,uint32_t Channel)386 __STATIC_INLINE uint32_t LL_DMAMUX_GetRequestID(DMAMUX_Channel_TypeDef *DMAMUXx, uint32_t Channel)
387 {
388   (void)(DMAMUXx);
389   return (uint32_t)(READ_BIT((DMAMUX1_Channel0 + Channel)->CCR, DMAMUX_CxCR_DMAREQ_ID));
390 }
391 
392 /**
393   * @brief  Set the number of DMA request that will be autorized after a synchronization event and/or the number of DMA
394             request needed to generate an event.
395   * @rmtoll CxCR         NBREQ         LL_DMAMUX_SetSyncRequestNb
396   * @param  DMAMUXx DMAMUXx Instance
397   * @param  Channel This parameter can be one of the following values:
398   *         @arg @ref LL_DMAMUX_CHANNEL_0
399   *         @arg @ref LL_DMAMUX_CHANNEL_1
400   *         @arg @ref LL_DMAMUX_CHANNEL_2
401   * @param  RequestNb This parameter must be a value between Min_Data = 1 and Max_Data = 32.
402   * @retval None
403   */
LL_DMAMUX_SetSyncRequestNb(DMAMUX_Channel_TypeDef * DMAMUXx,uint32_t Channel,uint32_t RequestNb)404 __STATIC_INLINE void LL_DMAMUX_SetSyncRequestNb(DMAMUX_Channel_TypeDef *DMAMUXx, uint32_t Channel, uint32_t RequestNb)
405 {
406   (void)(DMAMUXx);
407   MODIFY_REG((DMAMUX1_Channel0 + Channel)->CCR, DMAMUX_CxCR_NBREQ, ((RequestNb - 1U) << DMAMUX_CxCR_NBREQ_Pos));
408 }
409 
410 /**
411   * @brief  Get the number of DMA request that will be autorized after a synchronization event and/or the number of DMA
412             request needed to generate an event.
413   * @rmtoll CxCR         NBREQ         LL_DMAMUX_GetSyncRequestNb
414   * @param  DMAMUXx DMAMUXx Instance
415   * @param  Channel This parameter can be one of the following values:
416   *         @arg @ref LL_DMAMUX_CHANNEL_0
417   *         @arg @ref LL_DMAMUX_CHANNEL_1
418   *         @arg @ref LL_DMAMUX_CHANNEL_2
419   * @retval Between Min_Data = 1 and Max_Data = 32
420   */
LL_DMAMUX_GetSyncRequestNb(DMAMUX_Channel_TypeDef * DMAMUXx,uint32_t Channel)421 __STATIC_INLINE uint32_t LL_DMAMUX_GetSyncRequestNb(DMAMUX_Channel_TypeDef *DMAMUXx, uint32_t Channel)
422 {
423   (void)(DMAMUXx);
424   return (uint32_t)(((READ_BIT((DMAMUX1_Channel0 + Channel)->CCR, DMAMUX_CxCR_NBREQ)) >> DMAMUX_CxCR_NBREQ_Pos) + 1U);
425 }
426 
427 /**
428   * @brief  Set the polarity of the signal on which the DMA request is synchronized.
429   * @rmtoll CxCR         SPOL          LL_DMAMUX_SetSyncPolarity
430   * @param  DMAMUXx DMAMUXx Instance
431   * @param  Channel This parameter can be one of the following values:
432   *         @arg @ref LL_DMAMUX_CHANNEL_0
433   *         @arg @ref LL_DMAMUX_CHANNEL_1
434   *         @arg @ref LL_DMAMUX_CHANNEL_2
435   * @param  Polarity This parameter can be one of the following values:
436   *         @arg @ref LL_DMAMUX_SYNC_NO_EVENT
437   *         @arg @ref LL_DMAMUX_SYNC_POL_RISING
438   *         @arg @ref LL_DMAMUX_SYNC_POL_FALLING
439   *         @arg @ref LL_DMAMUX_SYNC_POL_RISING_FALLING
440   * @retval None
441   */
LL_DMAMUX_SetSyncPolarity(DMAMUX_Channel_TypeDef * DMAMUXx,uint32_t Channel,uint32_t Polarity)442 __STATIC_INLINE void LL_DMAMUX_SetSyncPolarity(DMAMUX_Channel_TypeDef *DMAMUXx, uint32_t Channel, uint32_t Polarity)
443 {
444   (void)(DMAMUXx);
445   MODIFY_REG((DMAMUX1_Channel0 + Channel)->CCR, DMAMUX_CxCR_SPOL, Polarity);
446 }
447 
448 /**
449   * @brief  Get the polarity of the signal on which the DMA request is synchronized.
450   * @rmtoll CxCR         SPOL          LL_DMAMUX_GetSyncPolarity
451   * @param  DMAMUXx DMAMUXx Instance
452   * @param  Channel This parameter can be one of the following values:
453   *         @arg @ref LL_DMAMUX_CHANNEL_0
454   *         @arg @ref LL_DMAMUX_CHANNEL_1
455   *         @arg @ref LL_DMAMUX_CHANNEL_2
456   * @retval Returned value can be one of the following values:
457   *         @arg @ref LL_DMAMUX_SYNC_NO_EVENT
458   *         @arg @ref LL_DMAMUX_SYNC_POL_RISING
459   *         @arg @ref LL_DMAMUX_SYNC_POL_FALLING
460   *         @arg @ref LL_DMAMUX_SYNC_POL_RISING_FALLING
461   */
LL_DMAMUX_GetSyncPolarity(DMAMUX_Channel_TypeDef * DMAMUXx,uint32_t Channel)462 __STATIC_INLINE uint32_t LL_DMAMUX_GetSyncPolarity(DMAMUX_Channel_TypeDef *DMAMUXx, uint32_t Channel)
463 {
464   (void)(DMAMUXx);
465   return (uint32_t)(READ_BIT((DMAMUX1_Channel0 + Channel)->CCR, DMAMUX_CxCR_SPOL));
466 }
467 
468 /**
469   * @brief  Enable the Event Generation on DMAMUX channel x.
470   * @rmtoll CxCR         EGE           LL_DMAMUX_EnableEventGeneration
471   * @param  DMAMUXx DMAMUXx Instance
472   * @param  Channel This parameter can be one of the following values:
473   *         @arg @ref LL_DMAMUX_CHANNEL_0
474   *         @arg @ref LL_DMAMUX_CHANNEL_1
475   *         @arg @ref LL_DMAMUX_CHANNEL_2
476   * @retval None
477   */
LL_DMAMUX_EnableEventGeneration(DMAMUX_Channel_TypeDef * DMAMUXx,uint32_t Channel)478 __STATIC_INLINE void LL_DMAMUX_EnableEventGeneration(DMAMUX_Channel_TypeDef *DMAMUXx, uint32_t Channel)
479 {
480   (void)(DMAMUXx);
481   SET_BIT((DMAMUX1_Channel0 + Channel)->CCR, DMAMUX_CxCR_EGE);
482 }
483 
484 /**
485   * @brief  Disable the Event Generation on DMAMUX channel x.
486   * @rmtoll CxCR         EGE           LL_DMAMUX_DisableEventGeneration
487   * @param  DMAMUXx DMAMUXx Instance
488   * @param  Channel This parameter can be one of the following values:
489   *         @arg @ref LL_DMAMUX_CHANNEL_0
490   *         @arg @ref LL_DMAMUX_CHANNEL_1
491   *         @arg @ref LL_DMAMUX_CHANNEL_2
492   * @retval None
493   */
LL_DMAMUX_DisableEventGeneration(DMAMUX_Channel_TypeDef * DMAMUXx,uint32_t Channel)494 __STATIC_INLINE void LL_DMAMUX_DisableEventGeneration(DMAMUX_Channel_TypeDef *DMAMUXx, uint32_t Channel)
495 {
496   (void)(DMAMUXx);
497   CLEAR_BIT((DMAMUX1_Channel0 + Channel)->CCR, DMAMUX_CxCR_EGE);
498 }
499 
500 /**
501   * @brief  Check if the Event Generation on DMAMUX channel x is enabled or disabled.
502   * @rmtoll CxCR         EGE           LL_DMAMUX_IsEnabledEventGeneration
503   * @param  DMAMUXx DMAMUXx Instance
504   * @param  Channel This parameter can be one of the following values:
505   *         @arg @ref LL_DMAMUX_CHANNEL_0
506   *         @arg @ref LL_DMAMUX_CHANNEL_1
507   *         @arg @ref LL_DMAMUX_CHANNEL_2
508   * @retval State of bit (1 or 0).
509   */
LL_DMAMUX_IsEnabledEventGeneration(DMAMUX_Channel_TypeDef * DMAMUXx,uint32_t Channel)510 __STATIC_INLINE uint32_t LL_DMAMUX_IsEnabledEventGeneration(DMAMUX_Channel_TypeDef *DMAMUXx, uint32_t Channel)
511 {
512   (void)(DMAMUXx);
513   return ((READ_BIT((DMAMUX1_Channel0 + Channel)->CCR, DMAMUX_CxCR_EGE) == (DMAMUX_CxCR_EGE)) ? 1UL : 0UL);
514 }
515 
516 /**
517   * @brief  Enable the synchronization mode.
518   * @rmtoll CxCR         SE            LL_DMAMUX_EnableSync
519   * @param  DMAMUXx DMAMUXx Instance
520   * @param  Channel This parameter can be one of the following values:
521   *         @arg @ref LL_DMAMUX_CHANNEL_0
522   *         @arg @ref LL_DMAMUX_CHANNEL_1
523   *         @arg @ref LL_DMAMUX_CHANNEL_2
524   * @retval None
525   */
LL_DMAMUX_EnableSync(DMAMUX_Channel_TypeDef * DMAMUXx,uint32_t Channel)526 __STATIC_INLINE void LL_DMAMUX_EnableSync(DMAMUX_Channel_TypeDef *DMAMUXx, uint32_t Channel)
527 {
528   (void)(DMAMUXx);
529   SET_BIT((DMAMUX1_Channel0 + Channel)->CCR, DMAMUX_CxCR_SE);
530 }
531 
532 /**
533   * @brief  Disable the synchronization mode.
534   * @rmtoll CxCR         SE            LL_DMAMUX_DisableSync
535   * @param  DMAMUXx DMAMUXx Instance
536   * @param  Channel This parameter can be one of the following values:
537   *         @arg @ref LL_DMAMUX_CHANNEL_0
538   *         @arg @ref LL_DMAMUX_CHANNEL_1
539   *         @arg @ref LL_DMAMUX_CHANNEL_2
540   * @retval None
541   */
LL_DMAMUX_DisableSync(DMAMUX_Channel_TypeDef * DMAMUXx,uint32_t Channel)542 __STATIC_INLINE void LL_DMAMUX_DisableSync(DMAMUX_Channel_TypeDef *DMAMUXx, uint32_t Channel)
543 {
544   (void)(DMAMUXx);
545   CLEAR_BIT((DMAMUX1_Channel0 + Channel)->CCR, DMAMUX_CxCR_SE);
546 }
547 
548 /**
549   * @brief  Check if the synchronization mode is enabled or disabled.
550   * @rmtoll CxCR         SE            LL_DMAMUX_IsEnabledSync
551   * @param  DMAMUXx DMAMUXx Instance
552   * @param  Channel This parameter can be one of the following values:
553   *         @arg @ref LL_DMAMUX_CHANNEL_0
554   *         @arg @ref LL_DMAMUX_CHANNEL_1
555   *         @arg @ref LL_DMAMUX_CHANNEL_2
556   * @retval State of bit (1 or 0).
557   */
LL_DMAMUX_IsEnabledSync(DMAMUX_Channel_TypeDef * DMAMUXx,uint32_t Channel)558 __STATIC_INLINE uint32_t LL_DMAMUX_IsEnabledSync(DMAMUX_Channel_TypeDef *DMAMUXx, uint32_t Channel)
559 {
560   (void)(DMAMUXx);
561   return ((READ_BIT((DMAMUX1_Channel0 + Channel)->CCR, DMAMUX_CxCR_SE) == (DMAMUX_CxCR_SE)) ? 1UL : 0UL);
562 }
563 
564 /**
565   * @brief  Set DMAMUX synchronization ID  on DMAMUX Channel x.
566   * @rmtoll CxCR         SYNC_ID       LL_DMAMUX_SetSyncID
567   * @param  DMAMUXx DMAMUXx Instance
568   * @param  Channel This parameter can be one of the following values:
569   *         @arg @ref LL_DMAMUX_CHANNEL_0
570   *         @arg @ref LL_DMAMUX_CHANNEL_1
571   *         @arg @ref LL_DMAMUX_CHANNEL_2
572   * @param  SyncID This parameter can be one of the following values:
573   *         @arg @ref LL_DMAMUX_SYNC_EXTI_LINE0
574   *         @arg @ref LL_DMAMUX_SYNC_EXTI_LINE1
575   *         @arg @ref LL_DMAMUX_SYNC_EXTI_LINE2
576   *         @arg @ref LL_DMAMUX_SYNC_EXTI_LINE3
577   *         @arg @ref LL_DMAMUX_SYNC_EXTI_LINE4
578   *         @arg @ref LL_DMAMUX_SYNC_EXTI_LINE5
579   *         @arg @ref LL_DMAMUX_SYNC_EXTI_LINE6
580   *         @arg @ref LL_DMAMUX_SYNC_EXTI_LINE7
581   *         @arg @ref LL_DMAMUX_SYNC_EXTI_LINE8
582   *         @arg @ref LL_DMAMUX_SYNC_EXTI_LINE9
583   *         @arg @ref LL_DMAMUX_SYNC_EXTI_LINE10
584   *         @arg @ref LL_DMAMUX_SYNC_EXTI_LINE11
585   *         @arg @ref LL_DMAMUX_SYNC_EXTI_LINE12
586   *         @arg @ref LL_DMAMUX_SYNC_EXTI_LINE13
587   *         @arg @ref LL_DMAMUX_SYNC_EXTI_LINE14
588   *         @arg @ref LL_DMAMUX_SYNC_EXTI_LINE15
589   *         @arg @ref LL_DMAMUX_SYNC_DMAMUX_CH0
590   *         @arg @ref LL_DMAMUX_SYNC_DMAMUX_CH1
591   *         @arg @ref LL_DMAMUX_SYNC_DMAMUX_CH2
592   *         @arg @ref LL_DMAMUX_SYNC_TIM14_OC
593   * @retval None
594   */
LL_DMAMUX_SetSyncID(DMAMUX_Channel_TypeDef * DMAMUXx,uint32_t Channel,uint32_t SyncID)595 __STATIC_INLINE void LL_DMAMUX_SetSyncID(DMAMUX_Channel_TypeDef *DMAMUXx, uint32_t Channel, uint32_t SyncID)
596 {
597   (void)(DMAMUXx);
598   MODIFY_REG((DMAMUX1_Channel0 + Channel)->CCR, DMAMUX_CxCR_SYNC_ID, SyncID);
599 }
600 
601 /**
602   * @brief  Get DMAMUX synchronization ID  on DMAMUX Channel x.
603   * @rmtoll CxCR         SYNC_ID       LL_DMAMUX_GetSyncID
604   * @param  DMAMUXx DMAMUXx Instance
605   * @param  Channel This parameter can be one of the following values:
606   *         @arg @ref LL_DMAMUX_CHANNEL_0
607   *         @arg @ref LL_DMAMUX_CHANNEL_1
608   *         @arg @ref LL_DMAMUX_CHANNEL_2
609   * @retval Returned value can be one of the following values:
610   *         @arg @ref LL_DMAMUX_SYNC_EXTI_LINE0
611   *         @arg @ref LL_DMAMUX_SYNC_EXTI_LINE1
612   *         @arg @ref LL_DMAMUX_SYNC_EXTI_LINE2
613   *         @arg @ref LL_DMAMUX_SYNC_EXTI_LINE3
614   *         @arg @ref LL_DMAMUX_SYNC_EXTI_LINE4
615   *         @arg @ref LL_DMAMUX_SYNC_EXTI_LINE5
616   *         @arg @ref LL_DMAMUX_SYNC_EXTI_LINE6
617   *         @arg @ref LL_DMAMUX_SYNC_EXTI_LINE7
618   *         @arg @ref LL_DMAMUX_SYNC_EXTI_LINE8
619   *         @arg @ref LL_DMAMUX_SYNC_EXTI_LINE9
620   *         @arg @ref LL_DMAMUX_SYNC_EXTI_LINE10
621   *         @arg @ref LL_DMAMUX_SYNC_EXTI_LINE11
622   *         @arg @ref LL_DMAMUX_SYNC_EXTI_LINE12
623   *         @arg @ref LL_DMAMUX_SYNC_EXTI_LINE13
624   *         @arg @ref LL_DMAMUX_SYNC_EXTI_LINE14
625   *         @arg @ref LL_DMAMUX_SYNC_EXTI_LINE15
626   *         @arg @ref LL_DMAMUX_SYNC_DMAMUX_CH0
627   *         @arg @ref LL_DMAMUX_SYNC_DMAMUX_CH1
628   *         @arg @ref LL_DMAMUX_SYNC_DMAMUX_CH2
629   *         @arg @ref LL_DMAMUX_SYNC_TIM14_OC
630   */
LL_DMAMUX_GetSyncID(DMAMUX_Channel_TypeDef * DMAMUXx,uint32_t Channel)631 __STATIC_INLINE uint32_t LL_DMAMUX_GetSyncID(DMAMUX_Channel_TypeDef *DMAMUXx, uint32_t Channel)
632 {
633   (void)(DMAMUXx);
634   return (uint32_t)(READ_BIT((DMAMUX1_Channel0 + Channel)->CCR, DMAMUX_CxCR_SYNC_ID));
635 }
636 
637 /**
638   * @brief  Enable the Request Generator.
639   * @rmtoll RGxCR        GE            LL_DMAMUX_EnableRequestGen
640   * @param  DMAMUXx DMAMUXx Instance
641   * @param  RequestGenChannel This parameter can be one of the following values:
642   *         @arg @ref LL_DMAMUX_REQ_GEN_0
643   *         @arg @ref LL_DMAMUX_REQ_GEN_1
644   *         @arg @ref LL_DMAMUX_REQ_GEN_2
645   *         @arg @ref LL_DMAMUX_REQ_GEN_3
646   * @retval None
647   */
LL_DMAMUX_EnableRequestGen(DMAMUX_Channel_TypeDef * DMAMUXx,uint32_t RequestGenChannel)648 __STATIC_INLINE void LL_DMAMUX_EnableRequestGen(DMAMUX_Channel_TypeDef *DMAMUXx, uint32_t RequestGenChannel)
649 {
650   (void)(DMAMUXx);
651   SET_BIT(((DMAMUX_RequestGen_TypeDef *)((uint32_t)((uint32_t)DMAMUX1_RequestGenerator0 + (DMAMUX_RGCR_SIZE *
652                                                     (RequestGenChannel)))))->RGCR, DMAMUX_RGxCR_GE);
653 }
654 
655 /**
656   * @brief  Disable the Request Generator.
657   * @rmtoll RGxCR        GE            LL_DMAMUX_DisableRequestGen
658   * @param  DMAMUXx DMAMUXx Instance
659   * @param  RequestGenChannel This parameter can be one of the following values:
660   *         @arg @ref LL_DMAMUX_REQ_GEN_0
661   *         @arg @ref LL_DMAMUX_REQ_GEN_1
662   *         @arg @ref LL_DMAMUX_REQ_GEN_2
663   *         @arg @ref LL_DMAMUX_REQ_GEN_3
664   * @retval None
665   */
LL_DMAMUX_DisableRequestGen(DMAMUX_Channel_TypeDef * DMAMUXx,uint32_t RequestGenChannel)666 __STATIC_INLINE void LL_DMAMUX_DisableRequestGen(DMAMUX_Channel_TypeDef *DMAMUXx, uint32_t RequestGenChannel)
667 {
668   (void)(DMAMUXx);
669   CLEAR_BIT(((DMAMUX_RequestGen_TypeDef *)((uint32_t)((uint32_t)DMAMUX1_RequestGenerator0 + (DMAMUX_RGCR_SIZE *
670                                                       (RequestGenChannel)))))->RGCR, DMAMUX_RGxCR_GE);
671 }
672 
673 /**
674   * @brief  Check if the Request Generator is enabled or disabled.
675   * @rmtoll RGxCR        GE            LL_DMAMUX_IsEnabledRequestGen
676   * @param  DMAMUXx DMAMUXx Instance
677   * @param  RequestGenChannel This parameter can be one of the following values:
678   *         @arg @ref LL_DMAMUX_REQ_GEN_0
679   *         @arg @ref LL_DMAMUX_REQ_GEN_1
680   *         @arg @ref LL_DMAMUX_REQ_GEN_2
681   *         @arg @ref LL_DMAMUX_REQ_GEN_3
682   * @retval State of bit (1 or 0).
683   */
LL_DMAMUX_IsEnabledRequestGen(DMAMUX_Channel_TypeDef * DMAMUXx,uint32_t RequestGenChannel)684 __STATIC_INLINE uint32_t LL_DMAMUX_IsEnabledRequestGen(DMAMUX_Channel_TypeDef *DMAMUXx, uint32_t RequestGenChannel)
685 {
686   (void)(DMAMUXx);
687   return ((READ_BIT(((DMAMUX_RequestGen_TypeDef *)((uint32_t)((uint32_t)DMAMUX1_RequestGenerator0 + (DMAMUX_RGCR_SIZE *
688                                                               (RequestGenChannel)))))->RGCR,
689                     DMAMUX_RGxCR_GE) == (DMAMUX_RGxCR_GE)) ? 1UL : 0UL);
690 }
691 
692 /**
693   * @brief  Set the polarity of the signal on which the DMA request is generated.
694   * @rmtoll RGxCR        GPOL          LL_DMAMUX_SetRequestGenPolarity
695   * @param  DMAMUXx DMAMUXx Instance
696   * @param  RequestGenChannel This parameter can be one of the following values:
697   *         @arg @ref LL_DMAMUX_REQ_GEN_0
698   *         @arg @ref LL_DMAMUX_REQ_GEN_1
699   *         @arg @ref LL_DMAMUX_REQ_GEN_2
700   *         @arg @ref LL_DMAMUX_REQ_GEN_3
701   * @param  Polarity This parameter can be one of the following values:
702   *         @arg @ref LL_DMAMUX_REQ_GEN_NO_EVENT
703   *         @arg @ref LL_DMAMUX_REQ_GEN_POL_RISING
704   *         @arg @ref LL_DMAMUX_REQ_GEN_POL_FALLING
705   *         @arg @ref LL_DMAMUX_REQ_GEN_POL_RISING_FALLING
706   * @retval None
707   */
LL_DMAMUX_SetRequestGenPolarity(DMAMUX_Channel_TypeDef * DMAMUXx,uint32_t RequestGenChannel,uint32_t Polarity)708 __STATIC_INLINE void LL_DMAMUX_SetRequestGenPolarity(DMAMUX_Channel_TypeDef *DMAMUXx, uint32_t RequestGenChannel,
709                                                      uint32_t Polarity)
710 {
711   (void)(DMAMUXx);
712   MODIFY_REG(((DMAMUX_RequestGen_TypeDef *)((uint32_t)((uint32_t)DMAMUX1_RequestGenerator0 + (DMAMUX_RGCR_SIZE *
713                                                        (RequestGenChannel)))))->RGCR, DMAMUX_RGxCR_GPOL, Polarity);
714 }
715 
716 /**
717   * @brief  Get the polarity of the signal on which the DMA request is generated.
718   * @rmtoll RGxCR        GPOL          LL_DMAMUX_GetRequestGenPolarity
719   * @param  DMAMUXx DMAMUXx Instance
720   * @param  RequestGenChannel This parameter can be one of the following values:
721   *         @arg @ref LL_DMAMUX_REQ_GEN_0
722   *         @arg @ref LL_DMAMUX_REQ_GEN_1
723   *         @arg @ref LL_DMAMUX_REQ_GEN_2
724   *         @arg @ref LL_DMAMUX_REQ_GEN_3
725   * @retval Returned value can be one of the following values:
726   *         @arg @ref LL_DMAMUX_REQ_GEN_NO_EVENT
727   *         @arg @ref LL_DMAMUX_REQ_GEN_POL_RISING
728   *         @arg @ref LL_DMAMUX_REQ_GEN_POL_FALLING
729   *         @arg @ref LL_DMAMUX_REQ_GEN_POL_RISING_FALLING
730   */
LL_DMAMUX_GetRequestGenPolarity(DMAMUX_Channel_TypeDef * DMAMUXx,uint32_t RequestGenChannel)731 __STATIC_INLINE uint32_t LL_DMAMUX_GetRequestGenPolarity(DMAMUX_Channel_TypeDef *DMAMUXx, uint32_t RequestGenChannel)
732 {
733   (void)(DMAMUXx);
734   return (uint32_t)(READ_BIT(((DMAMUX_RequestGen_TypeDef *)((uint32_t)((uint32_t)DMAMUX1_RequestGenerator0 +
735                                                                        (DMAMUX_RGCR_SIZE * \
736                                                                         (RequestGenChannel)))))->RGCR,
737                              DMAMUX_RGxCR_GPOL));
738 }
739 
740 /**
741   * @brief  Set the number of DMA request that will be autorized after a generation event.
742   * @note   This field can only be written when Generator is disabled.
743   * @rmtoll RGxCR        GNBREQ        LL_DMAMUX_SetGenRequestNb
744   * @param  DMAMUXx DMAMUXx Instance
745   * @param  RequestGenChannel This parameter can be one of the following values:
746   *         @arg @ref LL_DMAMUX_REQ_GEN_0
747   *         @arg @ref LL_DMAMUX_REQ_GEN_1
748   *         @arg @ref LL_DMAMUX_REQ_GEN_2
749   *         @arg @ref LL_DMAMUX_REQ_GEN_3
750   * @param  RequestNb This parameter must be a value between Min_Data = 1 and Max_Data = 32.
751   * @retval None
752   */
LL_DMAMUX_SetGenRequestNb(DMAMUX_Channel_TypeDef * DMAMUXx,uint32_t RequestGenChannel,uint32_t RequestNb)753 __STATIC_INLINE void LL_DMAMUX_SetGenRequestNb(DMAMUX_Channel_TypeDef *DMAMUXx, uint32_t RequestGenChannel,
754                                                uint32_t RequestNb)
755 {
756   (void)(DMAMUXx);
757   MODIFY_REG(((DMAMUX_RequestGen_TypeDef *)((uint32_t)((uint32_t)DMAMUX1_RequestGenerator0 + (DMAMUX_RGCR_SIZE *
758                                                        (RequestGenChannel)))))->RGCR, DMAMUX_RGxCR_GNBREQ,
759              (RequestNb - 1U) << DMAMUX_RGxCR_GNBREQ_Pos);
760 }
761 
762 /**
763   * @brief  Get the number of DMA request that will be autorized after a generation event.
764   * @rmtoll RGxCR        GNBREQ        LL_DMAMUX_GetGenRequestNb
765   * @param  DMAMUXx DMAMUXx Instance
766   * @param  RequestGenChannel This parameter can be one of the following values:
767   *         @arg @ref LL_DMAMUX_REQ_GEN_0
768   *         @arg @ref LL_DMAMUX_REQ_GEN_1
769   *         @arg @ref LL_DMAMUX_REQ_GEN_2
770   *         @arg @ref LL_DMAMUX_REQ_GEN_3
771   * @retval Between Min_Data = 1 and Max_Data = 32
772   */
LL_DMAMUX_GetGenRequestNb(DMAMUX_Channel_TypeDef * DMAMUXx,uint32_t RequestGenChannel)773 __STATIC_INLINE uint32_t LL_DMAMUX_GetGenRequestNb(DMAMUX_Channel_TypeDef *DMAMUXx, uint32_t RequestGenChannel)
774 {
775   (void)(DMAMUXx);
776   return (uint32_t)((READ_BIT(((DMAMUX_RequestGen_TypeDef *)((uint32_t)((uint32_t)DMAMUX1_RequestGenerator0 +
777                                                                         (DMAMUX_RGCR_SIZE * \
778                                                                          (RequestGenChannel)))))->RGCR,
779                               DMAMUX_RGxCR_GNBREQ) >> DMAMUX_RGxCR_GNBREQ_Pos) + 1U);
780 }
781 
782 /**
783   * @brief  Set DMAMUX external Request Signal ID on DMAMUX Request Generation Trigger Event Channel x.
784   * @rmtoll RGxCR        SIG_ID        LL_DMAMUX_SetRequestSignalID
785   * @param  DMAMUXx DMAMUXx Instance
786   * @param  RequestGenChannel This parameter can be one of the following values:
787   *         @arg @ref LL_DMAMUX_REQ_GEN_0
788   *         @arg @ref LL_DMAMUX_REQ_GEN_1
789   *         @arg @ref LL_DMAMUX_REQ_GEN_2
790   *         @arg @ref LL_DMAMUX_REQ_GEN_3
791   * @param  RequestSignalID This parameter can be one of the following values:
792   *         @arg @ref LL_DMAMUX_REQ_GEN_EXTI_LINE0
793   *         @arg @ref LL_DMAMUX_REQ_GEN_EXTI_LINE1
794   *         @arg @ref LL_DMAMUX_REQ_GEN_EXTI_LINE2
795   *         @arg @ref LL_DMAMUX_REQ_GEN_EXTI_LINE3
796   *         @arg @ref LL_DMAMUX_REQ_GEN_EXTI_LINE4
797   *         @arg @ref LL_DMAMUX_REQ_GEN_EXTI_LINE5
798   *         @arg @ref LL_DMAMUX_REQ_GEN_EXTI_LINE6
799   *         @arg @ref LL_DMAMUX_REQ_GEN_EXTI_LINE7
800   *         @arg @ref LL_DMAMUX_REQ_GEN_EXTI_LINE8
801   *         @arg @ref LL_DMAMUX_REQ_GEN_EXTI_LINE9
802   *         @arg @ref LL_DMAMUX_REQ_GEN_EXTI_LINE10
803   *         @arg @ref LL_DMAMUX_REQ_GEN_EXTI_LINE11
804   *         @arg @ref LL_DMAMUX_REQ_GEN_EXTI_LINE12
805   *         @arg @ref LL_DMAMUX_REQ_GEN_EXTI_LINE13
806   *         @arg @ref LL_DMAMUX_REQ_GEN_EXTI_LINE14
807   *         @arg @ref LL_DMAMUX_REQ_GEN_EXTI_LINE15
808   *         @arg @ref LL_DMAMUX_REQ_GEN_DMAMUX_CH0
809   *         @arg @ref LL_DMAMUX_REQ_GEN_DMAMUX_CH1
810   *         @arg @ref LL_DMAMUX_REQ_GEN_DMAMUX_CH2
811   *         @arg @ref LL_DMAMUX_REQ_GEN_TIM14_OC
812   * @retval None
813   */
LL_DMAMUX_SetRequestSignalID(DMAMUX_Channel_TypeDef * DMAMUXx,uint32_t RequestGenChannel,uint32_t RequestSignalID)814 __STATIC_INLINE void LL_DMAMUX_SetRequestSignalID(DMAMUX_Channel_TypeDef *DMAMUXx, uint32_t RequestGenChannel,
815                                                   uint32_t RequestSignalID)
816 {
817   (void)(DMAMUXx);
818   MODIFY_REG(((DMAMUX_RequestGen_TypeDef *)((uint32_t)((uint32_t)DMAMUX1_RequestGenerator0 + (DMAMUX_RGCR_SIZE *
819                                                        (RequestGenChannel)))))->RGCR, DMAMUX_RGxCR_SIG_ID,
820              RequestSignalID);
821 }
822 
823 /**
824   * @brief  Get DMAMUX external Request Signal ID set on DMAMUX Channel x.
825   * @rmtoll RGxCR        SIG_ID        LL_DMAMUX_GetRequestSignalID
826   * @param  DMAMUXx DMAMUXx Instance
827   * @param  RequestGenChannel This parameter can be one of the following values:
828   *         @arg @ref LL_DMAMUX_REQ_GEN_0
829   *         @arg @ref LL_DMAMUX_REQ_GEN_1
830   *         @arg @ref LL_DMAMUX_REQ_GEN_2
831   *         @arg @ref LL_DMAMUX_REQ_GEN_3
832   * @retval Returned value can be one of the following values:
833   *         @arg @ref LL_DMAMUX_REQ_GEN_EXTI_LINE0
834   *         @arg @ref LL_DMAMUX_REQ_GEN_EXTI_LINE1
835   *         @arg @ref LL_DMAMUX_REQ_GEN_EXTI_LINE2
836   *         @arg @ref LL_DMAMUX_REQ_GEN_EXTI_LINE3
837   *         @arg @ref LL_DMAMUX_REQ_GEN_EXTI_LINE4
838   *         @arg @ref LL_DMAMUX_REQ_GEN_EXTI_LINE5
839   *         @arg @ref LL_DMAMUX_REQ_GEN_EXTI_LINE6
840   *         @arg @ref LL_DMAMUX_REQ_GEN_EXTI_LINE7
841   *         @arg @ref LL_DMAMUX_REQ_GEN_EXTI_LINE8
842   *         @arg @ref LL_DMAMUX_REQ_GEN_EXTI_LINE9
843   *         @arg @ref LL_DMAMUX_REQ_GEN_EXTI_LINE10
844   *         @arg @ref LL_DMAMUX_REQ_GEN_EXTI_LINE11
845   *         @arg @ref LL_DMAMUX_REQ_GEN_EXTI_LINE12
846   *         @arg @ref LL_DMAMUX_REQ_GEN_EXTI_LINE13
847   *         @arg @ref LL_DMAMUX_REQ_GEN_EXTI_LINE14
848   *         @arg @ref LL_DMAMUX_REQ_GEN_EXTI_LINE15
849   *         @arg @ref LL_DMAMUX_REQ_GEN_DMAMUX_CH0
850   *         @arg @ref LL_DMAMUX_REQ_GEN_DMAMUX_CH1
851   *         @arg @ref LL_DMAMUX_REQ_GEN_DMAMUX_CH2
852   *         @arg @ref LL_DMAMUX_REQ_GEN_TIM14_OC
853   */
LL_DMAMUX_GetRequestSignalID(DMAMUX_Channel_TypeDef * DMAMUXx,uint32_t RequestGenChannel)854 __STATIC_INLINE uint32_t LL_DMAMUX_GetRequestSignalID(DMAMUX_Channel_TypeDef *DMAMUXx, uint32_t RequestGenChannel)
855 {
856   (void)(DMAMUXx);
857   return (uint32_t)(READ_BIT(((DMAMUX_RequestGen_TypeDef *)((uint32_t)((uint32_t)DMAMUX1_RequestGenerator0 +
858                                                                        (DMAMUX_RGCR_SIZE * \
859                                                                         (RequestGenChannel)))))->RGCR,
860                              DMAMUX_RGxCR_SIG_ID));
861 }
862 
863 /**
864   * @}
865   */
866 
867 /** @defgroup DMAMUX_LL_EF_FLAG_Management FLAG_Management
868   * @{
869   */
870 
871 /**
872   * @brief  Get Synchronization Event Overrun Flag Channel 0.
873   * @rmtoll CSR          SOF0          LL_DMAMUX_IsActiveFlag_SO0
874   * @param  DMAMUXx DMAMUXx DMAMUXx Instance
875   * @retval State of bit (1 or 0).
876   */
LL_DMAMUX_IsActiveFlag_SO0(DMAMUX_Channel_TypeDef * DMAMUXx)877 __STATIC_INLINE uint32_t LL_DMAMUX_IsActiveFlag_SO0(DMAMUX_Channel_TypeDef *DMAMUXx)
878 {
879   (void)(DMAMUXx);
880   return ((READ_BIT(DMAMUX1_ChannelStatus->CSR, DMAMUX_CSR_SOF0) == (DMAMUX_CSR_SOF0)) ? 1UL : 0UL);
881 }
882 
883 /**
884   * @brief  Get Synchronization Event Overrun Flag Channel 1.
885   * @rmtoll CSR          SOF1          LL_DMAMUX_IsActiveFlag_SO1
886   * @param  DMAMUXx DMAMUXx DMAMUXx Instance
887   * @retval State of bit (1 or 0).
888   */
LL_DMAMUX_IsActiveFlag_SO1(DMAMUX_Channel_TypeDef * DMAMUXx)889 __STATIC_INLINE uint32_t LL_DMAMUX_IsActiveFlag_SO1(DMAMUX_Channel_TypeDef *DMAMUXx)
890 {
891   (void)(DMAMUXx);
892   return ((READ_BIT(DMAMUX1_ChannelStatus->CSR, DMAMUX_CSR_SOF1) == (DMAMUX_CSR_SOF1)) ? 1UL : 0UL);;
893 }
894 
895 /**
896   * @brief  Get Synchronization Event Overrun Flag Channel 2.
897   * @rmtoll CSR          SOF2          LL_DMAMUX_IsActiveFlag_SO2
898   * @param  DMAMUXx DMAMUXx DMAMUXx Instance
899   * @retval State of bit (1 or 0).
900   */
LL_DMAMUX_IsActiveFlag_SO2(DMAMUX_Channel_TypeDef * DMAMUXx)901 __STATIC_INLINE uint32_t LL_DMAMUX_IsActiveFlag_SO2(DMAMUX_Channel_TypeDef *DMAMUXx)
902 {
903   (void)(DMAMUXx);
904   return ((READ_BIT(DMAMUX1_ChannelStatus->CSR, DMAMUX_CSR_SOF2) == (DMAMUX_CSR_SOF2)) ? 1UL : 0UL);;
905 }
906 
907 
908 /**
909   * @brief  Get Request Generator 0 Trigger Event Overrun Flag.
910   * @rmtoll RGSR         OF0           LL_DMAMUX_IsActiveFlag_RGO0
911   * @param  DMAMUXx DMAMUXx DMAMUXx Instance
912   * @retval State of bit (1 or 0).
913   */
LL_DMAMUX_IsActiveFlag_RGO0(DMAMUX_Channel_TypeDef * DMAMUXx)914 __STATIC_INLINE uint32_t LL_DMAMUX_IsActiveFlag_RGO0(DMAMUX_Channel_TypeDef *DMAMUXx)
915 {
916   (void)(DMAMUXx);
917   return ((READ_BIT(DMAMUX1_RequestGenStatus->RGSR, DMAMUX_RGSR_OF0) == (DMAMUX_RGSR_OF0)) ? 1UL : 0UL);;
918 }
919 
920 /**
921   * @brief  Get Request Generator 1 Trigger Event Overrun Flag.
922   * @rmtoll RGSR         OF1           LL_DMAMUX_IsActiveFlag_RGO1
923   * @param  DMAMUXx DMAMUXx DMAMUXx Instance
924   * @retval State of bit (1 or 0).
925   */
LL_DMAMUX_IsActiveFlag_RGO1(DMAMUX_Channel_TypeDef * DMAMUXx)926 __STATIC_INLINE uint32_t LL_DMAMUX_IsActiveFlag_RGO1(DMAMUX_Channel_TypeDef *DMAMUXx)
927 {
928   (void)(DMAMUXx);
929   return ((READ_BIT(DMAMUX1_RequestGenStatus->RGSR, DMAMUX_RGSR_OF1) == (DMAMUX_RGSR_OF1)) ? 1UL : 0UL);;
930 }
931 
932 /**
933   * @brief  Get Request Generator 2 Trigger Event Overrun Flag.
934   * @rmtoll RGSR         OF2           LL_DMAMUX_IsActiveFlag_RGO2
935   * @param  DMAMUXx DMAMUXx DMAMUXx Instance
936   * @retval State of bit (1 or 0).
937   */
LL_DMAMUX_IsActiveFlag_RGO2(DMAMUX_Channel_TypeDef * DMAMUXx)938 __STATIC_INLINE uint32_t LL_DMAMUX_IsActiveFlag_RGO2(DMAMUX_Channel_TypeDef *DMAMUXx)
939 {
940   (void)(DMAMUXx);
941   return ((READ_BIT(DMAMUX1_RequestGenStatus->RGSR, DMAMUX_RGSR_OF2) == (DMAMUX_RGSR_OF2)) ? 1UL : 0UL);;
942 }
943 
944 /**
945   * @brief  Get Request Generator 3 Trigger Event Overrun Flag.
946   * @rmtoll RGSR         OF3           LL_DMAMUX_IsActiveFlag_RGO3
947   * @param  DMAMUXx DMAMUXx DMAMUXx Instance
948   * @retval State of bit (1 or 0).
949   */
LL_DMAMUX_IsActiveFlag_RGO3(DMAMUX_Channel_TypeDef * DMAMUXx)950 __STATIC_INLINE uint32_t LL_DMAMUX_IsActiveFlag_RGO3(DMAMUX_Channel_TypeDef *DMAMUXx)
951 {
952   (void)(DMAMUXx);
953   return ((READ_BIT(DMAMUX1_RequestGenStatus->RGSR, DMAMUX_RGSR_OF3) == (DMAMUX_RGSR_OF3)) ? 1UL : 0UL);;
954 }
955 
956 /**
957   * @brief  Clear Synchronization Event Overrun Flag Channel 0.
958   * @rmtoll CFR          CSOF0         LL_DMAMUX_ClearFlag_SO0
959   * @param  DMAMUXx DMAMUXx DMAMUXx Instance
960   * @retval None
961   */
LL_DMAMUX_ClearFlag_SO0(DMAMUX_Channel_TypeDef * DMAMUXx)962 __STATIC_INLINE void LL_DMAMUX_ClearFlag_SO0(DMAMUX_Channel_TypeDef *DMAMUXx)
963 {
964   (void)(DMAMUXx);
965   SET_BIT(DMAMUX1_ChannelStatus->CFR, DMAMUX_CFR_CSOF0);
966 }
967 
968 /**
969   * @brief  Clear Synchronization Event Overrun Flag Channel 1.
970   * @rmtoll CFR          CSOF1         LL_DMAMUX_ClearFlag_SO1
971   * @param  DMAMUXx DMAMUXx DMAMUXx Instance
972   * @retval None
973   */
LL_DMAMUX_ClearFlag_SO1(DMAMUX_Channel_TypeDef * DMAMUXx)974 __STATIC_INLINE void LL_DMAMUX_ClearFlag_SO1(DMAMUX_Channel_TypeDef *DMAMUXx)
975 {
976   (void)(DMAMUXx);
977   SET_BIT(DMAMUX1_ChannelStatus->CFR, DMAMUX_CFR_CSOF1);
978 }
979 
980 /**
981   * @brief  Clear Synchronization Event Overrun Flag Channel 2.
982   * @rmtoll CFR          CSOF2         LL_DMAMUX_ClearFlag_SO2
983   * @param  DMAMUXx DMAMUXx DMAMUXx Instance
984   * @retval None
985   */
LL_DMAMUX_ClearFlag_SO2(DMAMUX_Channel_TypeDef * DMAMUXx)986 __STATIC_INLINE void LL_DMAMUX_ClearFlag_SO2(DMAMUX_Channel_TypeDef *DMAMUXx)
987 {
988   (void)(DMAMUXx);
989   SET_BIT(DMAMUX1_ChannelStatus->CFR, DMAMUX_CFR_CSOF2);
990 }
991 
992 /**
993   * @brief  Clear Request Generator 0 Trigger Event Overrun Flag.
994   * @rmtoll RGCFR        COF0          LL_DMAMUX_ClearFlag_RGO0
995   * @param  DMAMUXx DMAMUXx DMAMUXx Instance
996   * @retval None
997   */
LL_DMAMUX_ClearFlag_RGO0(DMAMUX_Channel_TypeDef * DMAMUXx)998 __STATIC_INLINE void LL_DMAMUX_ClearFlag_RGO0(DMAMUX_Channel_TypeDef *DMAMUXx)
999 {
1000   (void)(DMAMUXx);
1001   SET_BIT(DMAMUX1_RequestGenStatus->RGCFR, DMAMUX_RGCFR_COF0);
1002 }
1003 
1004 /**
1005   * @brief  Clear Request Generator 1 Trigger Event Overrun Flag.
1006   * @rmtoll RGCFR        COF1          LL_DMAMUX_ClearFlag_RGO1
1007   * @param  DMAMUXx DMAMUXx DMAMUXx Instance
1008   * @retval None
1009   */
LL_DMAMUX_ClearFlag_RGO1(DMAMUX_Channel_TypeDef * DMAMUXx)1010 __STATIC_INLINE void LL_DMAMUX_ClearFlag_RGO1(DMAMUX_Channel_TypeDef *DMAMUXx)
1011 {
1012   (void)(DMAMUXx);
1013   SET_BIT(DMAMUX1_RequestGenStatus->RGCFR, DMAMUX_RGCFR_COF1);
1014 }
1015 
1016 /**
1017   * @brief  Clear Request Generator 2 Trigger Event Overrun Flag.
1018   * @rmtoll RGCFR        COF2          LL_DMAMUX_ClearFlag_RGO2
1019   * @param  DMAMUXx DMAMUXx DMAMUXx Instance
1020   * @retval None
1021   */
LL_DMAMUX_ClearFlag_RGO2(DMAMUX_Channel_TypeDef * DMAMUXx)1022 __STATIC_INLINE void LL_DMAMUX_ClearFlag_RGO2(DMAMUX_Channel_TypeDef *DMAMUXx)
1023 {
1024   (void)(DMAMUXx);
1025   SET_BIT(DMAMUX1_RequestGenStatus->RGCFR, DMAMUX_RGCFR_COF2);
1026 }
1027 
1028 /**
1029   * @brief  Clear Request Generator 3 Trigger Event Overrun Flag.
1030   * @rmtoll RGCFR        COF3          LL_DMAMUX_ClearFlag_RGO3
1031   * @param  DMAMUXx DMAMUXx DMAMUXx Instance
1032   * @retval None
1033   */
LL_DMAMUX_ClearFlag_RGO3(DMAMUX_Channel_TypeDef * DMAMUXx)1034 __STATIC_INLINE void LL_DMAMUX_ClearFlag_RGO3(DMAMUX_Channel_TypeDef *DMAMUXx)
1035 {
1036   (void)(DMAMUXx);
1037   SET_BIT(DMAMUX1_RequestGenStatus->RGCFR, DMAMUX_RGCFR_COF3);
1038 }
1039 
1040 /**
1041   * @}
1042   */
1043 
1044 /** @defgroup DMAMUX_LL_EF_IT_Management IT_Management
1045   * @{
1046   */
1047 
1048 /**
1049   * @brief  Enable the Synchronization Event Overrun Interrupt on DMAMUX channel x.
1050   * @rmtoll CxCR         SOIE          LL_DMAMUX_EnableIT_SO
1051   * @param  DMAMUXx DMAMUXx Instance
1052   * @param  Channel This parameter can be one of the following values:
1053   *         @arg @ref LL_DMAMUX_CHANNEL_0
1054   *         @arg @ref LL_DMAMUX_CHANNEL_1
1055   *         @arg @ref LL_DMAMUX_CHANNEL_2
1056   * @retval None
1057   */
LL_DMAMUX_EnableIT_SO(DMAMUX_Channel_TypeDef * DMAMUXx,uint32_t Channel)1058 __STATIC_INLINE void LL_DMAMUX_EnableIT_SO(DMAMUX_Channel_TypeDef *DMAMUXx, uint32_t Channel)
1059 {
1060   (void)(DMAMUXx);
1061   SET_BIT((DMAMUX1_Channel0 + Channel)->CCR, DMAMUX_CxCR_SOIE);
1062 }
1063 
1064 /**
1065   * @brief  Disable the Synchronization Event Overrun Interrupt on DMAMUX channel x.
1066   * @rmtoll CxCR         SOIE          LL_DMAMUX_DisableIT_SO
1067   * @param  DMAMUXx DMAMUXx Instance
1068   * @param  Channel This parameter can be one of the following values:
1069   *         @arg @ref LL_DMAMUX_CHANNEL_0
1070   *         @arg @ref LL_DMAMUX_CHANNEL_1
1071   *         @arg @ref LL_DMAMUX_CHANNEL_2
1072   * @retval None
1073   */
LL_DMAMUX_DisableIT_SO(DMAMUX_Channel_TypeDef * DMAMUXx,uint32_t Channel)1074 __STATIC_INLINE void LL_DMAMUX_DisableIT_SO(DMAMUX_Channel_TypeDef *DMAMUXx, uint32_t Channel)
1075 {
1076   (void)(DMAMUXx);
1077   CLEAR_BIT((DMAMUX1_Channel0 + Channel)->CCR, DMAMUX_CxCR_SOIE);
1078 }
1079 
1080 /**
1081   * @brief  Check if the Synchronization Event Overrun Interrupt on DMAMUX channel x is enabled or disabled.
1082   * @rmtoll CxCR         SOIE          LL_DMAMUX_IsEnabledIT_SO
1083   * @param  DMAMUXx DMAMUXx Instance
1084   * @param  Channel This parameter can be one of the following values:
1085   *         @arg @ref LL_DMAMUX_CHANNEL_0
1086   *         @arg @ref LL_DMAMUX_CHANNEL_1
1087   *         @arg @ref LL_DMAMUX_CHANNEL_2
1088   * @retval State of bit (1 or 0).
1089   */
LL_DMAMUX_IsEnabledIT_SO(DMAMUX_Channel_TypeDef * DMAMUXx,uint32_t Channel)1090 __STATIC_INLINE uint32_t LL_DMAMUX_IsEnabledIT_SO(DMAMUX_Channel_TypeDef *DMAMUXx, uint32_t Channel)
1091 {
1092   (void)(DMAMUXx);
1093   return (((READ_BIT((DMAMUX1_Channel0 + Channel)->CCR, DMAMUX_CxCR_SOIE)) == (DMAMUX_CxCR_SOIE)) ? 1UL : 0UL);
1094 }
1095 
1096 /**
1097   * @brief  Enable the Request Generation Trigger Event Overrun Interrupt on DMAMUX channel x.
1098   * @rmtoll RGxCR        OIE           LL_DMAMUX_EnableIT_RGO
1099   * @param  DMAMUXx DMAMUXx Instance
1100   * @param  RequestGenChannel This parameter can be one of the following values:
1101   *         @arg @ref LL_DMAMUX_REQ_GEN_0
1102   *         @arg @ref LL_DMAMUX_REQ_GEN_1
1103   *         @arg @ref LL_DMAMUX_REQ_GEN_2
1104   *         @arg @ref LL_DMAMUX_REQ_GEN_3
1105   * @retval None
1106   */
LL_DMAMUX_EnableIT_RGO(DMAMUX_Channel_TypeDef * DMAMUXx,uint32_t RequestGenChannel)1107 __STATIC_INLINE void LL_DMAMUX_EnableIT_RGO(DMAMUX_Channel_TypeDef *DMAMUXx, uint32_t RequestGenChannel)
1108 {
1109   (void)(DMAMUXx);
1110   SET_BIT((DMAMUX1_RequestGenerator0 + RequestGenChannel)->RGCR, DMAMUX_RGxCR_OIE);
1111 }
1112 
1113 /**
1114   * @brief  Disable the Request Generation Trigger Event Overrun Interrupt on DMAMUX channel x.
1115   * @rmtoll RGxCR        OIE           LL_DMAMUX_DisableIT_RGO
1116   * @param  DMAMUXx DMAMUXx Instance
1117   * @param  RequestGenChannel This parameter can be one of the following values:
1118   *         @arg @ref LL_DMAMUX_REQ_GEN_0
1119   *         @arg @ref LL_DMAMUX_REQ_GEN_1
1120   *         @arg @ref LL_DMAMUX_REQ_GEN_2
1121   *         @arg @ref LL_DMAMUX_REQ_GEN_3
1122   * @retval None
1123   */
LL_DMAMUX_DisableIT_RGO(DMAMUX_Channel_TypeDef * DMAMUXx,uint32_t RequestGenChannel)1124 __STATIC_INLINE void LL_DMAMUX_DisableIT_RGO(DMAMUX_Channel_TypeDef *DMAMUXx, uint32_t RequestGenChannel)
1125 {
1126   (void)(DMAMUXx);
1127   CLEAR_BIT((DMAMUX1_RequestGenerator0 + RequestGenChannel)->RGCR, DMAMUX_RGxCR_OIE);
1128 }
1129 
1130 /**
1131   * @brief  Check if the Request Generation Trigger Event Overrun Interrupt on DMAMUX channel x is enabled or disabled.
1132   * @rmtoll RGxCR        OIE           LL_DMAMUX_IsEnabledIT_RGO
1133   * @param  DMAMUXx DMAMUXx Instance
1134   * @param  RequestGenChannel This parameter can be one of the following values:
1135   *         @arg @ref LL_DMAMUX_REQ_GEN_0
1136   *         @arg @ref LL_DMAMUX_REQ_GEN_1
1137   *         @arg @ref LL_DMAMUX_REQ_GEN_2
1138   *         @arg @ref LL_DMAMUX_REQ_GEN_3
1139   * @retval State of bit (1 or 0).
1140   */
LL_DMAMUX_IsEnabledIT_RGO(DMAMUX_Channel_TypeDef * DMAMUXx,uint32_t RequestGenChannel)1141 __STATIC_INLINE uint32_t LL_DMAMUX_IsEnabledIT_RGO(DMAMUX_Channel_TypeDef *DMAMUXx, uint32_t RequestGenChannel)
1142 {
1143   (void)(DMAMUXx);
1144   return ((READ_BIT((DMAMUX1_RequestGenerator0 + RequestGenChannel)->RGCR, DMAMUX_RGxCR_OIE) == (DMAMUX_RGxCR_OIE)) ? \
1145           1UL : 0UL);
1146 }
1147 
1148 /**
1149   * @}
1150   */
1151 
1152 /**
1153   * @}
1154   */
1155 
1156 /**
1157   * @}
1158   */
1159 
1160 #endif /* DMAMUX1 */
1161 
1162 /**
1163   * @}
1164   */
1165 
1166 #ifdef __cplusplus
1167 }
1168 #endif
1169 
1170 #endif /* STM32C0xx_LL_DMAMUX_H */
1171