1 /**
2   ******************************************************************************
3   * @file    stm32g0xx_hal_tim_ex.h
4   * @author  MCD Application Team
5   * @brief   Header file of TIM HAL Extended module.
6   ******************************************************************************
7   * @attention
8   *
9   * Copyright (c) 2018 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 STM32G0xx_HAL_TIM_EX_H
21 #define STM32G0xx_HAL_TIM_EX_H
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 /* Includes ------------------------------------------------------------------*/
28 #include "stm32g0xx_hal_def.h"
29 
30 /** @addtogroup STM32G0xx_HAL_Driver
31   * @{
32   */
33 
34 /** @addtogroup TIMEx
35   * @{
36   */
37 
38 /* Exported types ------------------------------------------------------------*/
39 /** @defgroup TIMEx_Exported_Types TIM Extended Exported Types
40   * @{
41   */
42 
43 /**
44   * @brief  TIM Hall sensor Configuration Structure definition
45   */
46 
47 typedef struct
48 {
49   uint32_t IC1Polarity;         /*!< Specifies the active edge of the input signal.
50                                      This parameter can be a value of @ref TIM_Input_Capture_Polarity */
51 
52   uint32_t IC1Prescaler;        /*!< Specifies the Input Capture Prescaler.
53                                      This parameter can be a value of @ref TIM_Input_Capture_Prescaler */
54 
55   uint32_t IC1Filter;           /*!< Specifies the input capture filter.
56                                      This parameter can be a number between Min_Data = 0x0 and Max_Data = 0xF */
57 
58   uint32_t Commutation_Delay;   /*!< Specifies the pulse value to be loaded into the Capture Compare Register.
59                                      This parameter can be a number between Min_Data = 0x0000 and Max_Data = 0xFFFF */
60 } TIM_HallSensor_InitTypeDef;
61 
62 /**
63   * @brief  TIM Break/Break2 input configuration
64   */
65 typedef struct
66 {
67   uint32_t Source;         /*!< Specifies the source of the timer break input.
68                                 This parameter can be a value of @ref TIMEx_Break_Input_Source */
69   uint32_t Enable;         /*!< Specifies whether or not the break input source is enabled.
70                                 This parameter can be a value of @ref TIMEx_Break_Input_Source_Enable */
71   uint32_t Polarity;       /*!< Specifies the break input source polarity.
72                                 This parameter can be a value of @ref TIMEx_Break_Input_Source_Polarity */
73 } TIMEx_BreakInputConfigTypeDef;
74 
75 /**
76   * @}
77   */
78 /* End of exported types -----------------------------------------------------*/
79 
80 /* Exported constants --------------------------------------------------------*/
81 /** @defgroup TIMEx_Exported_Constants TIM Extended Exported Constants
82   * @{
83   */
84 
85 /** @defgroup TIMEx_Remap TIM Extended Remapping
86   * @{
87   */
88 #define TIM_TIM1_ETR_GPIO           0x00000000U                                 /*!< TIM1_ETR is connected to GPIO */
89 #if defined(COMP1) && defined(COMP2)
90 #define TIM_TIM1_ETR_COMP1          TIM1_AF1_ETRSEL_0                           /*!< TIM1_ETR is connected to COMP1 output */
91 #define TIM_TIM1_ETR_COMP2          TIM1_AF1_ETRSEL_1                           /*!< TIM1_ETR is connected to COMP2 output */
92 #endif /* COMP1 && COMP2 */
93 #define TIM_TIM1_ETR_ADC1_AWD1      (TIM1_AF1_ETRSEL_1 | TIM1_AF1_ETRSEL_0)     /*!< TIM1_ETR is connected to ADC1 AWD1 */
94 #define TIM_TIM1_ETR_ADC1_AWD2      TIM1_AF1_ETRSEL_2                           /*!< TIM1_ETR is connected to ADC1 AWD2 */
95 #define TIM_TIM1_ETR_ADC1_AWD3      (TIM1_AF1_ETRSEL_2 | TIM1_AF1_ETRSEL_0)     /*!< TIM1_ETR is connected to ADC1 AWD3 */
96 #if defined(COMP3)
97 #define TIM_TIM1_ETR_COMP3          (TIM1_AF1_ETRSEL_2 | TIM1_AF1_ETRSEL_1)     /*!< TIM1_ETR is connected to COMP3 output */
98 #endif /* COMP3 */
99 #if defined(TIM2)
100 #define TIM_TIM2_ETR_GPIO           0x00000000U                                 /*!< TIM2_ETR is connected to GPIO      */
101 #define TIM_TIM2_ETR_COMP1          TIM2_AF1_ETRSEL_0                           /*!< TIM2_ETR is connected to COMP1 output */
102 #define TIM_TIM2_ETR_COMP2          TIM2_AF1_ETRSEL_1                           /*!< TIM2_ETR is connected to COMP2 output */
103 #define TIM_TIM2_ETR_LSE            (TIM2_AF1_ETRSEL_1 | TIM2_AF1_ETRSEL_0)     /*!< TIM2_ETR is connected to LSE */
104 #if defined(COMP3)
105 #define TIM_TIM2_ETR_MCO            TIM2_AF1_ETRSEL_2                           /*!< TIM2_ETR is connected to MCO */
106 #define TIM_TIM2_ETR_MCO2           (TIM1_AF1_ETRSEL_2 | TIM1_AF1_ETRSEL_0)     /*!< TIM2_ETR is connected to MCO2 */
107 #define TIM_TIM2_ETR_COMP3          (TIM1_AF1_ETRSEL_2 | TIM1_AF1_ETRSEL_1)     /*!< TIM2_ETR is connected to COMP3 output */
108 #endif /* COMP3 */
109 #endif /*  TIM2 */
110 #if defined(TIM3)
111 #define TIM_TIM3_ETR_GPIO           0x00000000U                                 /*!< TIM3_ETR is connected to GPIO */
112 #if defined(COMP1) && defined(COMP2)
113 #define TIM_TIM3_ETR_COMP1          TIM3_AF1_ETRSEL_0                           /*!< TIM3_ETR is connected to COMP1 output */
114 #define TIM_TIM3_ETR_COMP2          TIM3_AF1_ETRSEL_1                           /*!< TIM3_ETR is connected to COMP2 output */
115 #endif /* COMP1 && COMP2 */
116 #if defined(COMP3)
117 #define TIM_TIM3_ETR_COMP3          (TIM3_AF1_ETRSEL_1 | TIM3_AF1_ETRSEL_0)     /*!< TIM3_ETR is connected to COMP3 output */
118 #endif /* COMP3 */
119 #endif /* TIM3 */
120 #if defined(TIM4)
121 #define TIM_TIM4_ETR_GPIO           0x00000000U                                 /*!< TIM4_ETR is connected to GPIO */
122 #if defined(COMP1) && defined(COMP2)
123 #define TIM_TIM4_ETR_COMP1          TIM4_AF1_ETRSEL_0                           /*!< TIM4_ETR is connected to COMP1 output */
124 #define TIM_TIM4_ETR_COMP2          TIM4_AF1_ETRSEL_1                           /*!< TIM4_ETR is connected to COMP2 output */
125 #endif /* COMP1 && COMP2 */
126 #if defined(COMP3)
127 #define TIM_TIM4_ETR_COMP3          (TIM4_AF1_ETRSEL_1 | TIM4_AF1_ETRSEL_0)     /*!< TIM4_ETR is connected to COMP3 output */
128 #endif /* COMP3 */
129 #endif /* TIM4 */
130 /**
131   * @}
132   */
133 
134 /** @defgroup TIMEx_Break_Input TIM Extended Break input
135   * @{
136   */
137 #define TIM_BREAKINPUT_BRK     0x00000001U                                      /*!< Timer break input  */
138 #define TIM_BREAKINPUT_BRK2    0x00000002U                                      /*!< Timer break2 input */
139 /**
140   * @}
141   */
142 
143 /** @defgroup TIMEx_Break_Input_Source TIM Extended Break input source
144   * @{
145   */
146 #define TIM_BREAKINPUTSOURCE_BKIN     0x00000001U                               /*!< An external source (GPIO) is connected to the BKIN pin  */
147 #if defined(COMP1) && defined(COMP2)
148 #define TIM_BREAKINPUTSOURCE_COMP1    0x00000002U                               /*!< The COMP1 output is connected to the break input */
149 #define TIM_BREAKINPUTSOURCE_COMP2    0x00000004U                               /*!< The COMP2 output is connected to the break input */
150 #endif /* COMP1 && COMP2 */
151 #if defined(COMP3)
152 #define TIM_BREAKINPUTSOURCE_COMP3    0x00000008U                               /*!< The COMP3 output is connected to the break input */
153 #endif /* COMP3 */
154 /**
155   * @}
156   */
157 
158 /** @defgroup TIMEx_Break_Input_Source_Enable TIM Extended Break input source enabling
159   * @{
160   */
161 #define TIM_BREAKINPUTSOURCE_DISABLE     0x00000000U                            /*!< Break input source is disabled */
162 #define TIM_BREAKINPUTSOURCE_ENABLE      0x00000001U                            /*!< Break input source is enabled */
163 /**
164   * @}
165   */
166 
167 /** @defgroup TIMEx_Break_Input_Source_Polarity TIM Extended Break input polarity
168   * @{
169   */
170 #define TIM_BREAKINPUTSOURCE_POLARITY_LOW     0x00000001U                       /*!< Break input source is active low */
171 #define TIM_BREAKINPUTSOURCE_POLARITY_HIGH    0x00000000U                       /*!< Break input source is active_high */
172 /**
173   * @}
174   */
175 
176 /** @defgroup TIMEx_Timer_Input_Selection TIM Extended Timer input selection
177   * @{
178   */
179 #define TIM_TIM1_TI1_GPIO                     0x00000000U                       /*!< TIM1_TI1 is connected to GPIO */
180 #if defined(COMP1)
181 #define TIM_TIM1_TI1_COMP1                    0x00000001U                       /*!< TIM1_TI1 is connected to COMP1 OUT */
182 #endif /* COMP1 */
183 
184 #define TIM_TIM1_TI2_GPIO                     0x00000000U                       /*!< TIM1_TI2 is connected to GPIO */
185 #if defined(COMP2)
186 #define TIM_TIM1_TI2_COMP2                    0x00000100U                       /*!< TIM1_TI2 is connected to COMP2 OUT */
187 #endif /* COMP2 */
188 
189 #define TIM_TIM1_TI3_GPIO                     0x00000000U                       /*!< TIM1_TI3 is connected to GPIO */
190 #if defined(COMP3)
191 #define TIM_TIM1_TI3_COMP3                    0x00010000U                       /*!< TIM1_TI3 is connected to COMP3 OUT */
192 #endif /* COMP3 */
193 
194 #if defined(TIM2)
195 #define TIM_TIM2_TI1_GPIO                     0x00000000U                       /*!< TIM2_TI1 is connected to GPIO */
196 #define TIM_TIM2_TI1_COMP1                    0x00000001U                       /*!< TIM2_TI1 is connected to COMP1 OUT */
197 
198 #define TIM_TIM2_TI2_GPIO                     0x00000000U                       /*!< TIM2_TI2 is connected to GPIO */
199 #define TIM_TIM2_TI2_COMP2                    0x00000100U                       /*!< TIM2_TI2 is connected to COMP2 OUT */
200 
201 #define TIM_TIM2_TI3_GPIO                     0x00000000U                       /*!< TIM2_TI3 is connected to GPIO */
202 #if defined(COMP3)
203 #define TIM_TIM2_TI3_COMP3                    0x00010000U                       /*!< TIM2_TI3 is connected to COMP3 OUT */
204 #endif /* COMP3 */
205 #endif /* TIM2 */
206 
207 #define TIM_TIM3_TI1_GPIO                     0x00000000U                       /*!< TIM3_TI1 is connected to GPIO */
208 #if defined(COMP1)
209 #define TIM_TIM3_TI1_COMP1                    0x00000001U                       /*!< TIM3_TI1 is connected to COMP1 OUT */
210 #endif /* COMP1 */
211 
212 #define TIM_TIM3_TI2_GPIO                     0x00000000U                       /*!< TIM3_TI2 is connected to GPIO */
213 #if defined(COMP2)
214 #define TIM_TIM3_TI2_COMP2                    0x00000100U                       /*!< TIM3_TI2 is connected to COMP2 OUT */
215 #endif /* COMP2 */
216 
217 #define TIM_TIM3_TI3_GPIO                     0x00000000U                       /*!< TIM3_TI3 is connected to GPIO */
218 #if defined(COMP3)
219 #define TIM_TIM3_TI3_COMP3                    0x00010000U                       /*!< TIM3_TI3 is connected to COMP3 OUT */
220 #endif /* COMP3 */
221 
222 #if defined(TIM4)
223 #define TIM_TIM4_TI1_GPIO                     0x00000000U                       /*!< TIM4_TI1 is connected to GPIO */
224 #if defined(COMP1)
225 #define TIM_TIM4_TI1_COMP1                    0x00000001U                       /*!< TIM4_TI1 is connected to COMP1 OUT */
226 #endif /* COMP1 */
227 
228 #define TIM_TIM4_TI2_GPIO                     0x00000000U                       /*!< TIM4_TI2 is connected to GPIO */
229 #if defined(COMP2)
230 #define TIM_TIM4_TI2_COMP2                    0x00000100U                       /*!< TIM4_TI2 is connected to COMP2 OUT */
231 #endif /* COMP2 */
232 
233 #define TIM_TIM4_TI3_GPIO                     0x00000000U                       /*!< TIM4_TI3 is connected to GPIO */
234 #if defined(COMP3)
235 #define TIM_TIM4_TI3_COMP3                    0x00010000U                       /*!< TIM4_TI3 is connected to COMP3 OUT */
236 #endif /* COMP3 */
237 #endif /* TIM4 */
238 
239 #define TIM_TIM14_TI1_GPIO                    0x00000000U                       /*!< TIM14_TI1 is connected to GPIO */
240 #define TIM_TIM14_TI1_RTC                     0x00000001U                       /*!< TIM14_TI1 is connected to RTC clock */
241 #define TIM_TIM14_TI1_HSE_32                  0x00000002U                       /*!< TIM14_TI1 is connected to HSE div 32 */
242 #define TIM_TIM14_TI1_MCO                     0x00000003U                       /*!< TIM14_TI1 is connected to MCO */
243 #if defined(RCC_MCO2_SUPPORT)
244 #define TIM_TIM14_TI1_MCO2                    0x00000004U                       /*!< TIM14_TI1 is connected to MCO2 */
245 #endif /* RCC_MCO2_SUPPORT */
246 
247 #if defined(TIM15)
248 #define TIM_TIM15_TI1_GPIO                    0x00000000U                       /*!< TIM15_TI1 is connected to GPIO */
249 #define TIM_TIM15_TI1_TIM2_CH1                0x00000001U                       /*!< TIM15_TI1 is connected to TIM2 CH1 */
250 #define TIM_TIM15_TI1_TIM3_CH1                0x00000002U                       /*!< TIM15_TI1 is connected to TIM3 CH1 */
251 
252 #define TIM_TIM15_TI2_GPIO                    0x00000000U                       /*!< TIM15_TI2 is connected to GPIO */
253 #define TIM_TIM15_TI2_TIM2_CH2                0x00000100U                       /*!< TIM15_TI2 is connected to TIM2 CH2 */
254 #define TIM_TIM15_TI2_TIM3_CH2                0x00000200U                       /*!< TIM15_TI2 is connected to TIM3 CH2 */
255 #endif /* TIM15 */
256 
257 #define TIM_TIM16_TI1_GPIO                    0x00000000U                       /*!< TIM16_TI1 is connected to GPIO */
258 #define TIM_TIM16_TI1_LSI                     0x00000001U                       /*!< TIM16_TI1 is connected to LSI */
259 #define TIM_TIM16_TI1_LSE                     0x00000002U                       /*!< TIM16_TI1 is connected to LSE */
260 #define TIM_TIM16_TI1_RTC_WAKEUP              0x00000003U                       /*!< TIM16_TI1 is connected to TRC wakeup interrupt */
261 #if defined(RCC_MCO2_SUPPORT)
262 #define TIM_TIM16_TI1_MCO2                    0x00000004U                       /*!< TIM16_TI1 is connected to MCO2 */
263 #endif /* RCC_MCO2_SUPPORT */
264 
265 #define TIM_TIM17_TI1_GPIO                    0x00000000U                       /*!< TIM17_TI1 is connected to GPIO */
266 #if defined(RCC_HSI48_SUPPORT)
267 #define TIM_TIM17_TI1_HSI48                   0x00000001U                       /*!< TIM17_TI1 is connected to HSI48/256 */
268 #endif /* RCC_HSI48_SUPPORT */
269 #define TIM_TIM17_TI1_HSE_32                  0x00000002U                       /*!< TIM17_TI1 is connected to HSE div 32 */
270 #define TIM_TIM17_TI1_MCO                     0x00000003U                       /*!< TIM17_TI1 is connected to MCO */
271 #if defined(RCC_MCO2_SUPPORT)
272 #define TIM_TIM17_TI1_MCO2                    0x00000004U                       /*!< TIM17_TI1 is connected to MCO2 */
273 #endif /* RCC_MCO2_SUPPORT */
274 /**
275   * @}
276   */
277 
278 /**
279   * @}
280   */
281 /* End of exported constants -------------------------------------------------*/
282 
283 /* Exported macro ------------------------------------------------------------*/
284 /** @defgroup TIMEx_Exported_Macros TIM Extended Exported Macros
285   * @{
286   */
287 
288 /**
289   * @}
290   */
291 /* End of exported macro -----------------------------------------------------*/
292 
293 /* Private macro -------------------------------------------------------------*/
294 /** @defgroup TIMEx_Private_Macros TIM Extended Private Macros
295   * @{
296   */
297 #define IS_TIM_REMAP(__REMAP__) ((((__REMAP__) & 0xFFFC3FFFU) == 0x00000000U))
298 
299 #define IS_TIM_BREAKINPUT(__BREAKINPUT__)  (((__BREAKINPUT__) == TIM_BREAKINPUT_BRK)  || \
300                                             ((__BREAKINPUT__) == TIM_BREAKINPUT_BRK2))
301 
302 #if defined(COMP1) && defined(COMP2) && defined(COMP3)
303 #define IS_TIM_BREAKINPUTSOURCE(__SOURCE__)  (((__SOURCE__) == TIM_BREAKINPUTSOURCE_BKIN)  || \
304                                               ((__SOURCE__) == TIM_BREAKINPUTSOURCE_COMP1) || \
305                                               ((__SOURCE__) == TIM_BREAKINPUTSOURCE_COMP2) || \
306                                               ((__SOURCE__) == TIM_BREAKINPUTSOURCE_COMP3))
307 #elif defined(COMP1) && defined(COMP2)
308 #define IS_TIM_BREAKINPUTSOURCE(__SOURCE__)  (((__SOURCE__) == TIM_BREAKINPUTSOURCE_BKIN)  || \
309                                               ((__SOURCE__) == TIM_BREAKINPUTSOURCE_COMP1) || \
310                                               ((__SOURCE__) == TIM_BREAKINPUTSOURCE_COMP2))
311 #else
312 #define IS_TIM_BREAKINPUTSOURCE(__SOURCE__)  ((__SOURCE__) == TIM_BREAKINPUTSOURCE_BKIN)
313 #endif /* COMP1 && COMP2 && COMP3 */
314 
315 #define IS_TIM_BREAKINPUTSOURCE_STATE(__STATE__)  (((__STATE__) == TIM_BREAKINPUTSOURCE_DISABLE)  || \
316                                                    ((__STATE__) == TIM_BREAKINPUTSOURCE_ENABLE))
317 
318 #define IS_TIM_BREAKINPUTSOURCE_POLARITY(__POLARITY__)  (((__POLARITY__) == TIM_BREAKINPUTSOURCE_POLARITY_LOW)  || \
319                                                          ((__POLARITY__) == TIM_BREAKINPUTSOURCE_POLARITY_HIGH))
320 
321 #define IS_TIM_TISEL(__TISEL__) ((((__TISEL__) & 0xF0F0F0F0U) == 0x00000000U))
322 
323 /**
324   * @}
325   */
326 /* End of private macro ------------------------------------------------------*/
327 
328 /* Exported functions --------------------------------------------------------*/
329 /** @addtogroup TIMEx_Exported_Functions TIM Extended Exported Functions
330   * @{
331   */
332 
333 /** @addtogroup TIMEx_Exported_Functions_Group1 Extended Timer Hall Sensor functions
334   *  @brief    Timer Hall Sensor functions
335   * @{
336   */
337 /*  Timer Hall Sensor functions  **********************************************/
338 HAL_StatusTypeDef HAL_TIMEx_HallSensor_Init(TIM_HandleTypeDef *htim, const TIM_HallSensor_InitTypeDef *sConfig);
339 HAL_StatusTypeDef HAL_TIMEx_HallSensor_DeInit(TIM_HandleTypeDef *htim);
340 
341 void HAL_TIMEx_HallSensor_MspInit(TIM_HandleTypeDef *htim);
342 void HAL_TIMEx_HallSensor_MspDeInit(TIM_HandleTypeDef *htim);
343 
344 /* Blocking mode: Polling */
345 HAL_StatusTypeDef HAL_TIMEx_HallSensor_Start(TIM_HandleTypeDef *htim);
346 HAL_StatusTypeDef HAL_TIMEx_HallSensor_Stop(TIM_HandleTypeDef *htim);
347 /* Non-Blocking mode: Interrupt */
348 HAL_StatusTypeDef HAL_TIMEx_HallSensor_Start_IT(TIM_HandleTypeDef *htim);
349 HAL_StatusTypeDef HAL_TIMEx_HallSensor_Stop_IT(TIM_HandleTypeDef *htim);
350 /* Non-Blocking mode: DMA */
351 HAL_StatusTypeDef HAL_TIMEx_HallSensor_Start_DMA(TIM_HandleTypeDef *htim, uint32_t *pData, uint16_t Length);
352 HAL_StatusTypeDef HAL_TIMEx_HallSensor_Stop_DMA(TIM_HandleTypeDef *htim);
353 /**
354   * @}
355   */
356 
357 /** @addtogroup TIMEx_Exported_Functions_Group2 Extended Timer Complementary Output Compare functions
358   *  @brief   Timer Complementary Output Compare functions
359   * @{
360   */
361 /*  Timer Complementary Output Compare functions  *****************************/
362 /* Blocking mode: Polling */
363 HAL_StatusTypeDef HAL_TIMEx_OCN_Start(TIM_HandleTypeDef *htim, uint32_t Channel);
364 HAL_StatusTypeDef HAL_TIMEx_OCN_Stop(TIM_HandleTypeDef *htim, uint32_t Channel);
365 
366 /* Non-Blocking mode: Interrupt */
367 HAL_StatusTypeDef HAL_TIMEx_OCN_Start_IT(TIM_HandleTypeDef *htim, uint32_t Channel);
368 HAL_StatusTypeDef HAL_TIMEx_OCN_Stop_IT(TIM_HandleTypeDef *htim, uint32_t Channel);
369 
370 /* Non-Blocking mode: DMA */
371 HAL_StatusTypeDef HAL_TIMEx_OCN_Start_DMA(TIM_HandleTypeDef *htim, uint32_t Channel, const uint32_t *pData,
372                                           uint16_t Length);
373 HAL_StatusTypeDef HAL_TIMEx_OCN_Stop_DMA(TIM_HandleTypeDef *htim, uint32_t Channel);
374 /**
375   * @}
376   */
377 
378 /** @addtogroup TIMEx_Exported_Functions_Group3 Extended Timer Complementary PWM functions
379   *  @brief    Timer Complementary PWM functions
380   * @{
381   */
382 /*  Timer Complementary PWM functions  ****************************************/
383 /* Blocking mode: Polling */
384 HAL_StatusTypeDef HAL_TIMEx_PWMN_Start(TIM_HandleTypeDef *htim, uint32_t Channel);
385 HAL_StatusTypeDef HAL_TIMEx_PWMN_Stop(TIM_HandleTypeDef *htim, uint32_t Channel);
386 
387 /* Non-Blocking mode: Interrupt */
388 HAL_StatusTypeDef HAL_TIMEx_PWMN_Start_IT(TIM_HandleTypeDef *htim, uint32_t Channel);
389 HAL_StatusTypeDef HAL_TIMEx_PWMN_Stop_IT(TIM_HandleTypeDef *htim, uint32_t Channel);
390 /* Non-Blocking mode: DMA */
391 HAL_StatusTypeDef HAL_TIMEx_PWMN_Start_DMA(TIM_HandleTypeDef *htim, uint32_t Channel, const uint32_t *pData,
392                                            uint16_t Length);
393 HAL_StatusTypeDef HAL_TIMEx_PWMN_Stop_DMA(TIM_HandleTypeDef *htim, uint32_t Channel);
394 /**
395   * @}
396   */
397 
398 /** @addtogroup TIMEx_Exported_Functions_Group4 Extended Timer Complementary One Pulse functions
399   *  @brief    Timer Complementary One Pulse functions
400   * @{
401   */
402 /*  Timer Complementary One Pulse functions  **********************************/
403 /* Blocking mode: Polling */
404 HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Start(TIM_HandleTypeDef *htim, uint32_t OutputChannel);
405 HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Stop(TIM_HandleTypeDef *htim, uint32_t OutputChannel);
406 
407 /* Non-Blocking mode: Interrupt */
408 HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Start_IT(TIM_HandleTypeDef *htim, uint32_t OutputChannel);
409 HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Stop_IT(TIM_HandleTypeDef *htim, uint32_t OutputChannel);
410 /**
411   * @}
412   */
413 
414 /** @addtogroup TIMEx_Exported_Functions_Group5 Extended Peripheral Control functions
415   *  @brief    Peripheral Control functions
416   * @{
417   */
418 /* Extended Control functions  ************************************************/
419 HAL_StatusTypeDef HAL_TIMEx_ConfigCommutEvent(TIM_HandleTypeDef *htim, uint32_t  InputTrigger,
420                                               uint32_t  CommutationSource);
421 HAL_StatusTypeDef HAL_TIMEx_ConfigCommutEvent_IT(TIM_HandleTypeDef *htim, uint32_t  InputTrigger,
422                                                  uint32_t  CommutationSource);
423 HAL_StatusTypeDef HAL_TIMEx_ConfigCommutEvent_DMA(TIM_HandleTypeDef *htim, uint32_t  InputTrigger,
424                                                   uint32_t  CommutationSource);
425 HAL_StatusTypeDef HAL_TIMEx_MasterConfigSynchronization(TIM_HandleTypeDef *htim,
426                                                         const TIM_MasterConfigTypeDef *sMasterConfig);
427 HAL_StatusTypeDef HAL_TIMEx_ConfigBreakDeadTime(TIM_HandleTypeDef *htim,
428                                                 const TIM_BreakDeadTimeConfigTypeDef *sBreakDeadTimeConfig);
429 HAL_StatusTypeDef HAL_TIMEx_ConfigBreakInput(TIM_HandleTypeDef *htim, uint32_t BreakInput,
430                                              const TIMEx_BreakInputConfigTypeDef *sBreakInputConfig);
431 HAL_StatusTypeDef HAL_TIMEx_GroupChannel5(TIM_HandleTypeDef *htim, uint32_t Channels);
432 HAL_StatusTypeDef HAL_TIMEx_RemapConfig(TIM_HandleTypeDef *htim, uint32_t Remap);
433 HAL_StatusTypeDef  HAL_TIMEx_TISelection(TIM_HandleTypeDef *htim, uint32_t TISelection, uint32_t Channel);
434 
435 HAL_StatusTypeDef HAL_TIMEx_DisarmBreakInput(TIM_HandleTypeDef *htim, uint32_t BreakInput);
436 HAL_StatusTypeDef HAL_TIMEx_ReArmBreakInput(const TIM_HandleTypeDef *htim, uint32_t BreakInput);
437 /**
438   * @}
439   */
440 
441 /** @addtogroup TIMEx_Exported_Functions_Group6 Extended Callbacks functions
442   * @brief    Extended Callbacks functions
443   * @{
444   */
445 /* Extended Callback **********************************************************/
446 void HAL_TIMEx_CommutCallback(TIM_HandleTypeDef *htim);
447 void HAL_TIMEx_CommutHalfCpltCallback(TIM_HandleTypeDef *htim);
448 void HAL_TIMEx_BreakCallback(TIM_HandleTypeDef *htim);
449 void HAL_TIMEx_Break2Callback(TIM_HandleTypeDef *htim);
450 /**
451   * @}
452   */
453 
454 /** @addtogroup TIMEx_Exported_Functions_Group7 Extended Peripheral State functions
455   * @brief    Extended Peripheral State functions
456   * @{
457   */
458 /* Extended Peripheral State functions  ***************************************/
459 HAL_TIM_StateTypeDef HAL_TIMEx_HallSensor_GetState(const TIM_HandleTypeDef *htim);
460 HAL_TIM_ChannelStateTypeDef HAL_TIMEx_GetChannelNState(const TIM_HandleTypeDef *htim,  uint32_t ChannelN);
461 /**
462   * @}
463   */
464 
465 /**
466   * @}
467   */
468 /* End of exported functions -------------------------------------------------*/
469 
470 /* Private functions----------------------------------------------------------*/
471 /** @addtogroup TIMEx_Private_Functions TIM Extended Private Functions
472   * @{
473   */
474 void TIMEx_DMACommutationCplt(DMA_HandleTypeDef *hdma);
475 void TIMEx_DMACommutationHalfCplt(DMA_HandleTypeDef *hdma);
476 /**
477   * @}
478   */
479 /* End of private functions --------------------------------------------------*/
480 
481 /**
482   * @}
483   */
484 
485 /**
486   * @}
487   */
488 
489 #ifdef __cplusplus
490 }
491 #endif
492 
493 
494 #endif /* STM32G0xx_HAL_TIM_EX_H */
495