1 /**
2   ******************************************************************************
3   * @file    stm32h7xx_hal_hrtim.h
4   * @author  MCD Application Team
5   * @brief   Header file of HRTIM HAL module.
6   ******************************************************************************
7   * @attention
8   *
9   * Copyright (c) 2017 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 STM32H7xx_HAL_HRTIM_H
21 #define STM32H7xx_HAL_HRTIM_H
22 
23 #ifdef __cplusplus
24  extern "C" {
25 #endif
26 
27 /* Includes ------------------------------------------------------------------*/
28 #include "stm32h7xx_hal_def.h"
29 
30 #if defined(HRTIM1)
31 /** @addtogroup STM32H7xx_HAL_Driver
32   * @{
33   */
34 
35 /** @addtogroup HRTIM HRTIM
36   * @{
37   */
38 
39 /* Exported types ------------------------------------------------------------*/
40 /** @addtogroup HRTIM_Exported_Constants HRTIM Exported Constants
41   * @{
42   */
43 /** @defgroup HRTIM_Max_Timer HRTIM Max Timer
44   * @{
45   */
46 #define MAX_HRTIM_TIMER 6U
47 /**
48   * @}
49   */
50 /**
51   * @}
52   */
53 
54 /** @defgroup HRTIM_Exported_Types HRTIM Exported Types
55   * @{
56   */
57 
58 /**
59   * @brief  HRTIM Configuration Structure definition - Time base related parameters
60   */
61 typedef struct
62 {
63   uint32_t HRTIMInterruptResquests;  /*!< Specifies which interrupts requests must enabled for the HRTIM instance.
64                                           This parameter can be any combination of  @ref HRTIM_Common_Interrupt_Enable */
65   uint32_t SyncOptions;              /*!< Specifies how the HRTIM instance handles the external synchronization signals.
66                                           The HRTIM instance can be configured to act as a slave (waiting for a trigger
67                                           to be synchronized) or a master (generating a synchronization signal) or both.
68                                           This parameter can be a combination of @ref HRTIM_Synchronization_Options.*/
69   uint32_t SyncInputSource;          /*!< Specifies the external synchronization input source (significant only when
70                                           the HRTIM instance is configured as a slave).
71                                           This parameter can be a value of @ref HRTIM_Synchronization_Input_Source. */
72   uint32_t SyncOutputSource;         /*!< Specifies the source and event to be sent on the external synchronization outputs
73                                          (significant only when the HRTIM instance is configured as a master).
74                                           This parameter can be a value of @ref HRTIM_Synchronization_Output_Source */
75   uint32_t SyncOutputPolarity;       /*!< Specifies the conditioning of the event to be sent on the external synchronization
76                                           outputs (significant only when the HRTIM instance is configured as a master).
77                                           This parameter can be a value of @ref HRTIM_Synchronization_Output_Polarity */
78 } HRTIM_InitTypeDef;
79 
80 /**
81   * @brief  HAL State structures definition
82   */
83 typedef enum
84 {
85   HAL_HRTIM_STATE_RESET            = 0x00U,    /*!< Peripheral is not yet Initialized                  */
86   HAL_HRTIM_STATE_READY            = 0x01U,    /*!< Peripheral Initialized and ready for use           */
87   HAL_HRTIM_STATE_BUSY             = 0x02U,    /*!< an internal process is ongoing                     */
88   HAL_HRTIM_STATE_TIMEOUT          = 0x06U,    /*!< Timeout state                                      */
89   HAL_HRTIM_STATE_ERROR            = 0x07U,    /*!< Error state                                        */
90 #if (USE_HAL_HRTIM_REGISTER_CALLBACKS == 1)
91   HAL_HRTIM_STATE_INVALID_CALLBACK = 0x08U    /*!< Invalid Callback error */
92 #endif /* USE_HAL_HRTIM_REGISTER_CALLBACKS */
93 } HAL_HRTIM_StateTypeDef;
94 
95 /**
96   * @brief HRTIM Timer Structure definition
97   */
98 typedef struct
99 {
100   uint32_t CaptureTrigger1;       /*!< Event(s) triggering capture unit 1.
101                                        When the timer operates in Simple mode, this parameter can be a value of @ref HRTIM_External_Event_Channels.
102                                        When the timer operates in Waveform mode, this parameter can be a combination of @ref HRTIM_Capture_Unit_Trigger. */
103   uint32_t CaptureTrigger2;       /*!< Event(s) triggering capture unit 2.
104                                        When the timer operates in Simple mode, this parameter can be a value of @ref HRTIM_External_Event_Channels.
105                                        When the timer operates in Waveform mode, this parameter can be a combination of @ref HRTIM_Capture_Unit_Trigger. */
106   uint32_t InterruptRequests;     /*!< Interrupts requests enabled for the timer. */
107   uint32_t DMARequests;           /*!< DMA requests enabled for the timer. */
108   uint32_t DMASrcAddress;          /*!< Address of the source address of the DMA transfer. */
109   uint32_t DMADstAddress;          /*!< Address of the destination address of the DMA transfer. */
110   uint32_t DMASize;                /*!< Size of the DMA transfer */
111 } HRTIM_TimerParamTypeDef;
112 
113 /**
114   * @brief  HRTIM Handle Structure definition
115   */
116 #if (USE_HAL_HRTIM_REGISTER_CALLBACKS == 1)
117 typedef struct __HRTIM_HandleTypeDef
118 #else
119 typedef struct
120 #endif /* USE_HAL_HRTIM_REGISTER_CALLBACKS */
121 {
122   HRTIM_TypeDef *              Instance;                     /*!< Register base address */
123 
124   HRTIM_InitTypeDef            Init;                         /*!< HRTIM required parameters */
125 
126   HRTIM_TimerParamTypeDef      TimerParam[MAX_HRTIM_TIMER];  /*!< HRTIM timers - including the master - parameters */
127 
128   HAL_LockTypeDef              Lock;                         /*!< Locking object          */
129 
130   __IO HAL_HRTIM_StateTypeDef  State;                        /*!< HRTIM communication state */
131 
132   DMA_HandleTypeDef *          hdmaMaster;                   /*!< Master timer DMA handle parameters */
133   DMA_HandleTypeDef *          hdmaTimerA;                   /*!< Timer A DMA handle parameters */
134   DMA_HandleTypeDef *          hdmaTimerB;                   /*!< Timer B DMA handle parameters */
135   DMA_HandleTypeDef *          hdmaTimerC;                   /*!< Timer C DMA handle parameters */
136   DMA_HandleTypeDef *          hdmaTimerD;                   /*!< Timer D DMA handle parameters */
137   DMA_HandleTypeDef *          hdmaTimerE;                   /*!< Timer E DMA handle parameters */
138 
139 #if (USE_HAL_HRTIM_REGISTER_CALLBACKS == 1)
140   void (* Fault1Callback)(struct __HRTIM_HandleTypeDef *hhrtim);                               /*!< Fault 1 interrupt callback function pointer                         */
141   void (* Fault2Callback)(struct __HRTIM_HandleTypeDef *hhrtim);                               /*!< Fault 2 interrupt callback function pointer                         */
142   void (* Fault3Callback)(struct __HRTIM_HandleTypeDef *hhrtim);                               /*!< Fault 3 interrupt callback function pointer                         */
143   void (* Fault4Callback)(struct __HRTIM_HandleTypeDef *hhrtim);                               /*!< Fault 4 interrupt callback function pointer                         */
144   void (* Fault5Callback)(struct __HRTIM_HandleTypeDef *hhrtim);                               /*!< Fault 5 interrupt callback function pointer                         */
145   void (* SystemFaultCallback)(struct __HRTIM_HandleTypeDef *hhrtim);                          /*!< System fault interrupt callback function pointer                    */
146   void (* BurstModePeriodCallback)(struct __HRTIM_HandleTypeDef *hhrtim);                      /*!< Burst mode period interrupt callback function pointer               */
147   void (* SynchronizationEventCallback)(struct __HRTIM_HandleTypeDef *hhrtim);                 /*!< Sync Input interrupt callback function pointer                      */
148   void (* ErrorCallback)(struct __HRTIM_HandleTypeDef *hhrtim);                                /*!< DMA error callback function pointer                                 */
149 
150   void (* RegistersUpdateCallback)(struct __HRTIM_HandleTypeDef *hhrtim, uint32_t TimerIdx);   /*!< Timer x Update interrupt callback function pointer                  */
151   void (* RepetitionEventCallback)(struct __HRTIM_HandleTypeDef *hhrtim, uint32_t TimerIdx);   /*!< Timer x Repetition interrupt callback function pointer              */
152   void (* Compare1EventCallback)(struct __HRTIM_HandleTypeDef *hhrtim, uint32_t TimerIdx);     /*!< Timer x Compare 1 match interrupt callback function pointer         */
153   void (* Compare2EventCallback)(struct __HRTIM_HandleTypeDef *hhrtim, uint32_t TimerIdx);     /*!< Timer x Compare 2 match interrupt callback function pointer         */
154   void (* Compare3EventCallback)(struct __HRTIM_HandleTypeDef *hhrtim, uint32_t TimerIdx);     /*!< Timer x Compare 3 match interrupt callback function pointer         */
155   void (* Compare4EventCallback)(struct __HRTIM_HandleTypeDef *hhrtim, uint32_t TimerIdx);     /*!< Timer x Compare 4 match interrupt callback function pointer         */
156   void (* Capture1EventCallback)(struct __HRTIM_HandleTypeDef *hhrtim, uint32_t TimerIdx);     /*!< Timer x Capture 1 interrupts callback function pointer              */
157   void (* Capture2EventCallback)(struct __HRTIM_HandleTypeDef *hhrtim, uint32_t TimerIdx);     /*!< Timer x Capture 2 interrupts callback function pointer              */
158   void (* DelayedProtectionCallback)(struct __HRTIM_HandleTypeDef *hhrtim, uint32_t TimerIdx); /*!< Timer x Delayed protection interrupt callback function pointer      */
159   void (* CounterResetCallback)(struct __HRTIM_HandleTypeDef *hhrtim, uint32_t TimerIdx);      /*!< Timer x counter reset/roll-over interrupt callback function pointer */
160   void (* Output1SetCallback)(struct __HRTIM_HandleTypeDef *hhrtim, uint32_t TimerIdx);        /*!< Timer x output 1 set interrupt callback function pointer            */
161   void (* Output1ResetCallback)(struct __HRTIM_HandleTypeDef *hhrtim, uint32_t TimerIdx);      /*!< Timer x output 1 reset interrupt callback function pointer          */
162   void (* Output2SetCallback)(struct __HRTIM_HandleTypeDef *hhrtim, uint32_t TimerIdx);        /*!< Timer x output 2 set interrupt callback function pointer            */
163   void (* Output2ResetCallback)(struct __HRTIM_HandleTypeDef *hhrtim, uint32_t TimerIdx);      /*!< Timer x output 2 reset interrupt callback function pointer          */
164   void (* BurstDMATransferCallback)(struct __HRTIM_HandleTypeDef *hhrtim, uint32_t TimerIdx);  /*!< Timer x Burst DMA completed interrupt callback function pointer     */
165 
166   void (* MspInitCallback)(struct __HRTIM_HandleTypeDef *hhrtim);                              /*!< HRTIM MspInit callback function pointer                             */
167   void (* MspDeInitCallback)(struct __HRTIM_HandleTypeDef *hhrtim);                            /*!< HRTIM MspInit callback function pointer                             */
168 #endif /* USE_HAL_HRTIM_REGISTER_CALLBACKS */
169 } HRTIM_HandleTypeDef;
170 
171 /**
172   * @brief  Simple output compare mode configuration definition
173   */
174 typedef struct
175 {
176   uint32_t Period;                   /*!< Specifies the timer period.
177                                           The period value must be above 3 periods of the fHRTIM clock.
178                                           Maximum value is = 0xFFDFU */
179   uint32_t RepetitionCounter;        /*!< Specifies the timer repetition period.
180                                           This parameter must be a number between Min_Data = 0x00 and Max_Data = 0xFF. */
181   uint32_t PrescalerRatio;           /*!< Specifies the timer clock prescaler ratio.
182                                           This parameter can be any value of @ref HRTIM_Prescaler_Ratio   */
183   uint32_t Mode;                     /*!< Specifies the counter operating mode.
184                                           This parameter can be any value of @ref HRTIM_Counter_Operating_Mode   */
185 } HRTIM_TimeBaseCfgTypeDef;
186 
187 /**
188   * @brief  Simple output compare mode configuration definition
189   */
190 typedef struct
191 {
192   uint32_t Mode;       /*!< Specifies the output compare mode (toggle, active, inactive).
193                             This parameter can be any value of of @ref HRTIM_Simple_OC_Mode */
194   uint32_t Pulse;      /*!< Specifies the compare value to be loaded into the Compare Register.
195                             The compare value must be above or equal to 3 periods of the fHRTIM clock */
196   uint32_t Polarity;   /*!< Specifies the output polarity.
197                             This parameter can be any value of @ref HRTIM_Output_Polarity */
198   uint32_t IdleLevel;  /*!< Specifies whether the output level is active or inactive when in IDLE state.
199                             This parameter can be any value of @ref HRTIM_Output_IDLE_Level */
200 } HRTIM_SimpleOCChannelCfgTypeDef;
201 
202 /**
203   * @brief  Simple PWM output mode configuration definition
204   */
205 typedef struct
206 {
207   uint32_t Pulse;            /*!< Specifies the compare value to be loaded into the Compare Register.
208                                   The compare value must be above or equal to 3 periods of the fHRTIM clock */
209   uint32_t Polarity;        /*!< Specifies the output polarity.
210                                  This parameter can be any value of @ref HRTIM_Output_Polarity */
211   uint32_t IdleLevel;       /*!< Specifies whether the output level is active or inactive when in IDLE state.
212                                  This parameter can be any value of @ref HRTIM_Output_IDLE_Level */
213 } HRTIM_SimplePWMChannelCfgTypeDef;
214 
215 /**
216   * @brief  Simple capture mode configuration definition
217   */
218 typedef struct
219 {
220   uint32_t Event;             /*!< Specifies the external event triggering the capture.
221                                    This parameter can be any 'EEVx' value of @ref HRTIM_External_Event_Channels */
222   uint32_t EventPolarity;     /*!< Specifies the polarity of the external event (in case of level sensitivity).
223                                    This parameter can be a value of @ref HRTIM_External_Event_Polarity */
224   uint32_t EventSensitivity;  /*!< Specifies the sensitivity of the external event.
225                                    This parameter can be a value of @ref HRTIM_External_Event_Sensitivity */
226   uint32_t EventFilter;       /*!< Defines the frequency used to sample the External Event and the length of the digital filter.
227                                    This parameter can be a value of @ref HRTIM_External_Event_Filter */
228 } HRTIM_SimpleCaptureChannelCfgTypeDef;
229 
230 /**
231   * @brief  Simple One Pulse mode configuration definition
232   */
233 typedef struct
234 {
235   uint32_t Pulse;             /*!< Specifies the compare value to be loaded into the Compare Register.
236                                    The compare value must be above or equal to 3 periods of the fHRTIM clock */
237   uint32_t OutputPolarity;    /*!< Specifies the output polarity.
238                                    This parameter can be any value of @ref HRTIM_Output_Polarity */
239   uint32_t OutputIdleLevel;   /*!< Specifies whether the output level is active or inactive when in IDLE state.
240                                    This parameter can be any value of @ref HRTIM_Output_IDLE_Level */
241   uint32_t Event;             /*!< Specifies the external event triggering the pulse generation.
242                                    This parameter can be any 'EEVx' value of @ref HRTIM_External_Event_Channels */
243   uint32_t EventPolarity;     /*!< Specifies the polarity of the external event (in case of level sensitivity).
244                                    This parameter can be a value of @ref HRTIM_External_Event_Polarity */
245   uint32_t EventSensitivity;  /*!< Specifies the sensitivity of the external event.
246                                    This parameter can be a value of @ref HRTIM_External_Event_Sensitivity. */
247   uint32_t EventFilter;       /*!< Defines the frequency used to sample the External Event and the length of the digital filter.
248                                    This parameter can be a value of @ref HRTIM_External_Event_Filter */
249 } HRTIM_SimpleOnePulseChannelCfgTypeDef;
250 
251 /**
252   * @brief  Timer configuration definition
253   */
254 typedef struct
255 {
256   uint32_t InterruptRequests;      /*!< Relevant for all HRTIM timers, including the master.
257                                        Specifies which interrupts requests must enabled for the timer.
258                                        This parameter can be any combination of  @ref HRTIM_Master_Interrupt_Enable
259                                        or @ref HRTIM_Timing_Unit_Interrupt_Enable */
260   uint32_t DMARequests;            /*!< Relevant for all HRTIM timers, including the master.
261                                        Specifies which DMA requests must be enabled for the timer.
262                                        This parameter can be any combination of  @ref HRTIM_Master_DMA_Request_Enable
263                                        or @ref HRTIM_Timing_Unit_DMA_Request_Enable */
264   uint32_t DMASrcAddress;          /*!< Relevant for all HRTIM timers, including the master.
265                                        Specifies the address of the source address of the DMA transfer */
266   uint32_t DMADstAddress;          /*!< Relevant for all HRTIM timers, including the master.
267                                        Specifies the address of the destination address of the DMA transfer */
268   uint32_t DMASize;                /*!< Relevant for all HRTIM timers, including the master.
269                                        Specifies the size of the DMA transfer */
270   uint32_t HalfModeEnable;         /*!< Relevant for all HRTIM timers, including the master.
271                                         Specifies whether or not half mode is enabled
272                                         This parameter can be any value of @ref HRTIM_Half_Mode_Enable  */
273   uint32_t StartOnSync;            /*!< Relevant for all HRTIM timers, including the master.
274                                        Specifies whether or not timer is reset by a rising edge on the synchronization input (when enabled).
275                                         This parameter can be any value of @ref HRTIM_Start_On_Sync_Input_Event  */
276   uint32_t ResetOnSync;            /*!< Relevant for all HRTIM timers, including the master.
277                                         Specifies whether or not timer is reset by a rising edge on the synchronization input (when enabled).
278                                         This parameter can be any value of @ref HRTIM_Reset_On_Sync_Input_Event  */
279   uint32_t DACSynchro;             /*!< Relevant for all HRTIM timers, including the master.
280                                         Indicates whether or not the a DAC synchronization event is generated.
281                                         This parameter can be any value of @ref HRTIM_DAC_Synchronization   */
282   uint32_t PreloadEnable;          /*!< Relevant for all HRTIM timers, including the master.
283                                         Specifies whether or not register preload is enabled.
284                                         This parameter can be any value of @ref HRTIM_Register_Preload_Enable  */
285   uint32_t UpdateGating;           /*!< Relevant for all HRTIM timers, including the master.
286                                         Specifies how the update occurs with respect to a burst DMA transaction or
287                                         update enable inputs (Slave timers only).
288                                         This parameter can be any value of @ref HRTIM_Update_Gating   */
289   uint32_t BurstMode;              /*!< Relevant for all HRTIM timers, including the master.
290                                         Specifies how the timer behaves during a burst mode operation.
291                                         This parameter can be any value of @ref HRTIM_Timer_Burst_Mode  */
292   uint32_t RepetitionUpdate;       /*!< Relevant for all HRTIM timers, including the master.
293                                         Specifies whether or not registers update is triggered by the repetition event.
294                                         This parameter can be any value of @ref HRTIM_Timer_Repetition_Update */
295   uint32_t PushPull;               /*!< Relevant for Timer A to Timer E.
296                                         Specifies whether or not the push-pull mode is enabled.
297                                         This parameter can be any value of @ref HRTIM_Timer_Push_Pull_Mode */
298   uint32_t FaultEnable;            /*!< Relevant for Timer A to Timer E.
299                                         Specifies which fault channels are enabled for the timer.
300                                         This parameter can be a combination of @ref HRTIM_Timer_Fault_Enabling  */
301   uint32_t FaultLock;              /*!< Relevant for Timer A to Timer E.
302                                         Specifies whether or not fault enabling status is write protected.
303                                         This parameter can be a value of @ref HRTIM_Timer_Fault_Lock */
304   uint32_t DeadTimeInsertion;      /*!< Relevant for Timer A to Timer E.
305                                         Specifies whether or not dead-time insertion is enabled for the timer.
306                                         This parameter can be a value of @ref HRTIM_Timer_Deadtime_Insertion */
307   uint32_t DelayedProtectionMode;  /*!< Relevant for Timer A to Timer E.
308                                         Specifies the delayed protection mode.
309                                         This parameter can be a value of @ref HRTIM_Timer_Delayed_Protection_Mode */
310   uint32_t UpdateTrigger;          /*!< Relevant for Timer A to Timer E.
311                                         Specifies source(s) triggering the timer registers update.
312                                         This parameter can be a combination of @ref HRTIM_Timer_Update_Trigger */
313   uint32_t ResetTrigger;           /*!< Relevant for Timer A to Timer E.
314                                         Specifies source(s) triggering the timer counter reset.
315                                         This parameter can be a combination of @ref HRTIM_Timer_Reset_Trigger */
316   uint32_t ResetUpdate;           /*!<  Relevant for Timer A to Timer E.
317                                         Specifies whether or not registers update is triggered when the timer counter is reset.
318                                         This parameter can be a value of @ref HRTIM_Timer_Reset_Update */
319 } HRTIM_TimerCfgTypeDef;
320 
321 /**
322   * @brief  Compare unit configuration definition
323   */
324 typedef struct
325 {
326   uint32_t CompareValue;         /*!< Specifies the compare value of the timer compare unit.
327                                       The minimum value must be greater than or equal to 3 periods of the fHRTIM clock.
328                                       The maximum value must be less than or equal to 0xFFFFU - 1 periods of the fHRTIM clock */
329   uint32_t AutoDelayedMode;      /*!< Specifies the auto delayed mode for compare unit 2 or 4.
330                                       This parameter can be a value of @ref HRTIM_Compare_Unit_Auto_Delayed_Mode */
331   uint32_t AutoDelayedTimeout;   /*!< Specifies compare value for timing unit 1 or 3 when auto delayed mode with time out is selected.
332                                       CompareValue +  AutoDelayedTimeout must be less than 0xFFFFU */
333 } HRTIM_CompareCfgTypeDef;
334 
335 /**
336   * @brief  Capture unit configuration definition
337   */
338 typedef struct
339 {
340   uint32_t Trigger;          /*!< Specifies source(s) triggering the capture.
341                                   This parameter can be a combination of @ref HRTIM_Capture_Unit_Trigger */
342 } HRTIM_CaptureCfgTypeDef;
343 
344 /**
345   * @brief  Output configuration definition
346   */
347 typedef struct
348 {
349   uint32_t Polarity;                    /*!< Specifies the output polarity.
350                                              This parameter can be any value of @ref HRTIM_Output_Polarity */
351   uint32_t SetSource;                   /*!< Specifies the event(s) transitioning the output from its inactive level to its active level.
352                                              This parameter can be a combination of @ref HRTIM_Output_Set_Source */
353   uint32_t ResetSource;                 /*!< Specifies the event(s) transitioning the output from its active level to its inactive level.
354                                              This parameter can be a combination of @ref HRTIM_Output_Reset_Source */
355   uint32_t IdleMode;                    /*!< Specifies whether or not the output is affected by a burst mode operation.
356                                              This parameter can be any value of @ref HRTIM_Output_Idle_Mode */
357   uint32_t IdleLevel;                   /*!< Specifies whether the output level is active or inactive when in IDLE state.
358                                              This parameter can be any value of @ref HRTIM_Output_IDLE_Level */
359   uint32_t FaultLevel;                  /*!< Specifies whether the output level is active or inactive when in FAULT state.
360                                              This parameter can be any value of @ref HRTIM_Output_FAULT_Level */
361   uint32_t ChopperModeEnable;           /*!< Indicates whether or not the chopper mode is enabled
362                                              This parameter can be any value of @ref HRTIM_Output_Chopper_Mode_Enable */
363   uint32_t BurstModeEntryDelayed;       /*!< Indicates whether or not dead-time is inserted when entering the IDLE state during a burst mode operation.
364                                              This parameters can be any value of @ref HRTIM_Output_Burst_Mode_Entry_Delayed */
365 } HRTIM_OutputCfgTypeDef;
366 
367 /**
368   * @brief  External event filtering in timing units configuration definition
369   */
370 typedef struct
371 {
372   uint32_t Filter;       /*!< Specifies the type of event filtering within the timing unit.
373                              This parameter can be a value of @ref HRTIM_Timer_External_Event_Filter */
374   uint32_t Latch;       /*!< Specifies whether or not the signal is latched.
375                              This parameter can be a value of @ref HRTIM_Timer_External_Event_Latch */
376 } HRTIM_TimerEventFilteringCfgTypeDef;
377 
378 /**
379   * @brief  Dead time feature configuration definition
380   */
381 typedef struct
382 {
383   uint32_t Prescaler;        /*!< Specifies the dead-time prescaler.
384                                   This parameter can be a value of @ref  HRTIM_Deadtime_Prescaler_Ratio */
385   uint32_t RisingValue;      /*!< Specifies the dead-time following a rising edge.
386                                   This parameter can be a number between 0x0 and 0x1FFU */
387   uint32_t RisingSign;       /*!< Specifies whether the dead-time is positive or negative on rising edge.
388                                   This parameter can be a value of @ref HRTIM_Deadtime_Rising_Sign */
389   uint32_t RisingLock;       /*!< Specifies whether or not dead-time rising settings (value and sign) are write protected.
390                                   This parameter can be a value of @ref HRTIM_Deadtime_Rising_Lock */
391   uint32_t RisingSignLock;   /*!< Specifies whether or not dead-time rising sign is write protected.
392                                   This parameter can be a value of @ref HRTIM_Deadtime_Rising_Sign_Lock */
393   uint32_t FallingValue;     /*!< Specifies the dead-time following a falling edge.
394                                   This parameter can be a number between 0x0 and 0x1FFU */
395   uint32_t FallingSign;      /*!< Specifies whether the dead-time is positive or negative on falling edge.
396                                   This parameter can be a value of @ref HRTIM_Deadtime_Falling_Sign */
397   uint32_t FallingLock;      /*!< Specifies whether or not dead-time falling settings (value and sign) are write protected.
398                                   This parameter can be a value of @ref HRTIM_Deadtime_Falling_Lock */
399   uint32_t FallingSignLock;  /*!< Specifies whether or not dead-time falling sign is write protected.
400                                   This parameter can be a value of @ref HRTIM_Deadtime_Falling_Sign_Lock */
401 } HRTIM_DeadTimeCfgTypeDef;
402 
403 /**
404   * @brief  Chopper mode configuration definition
405   */
406 typedef struct
407 {
408   uint32_t CarrierFreq;  /*!< Specifies the Timer carrier frequency value.
409                               This parameter can be a value of @ref HRTIM_Chopper_Frequency */
410   uint32_t DutyCycle;    /*!< Specifies the Timer chopper duty cycle value.
411                               This parameter can be a value of @ref HRTIM_Chopper_Duty_Cycle */
412   uint32_t StartPulse;   /*!< Specifies the Timer pulse width value.
413                               This parameter can be a value of @ref HRTIM_Chopper_Start_Pulse_Width */
414 } HRTIM_ChopperModeCfgTypeDef;
415 
416 /**
417   * @brief  External event channel configuration definition
418   */
419 typedef struct
420 {
421   uint32_t Source;        /*!< Identifies the source of the external event.
422                                This parameter can be a value of @ref HRTIM_External_Event_Sources */
423   uint32_t Polarity;      /*!< Specifies the polarity of the external event (in case of level sensitivity).
424                                This parameter can be a value of @ref HRTIM_External_Event_Polarity */
425   uint32_t Sensitivity;   /*!< Specifies the sensitivity of the external event.
426                                This parameter can be a value of @ref HRTIM_External_Event_Sensitivity */
427   uint32_t Filter;        /*!< Defines the frequency used to sample the External Event and the length of the digital filter.
428                                This parameter can be a value of @ref HRTIM_External_Event_Filter */
429   uint32_t FastMode;      /*!< Indicates whether or not low latency mode is enabled for the external event.
430                                This parameter can be a value of @ref HRTIM_External_Event_Fast_Mode */
431 } HRTIM_EventCfgTypeDef;
432 
433 /**
434   * @brief  Fault channel configuration definition
435   */
436 typedef struct
437 {
438   uint32_t Source;        /*!< Identifies the source of the fault.
439                                This parameter can be a value of @ref HRTIM_Fault_Sources */
440   uint32_t Polarity;      /*!< Specifies the polarity of the fault event.
441                                This parameter can be a value of @ref HRTIM_Fault_Polarity */
442   uint32_t Filter;        /*!< Defines the frequency used to sample the Fault input and the length of the digital filter.
443                                This parameter can be a value of @ref HRTIM_Fault_Filter */
444   uint32_t Lock;          /*!< Indicates whether or not fault programming bits are write protected.
445                                This parameter can be a value of @ref HRTIM_Fault_Lock */
446 } HRTIM_FaultCfgTypeDef;
447 
448 /**
449   * @brief  Burst mode configuration definition
450   */
451 typedef struct
452 {
453   uint32_t Mode;           /*!< Specifies the burst mode operating mode.
454                                 This parameter can be a value of @ref HRTIM_Burst_Mode_Operating_Mode */
455   uint32_t ClockSource;    /*!< Specifies the burst mode clock source.
456                                 This parameter can be a value of @ref HRTIM_Burst_Mode_Clock_Source */
457   uint32_t Prescaler;      /*!< Specifies the burst mode prescaler.
458                                 This parameter can be a value of @ref HRTIM_Burst_Mode_Prescaler */
459   uint32_t PreloadEnable;  /*!< Specifies whether or not preload is enabled for burst mode related registers (HRTIM_BMCMPR and HRTIM_BMPER).
460                                 This parameter can be a combination of @ref HRTIM_Burst_Mode_Register_Preload_Enable  */
461   uint32_t Trigger;        /*!< Specifies the event(s) triggering the burst operation.
462                                 This parameter can be a combination of @ref HRTIM_Burst_Mode_Trigger  */
463   uint32_t IdleDuration;   /*!< Specifies number of periods during which the selected timers are in idle state.
464                                 This parameter can be a number between 0x0 and 0xFFFF  */
465   uint32_t Period;         /*!< Specifies burst mode repetition period.
466                                 This parameter can be a number between 0x1 and 0xFFFF  */
467 } HRTIM_BurstModeCfgTypeDef;
468 
469 /**
470   * @brief  ADC trigger configuration definition
471   */
472 typedef struct
473 {
474   uint32_t UpdateSource;  /*!< Specifies the ADC trigger update source.
475                                This parameter can be a value of @ref HRTIM_ADC_Trigger_Update_Source  */
476   uint32_t Trigger;       /*!< Specifies the event(s) triggering the ADC conversion.
477                                This parameter can be a combination of @ref HRTIM_ADC_Trigger_Event  */
478 } HRTIM_ADCTriggerCfgTypeDef;
479 
480 #if (USE_HAL_HRTIM_REGISTER_CALLBACKS == 1)
481 /**
482   * @brief  HAL HRTIM Callback ID enumeration definition
483   */
484 typedef enum {
485   HAL_HRTIM_FAULT1CALLBACK_CB_ID               = 0x00U, /*!< Fault 1 interrupt callback ID                         */
486   HAL_HRTIM_FAULT2CALLBACK_CB_ID               = 0x01U, /*!< Fault 2 interrupt callback ID                         */
487   HAL_HRTIM_FAULT3CALLBACK_CB_ID               = 0x02U, /*!< Fault 3 interrupt callback ID                         */
488   HAL_HRTIM_FAULT4CALLBACK_CB_ID               = 0x03U, /*!< Fault 4 interrupt callback ID                         */
489   HAL_HRTIM_FAULT5CALLBACK_CB_ID               = 0x04U, /*!< Fault 5 interrupt callback ID                         */
490   HAL_HRTIM_SYSTEMFAULTCALLBACK_CB_ID          = 0x05U, /*!< System fault interrupt callback ID                    */
491   HAL_HRTIM_BURSTMODEPERIODCALLBACK_CB_ID      = 0x07U, /*!< Burst mode period interrupt callback ID               */
492   HAL_HRTIM_SYNCHRONIZATIONEVENTCALLBACK_CB_ID = 0x08U, /*!< Sync Input interrupt callback ID                      */
493   HAL_HRTIM_ERRORCALLBACK_CB_ID                = 0x09U, /*!< DMA error callback ID                                 */
494 
495   HAL_HRTIM_REGISTERSUPDATECALLBACK_CB_ID      = 0x10U, /*!< Timer x Update interrupt callback ID                  */
496   HAL_HRTIM_REPETITIONEVENTCALLBACK_CB_ID      = 0x11U, /*!< Timer x Repetition interrupt callback ID              */
497   HAL_HRTIM_COMPARE1EVENTCALLBACK_CB_ID        = 0x12U, /*!< Timer x Compare 1 match interrupt callback ID         */
498   HAL_HRTIM_COMPARE2EVENTCALLBACK_CB_ID        = 0x13U, /*!< Timer x Compare 2 match interrupt callback ID         */
499   HAL_HRTIM_COMPARE3EVENTCALLBACK_CB_ID        = 0x14U, /*!< Timer x Compare 3 match interrupt callback ID         */
500   HAL_HRTIM_COMPARE4EVENTCALLBACK_CB_ID        = 0x15U, /*!< Timer x Compare 4 match interrupt callback ID         */
501   HAL_HRTIM_CAPTURE1EVENTCALLBACK_CB_ID        = 0x16U, /*!< Timer x Capture 1 interrupts callback ID              */
502   HAL_HRTIM_CAPTURE2EVENTCALLBACK_CB_ID        = 0x17U, /*!< Timer x Capture 2 interrupts callback ID              */
503   HAL_HRTIM_DELAYEDPROTECTIONCALLBACK_CB_ID    = 0x18U, /*!< Timer x Delayed protection interrupt callback ID      */
504   HAL_HRTIM_COUNTERRESETCALLBACK_CB_ID         = 0x19U, /*!< Timer x counter reset/roll-over interrupt callback ID */
505   HAL_HRTIM_OUTPUT1SETCALLBACK_CB_ID           = 0x1AU, /*!< Timer x output 1 set interrupt callback ID            */
506   HAL_HRTIM_OUTPUT1RESETCALLBACK_CB_ID         = 0x1BU, /*!< Timer x output 1 reset interrupt callback ID          */
507   HAL_HRTIM_OUTPUT2SETCALLBACK_CB_ID           = 0x1CU, /*!< Timer x output 2 set interrupt callback ID            */
508   HAL_HRTIM_OUTPUT2RESETCALLBACK_CB_ID         = 0x1DU, /*!< Timer x output 2 reset interrupt callback ID          */
509   HAL_HRTIM_BURSTDMATRANSFERCALLBACK_CB_ID     = 0x1EU, /*!< Timer x Burst DMA completed interrupt callback ID     */
510 
511   HAL_HRTIM_MSPINIT_CB_ID                      = 0x20U, /*!< HRTIM MspInit callback ID                             */
512   HAL_HRTIM_MSPDEINIT_CB_ID                    = 0x21U, /*!< HRTIM MspInit callback ID                             */
513 }HAL_HRTIM_CallbackIDTypeDef;
514 
515 /**
516   * @brief  HAL HRTIM Callback function pointer definitions
517   */
518 typedef void (* pHRTIM_CallbackTypeDef)(HRTIM_HandleTypeDef *hhrtim);       /*!< HRTIM related callback function pointer         */
519 
520 typedef void (* pHRTIM_TIMxCallbackTypeDef)(HRTIM_HandleTypeDef *hhrtim,    /*!< HRTIM Timer x related callback function pointer */
521                                             uint32_t TimerIdx);
522 #endif /* USE_HAL_HRTIM_REGISTER_CALLBACKS */
523 
524 /**
525   * @}
526   */
527 
528 /* Exported constants --------------------------------------------------------*/
529 /** @defgroup HRTIM_Exported_Constants HRTIM Exported Constants
530   * @{
531   */
532 
533 /** @defgroup HRTIM_Timer_Index HRTIM Timer Index
534   * @{
535   * @brief Constants defining the timer indexes
536   */
537 #define HRTIM_TIMERINDEX_TIMER_A 0x0U   /*!< Index used to access timer A registers */
538 #define HRTIM_TIMERINDEX_TIMER_B 0x1U   /*!< Index used to access timer B registers */
539 #define HRTIM_TIMERINDEX_TIMER_C 0x2U   /*!< Index used to access timer C registers */
540 #define HRTIM_TIMERINDEX_TIMER_D 0x3U   /*!< Index used to access timer D registers */
541 #define HRTIM_TIMERINDEX_TIMER_E 0x4U   /*!< Index used to access timer E registers */
542 #define HRTIM_TIMERINDEX_MASTER  0x5U   /*!< Index used to access master registers  */
543 #define HRTIM_TIMERINDEX_COMMON  0xFFU  /*!< Index used to access HRTIM common registers */
544 /**
545   * @}
546   */
547 
548 /** @defgroup HRTIM_Timer_identifier HRTIM Timer identifier
549   * @{
550   * @brief Constants defining timer identifiers
551   */
552 #define HRTIM_TIMERID_MASTER  (HRTIM_MCR_MCEN)   /*!< Master identifier  */
553 #define HRTIM_TIMERID_TIMER_A (HRTIM_MCR_TACEN)  /*!< Timer A identifier */
554 #define HRTIM_TIMERID_TIMER_B (HRTIM_MCR_TBCEN)  /*!< Timer B identifier */
555 #define HRTIM_TIMERID_TIMER_C (HRTIM_MCR_TCCEN)  /*!< Timer C identifier */
556 #define HRTIM_TIMERID_TIMER_D (HRTIM_MCR_TDCEN)  /*!< Timer D identifier */
557 #define HRTIM_TIMERID_TIMER_E (HRTIM_MCR_TECEN)  /*!< Timer E identifier */
558 /**
559  * @}
560  */
561 
562 /** @defgroup HRTIM_Compare_Unit HRTIM Compare Unit
563   * @{
564   * @brief Constants defining compare unit identifiers
565   */
566 #define HRTIM_COMPAREUNIT_1 0x00000001U  /*!< Compare unit 1 identifier */
567 #define HRTIM_COMPAREUNIT_2 0x00000002U  /*!< Compare unit 2 identifier */
568 #define HRTIM_COMPAREUNIT_3 0x00000004U  /*!< Compare unit 3 identifier */
569 #define HRTIM_COMPAREUNIT_4 0x00000008U  /*!< Compare unit 4 identifier */
570  /**
571   * @}
572   */
573 
574 /** @defgroup HRTIM_Capture_Unit HRTIM Capture Unit
575   * @{
576   * @brief Constants defining capture unit identifiers
577   */
578 #define HRTIM_CAPTUREUNIT_1 0x00000001U  /*!< Capture unit 1 identifier */
579 #define HRTIM_CAPTUREUNIT_2 0x00000002U  /*!< Capture unit 2 identifier */
580 /**
581   * @}
582   */
583 
584 /** @defgroup HRTIM_Timer_Output HRTIM Timer Output
585   * @{
586   * @brief Constants defining timer output identifiers
587   */
588 #define HRTIM_OUTPUT_TA1  0x00000001U  /*!< Timer A - Output 1 identifier */
589 #define HRTIM_OUTPUT_TA2  0x00000002U  /*!< Timer A - Output 2 identifier */
590 #define HRTIM_OUTPUT_TB1  0x00000004U  /*!< Timer B - Output 1 identifier */
591 #define HRTIM_OUTPUT_TB2  0x00000008U  /*!< Timer B - Output 2 identifier */
592 #define HRTIM_OUTPUT_TC1  0x00000010U  /*!< Timer C - Output 1 identifier */
593 #define HRTIM_OUTPUT_TC2  0x00000020U  /*!< Timer C - Output 2 identifier */
594 #define HRTIM_OUTPUT_TD1  0x00000040U  /*!< Timer D - Output 1 identifier */
595 #define HRTIM_OUTPUT_TD2  0x00000080U  /*!< Timer D - Output 2 identifier */
596 #define HRTIM_OUTPUT_TE1  0x00000100U  /*!< Timer E - Output 1 identifier */
597 #define HRTIM_OUTPUT_TE2  0x00000200U  /*!< Timer E - Output 2 identifier */
598 /**
599   * @}
600   */
601 
602 /** @defgroup HRTIM_ADC_Trigger HRTIM ADC Trigger
603   * @{
604   * @brief Constants defining ADC triggers identifiers
605   */
606 #define HRTIM_ADCTRIGGER_1  0x00000001U  /*!< ADC trigger 1 identifier */
607 #define HRTIM_ADCTRIGGER_2  0x00000002U  /*!< ADC trigger 2 identifier */
608 #define HRTIM_ADCTRIGGER_3  0x00000004U  /*!< ADC trigger 3 identifier */
609 #define HRTIM_ADCTRIGGER_4  0x00000008U  /*!< ADC trigger 4 identifier */
610 
611 #define IS_HRTIM_ADCTRIGGER(ADCTRIGGER)\
612     (((ADCTRIGGER) == HRTIM_ADCTRIGGER_1)   || \
613      ((ADCTRIGGER) == HRTIM_ADCTRIGGER_2)   || \
614      ((ADCTRIGGER) == HRTIM_ADCTRIGGER_3)   || \
615      ((ADCTRIGGER) == HRTIM_ADCTRIGGER_4))
616 /**
617   * @}
618   */
619 /** @defgroup HRTIM_External_Event_Channels HRTIM External Event Channels
620   * @{
621   * @brief Constants defining external event channel identifiers
622   */
623 #define HRTIM_EVENT_NONE    (0x00000000U)     /*!< Undefined event channel */
624 #define HRTIM_EVENT_1       (0x00000001U)     /*!< External event channel 1  identifier */
625 #define HRTIM_EVENT_2       (0x00000002U)     /*!< External event channel 2  identifier */
626 #define HRTIM_EVENT_3       (0x00000003U)     /*!< External event channel 3  identifier */
627 #define HRTIM_EVENT_4       (0x00000004U)     /*!< External event channel 4  identifier */
628 #define HRTIM_EVENT_5       (0x00000005U)     /*!< External event channel 5  identifier */
629 #define HRTIM_EVENT_6       (0x00000006U)     /*!< External event channel 6  identifier */
630 #define HRTIM_EVENT_7       (0x00000007U)     /*!< External event channel 7  identifier */
631 #define HRTIM_EVENT_8       (0x00000008U)     /*!< External event channel 8  identifier */
632 #define HRTIM_EVENT_9       (0x00000009U)     /*!< External event channel 9  identifier */
633 #define HRTIM_EVENT_10      (0x0000000AU)     /*!< External event channel 10 identifier */
634 /**
635   * @}
636   */
637 
638 /** @defgroup HRTIM_Fault_Channel HRTIM Fault Channel
639   * @{
640   * @brief Constants defining fault channel identifiers
641   */
642 #define HRTIM_FAULT_1      (0x01U)     /*!< Fault channel 1 identifier */
643 #define HRTIM_FAULT_2      (0x02U)     /*!< Fault channel 2 identifier */
644 #define HRTIM_FAULT_3      (0x04U)     /*!< Fault channel 3 identifier */
645 #define HRTIM_FAULT_4      (0x08U)     /*!< Fault channel 4 identifier */
646 #define HRTIM_FAULT_5      (0x10U)     /*!< Fault channel 5 identifier */
647 /**
648   * @}
649   */
650 
651 
652  /** @defgroup HRTIM_Prescaler_Ratio HRTIM Prescaler Ratio
653   * @{
654   * @brief Constants defining timer high-resolution clock prescaler ratio.
655   */
656 #define HRTIM_PRESCALERRATIO_DIV1     (0x00000005U)  /*!< fHRCK: fHRTIM = 144 MHz - Resolution: 6.95 ns - Min PWM frequency: 2.2 kHz (fHRTIM=144MHz)         */
657 #define HRTIM_PRESCALERRATIO_DIV2     (0x00000006U)  /*!< fHRCK: fHRTIM / 2U = 72 MHz - Resolution: 13.88 ns- Min PWM frequency: 1.1 kHz (fHRTIM=144MHz)     */
658 #define HRTIM_PRESCALERRATIO_DIV4     (0x00000007U)  /*!< fHRCK: fHRTIM / 4U = 36 MHz - Resolution: 27.7 ns- Min PWM frequency: 550Hz (fHRTIM=144MHz)        */
659 /**
660   * @}
661   */
662 
663 /** @defgroup HRTIM_Counter_Operating_Mode HRTIM Counter Operating Mode
664   * @{
665   * @brief Constants defining timer counter operating mode.
666   */
667 #define HRTIM_MODE_CONTINUOUS               (0x00000008U)  /*!< The timer operates in continuous (free-running) mode */
668 #define HRTIM_MODE_SINGLESHOT               (0x00000000U)  /*!< The timer operates in non retriggerable single-shot mode */
669 #define HRTIM_MODE_SINGLESHOT_RETRIGGERABLE (0x00000010U)  /*!< The timer operates in retriggerable single-shot mode */
670 /**
671   * @}
672   */
673 
674 /** @defgroup HRTIM_Half_Mode_Enable HRTIM Half Mode Enable
675   * @{
676   * @brief Constants defining half mode enabling status.
677   */
678 #define HRTIM_HALFMODE_DISABLED (0x00000000U)  /*!< Half mode is disabled */
679 #define HRTIM_HALFMODE_ENABLED  (0x00000020U)  /*!< Half mode is enabled */
680 /**
681   * @}
682   */
683 
684 /** @defgroup HRTIM_Start_On_Sync_Input_Event HRTIM Start On Sync Input Event
685   * @{
686   * @brief Constants defining the timer behavior following the synchronization event
687   */
688 #define HRTIM_SYNCSTART_DISABLED (0x00000000U)           /*!< Synchronization input event has effect on the timer */
689 #define HRTIM_SYNCSTART_ENABLED  (HRTIM_MCR_SYNCSTRTM)   /*!< Synchronization input event starts the timer */
690 /**
691   * @}
692   */
693 
694 /** @defgroup HRTIM_Reset_On_Sync_Input_Event HRTIM Reset On Sync Input Event
695   * @{
696   * @brief Constants defining the timer behavior following the synchronization event
697   */
698 #define HRTIM_SYNCRESET_DISABLED (0x00000000U)           /*!< Synchronization input event has effect on the timer */
699 #define HRTIM_SYNCRESET_ENABLED  (HRTIM_MCR_SYNCRSTM)    /*!< Synchronization input event resets the timer */
700 /**
701   * @}
702   */
703 
704 /** @defgroup HRTIM_DAC_Synchronization HRTIM DAC Synchronization
705   * @{
706   * @brief Constants defining on which output the DAC synchronization event is sent
707   */
708 #define HRTIM_DACSYNC_NONE          0x00000000U                                 /*!< No DAC synchronization event generated */
709 #define HRTIM_DACSYNC_DACTRIGOUT_1  (HRTIM_MCR_DACSYNC_0)                       /*!< DAC synchronization event generated on DACTrigOut1 output upon timer update */
710 #define HRTIM_DACSYNC_DACTRIGOUT_2  (HRTIM_MCR_DACSYNC_1)                       /*!< DAC synchronization event generated on DACTrigOut2 output upon timer update */
711 #define HRTIM_DACSYNC_DACTRIGOUT_3  (HRTIM_MCR_DACSYNC_1 | HRTIM_MCR_DACSYNC_0) /*!< DAC update generated on DACTrigOut3 output upon timer update */
712 /**
713   * @}
714   */
715 
716 /** @defgroup HRTIM_Register_Preload_Enable HRTIM Register Preload Enable
717   * @{
718   * @brief Constants defining whether a write access into a preloadable
719   *        register is done into the active or the preload register.
720   */
721 #define HRTIM_PRELOAD_DISABLED (0x00000000U)           /*!< Preload disabled: the write access is directly done into the active register */
722 #define HRTIM_PRELOAD_ENABLED  (HRTIM_MCR_PREEN)       /*!< Preload enabled: the write access is done into the preload register */
723 /**
724   * @}
725   */
726 
727 /** @defgroup HRTIM_Update_Gating HRTIM Update Gating
728   * @{
729   * @brief Constants defining how the update occurs relatively to the burst DMA
730   *        transaction and the external update request on update enable inputs 1 to 3.
731   */
732 #define HRTIM_UPDATEGATING_INDEPENDENT     0x00000000U                                                           /*!< Update done independently from the DMA burst transfer completion */
733 #define HRTIM_UPDATEGATING_DMABURST        (HRTIM_TIMCR_UPDGAT_0)                                                /*!< Update done when the DMA burst transfer is completed */
734 #define HRTIM_UPDATEGATING_DMABURST_UPDATE (HRTIM_TIMCR_UPDGAT_1)                                                /*!< Update done on timer roll-over following a DMA burst transfer completion*/
735 #define HRTIM_UPDATEGATING_UPDEN1          (HRTIM_TIMCR_UPDGAT_1 | HRTIM_TIMCR_UPDGAT_0)                         /*!< Slave timer only - Update done on a rising edge of HRTIM update enable input 1U */
736 #define HRTIM_UPDATEGATING_UPDEN2          (HRTIM_TIMCR_UPDGAT_2)                                                /*!< Slave timer only - Update done on a rising edge of HRTIM update enable input 2U */
737 #define HRTIM_UPDATEGATING_UPDEN3          (HRTIM_TIMCR_UPDGAT_2 | HRTIM_TIMCR_UPDGAT_0)                         /*!< Slave timer only - Update done on a rising edge of HRTIM update enable input 3U */
738 #define HRTIM_UPDATEGATING_UPDEN1_UPDATE   (HRTIM_TIMCR_UPDGAT_2 | HRTIM_TIMCR_UPDGAT_1)                         /*!< Slave timer only -  Update done on the update event following a rising edge of HRTIM update enable input 1U */
739 #define HRTIM_UPDATEGATING_UPDEN2_UPDATE   (HRTIM_TIMCR_UPDGAT_2 | HRTIM_TIMCR_UPDGAT_1 | HRTIM_TIMCR_UPDGAT_0)  /*!< Slave timer only -  Update done on the update event following a rising edge of HRTIM update enable input 2U */
740 #define HRTIM_UPDATEGATING_UPDEN3_UPDATE   (HRTIM_TIMCR_UPDGAT_3)                                                /*!< Slave timer only -  Update done on the update event following a rising edge of HRTIM update enable input 3U */
741 /**
742   * @}
743   */
744 
745 /** @defgroup HRTIM_Timer_Burst_Mode HRTIM Timer Burst Mode
746   * @{
747   * @brief Constants defining how the timer behaves during a burst
748             mode operation.
749   */
750 #define HRTIM_TIMERBURSTMODE_MAINTAINCLOCK 0x00000000U           /*!< Timer counter clock is maintained and the timer operates normally */
751 #define HRTIM_TIMERBURSTMODE_RESETCOUNTER  (HRTIM_BMCR_MTBM)     /*!< Timer counter clock is stopped and the counter is reset */
752 /**
753   * @}
754   */
755 
756 /** @defgroup HRTIM_Timer_Repetition_Update HRTIM Timer Repetition Update
757   * @{
758   * @brief Constants defining whether registers are updated when the timer
759   *        repetition period is completed (either due to roll-over or
760   *        reset events)
761   */
762 #define HRTIM_UPDATEONREPETITION_DISABLED  0x00000000U           /*!< Update on repetition disabled */
763 #define HRTIM_UPDATEONREPETITION_ENABLED   (HRTIM_MCR_MREPU)     /*!< Update on repetition enabled */
764 /**
765   * @}
766   */
767 
768 
769 /** @defgroup HRTIM_Timer_Push_Pull_Mode HRTIM Timer Push Pull Mode
770   * @{
771   * @brief Constants defining whether or not the push-pull mode is enabled for
772   *        a timer.
773   */
774 #define HRTIM_TIMPUSHPULLMODE_DISABLED     0x00000000U           /*!< Push-Pull mode disabled */
775 #define HRTIM_TIMPUSHPULLMODE_ENABLED      (HRTIM_TIMCR_PSHPLL)  /*!< Push-Pull mode enabled */
776 /**
777   * @}
778   */
779 
780 /** @defgroup HRTIM_Timer_Fault_Enabling HRTIM Timer Fault Enabling
781   * @{
782   * @brief Constants defining whether a fault channel is enabled for a timer
783   */
784 #define HRTIM_TIMFAULTENABLE_NONE     0x00000000U           /*!< No fault enabled */
785 #define HRTIM_TIMFAULTENABLE_FAULT1   (HRTIM_FLTR_FLT1EN)   /*!< Fault 1 enabled */
786 #define HRTIM_TIMFAULTENABLE_FAULT2   (HRTIM_FLTR_FLT2EN)   /*!< Fault 2 enabled */
787 #define HRTIM_TIMFAULTENABLE_FAULT3   (HRTIM_FLTR_FLT3EN)   /*!< Fault 3 enabled */
788 #define HRTIM_TIMFAULTENABLE_FAULT4   (HRTIM_FLTR_FLT4EN)   /*!< Fault 4 enabled */
789 #define HRTIM_TIMFAULTENABLE_FAULT5   (HRTIM_FLTR_FLT5EN)   /*!< Fault 5 enabled */
790 /**
791   * @}
792   */
793 
794 /** @defgroup HRTIM_Timer_Fault_Lock HRTIM Timer Fault Lock
795   * @{
796   * @brief Constants defining whether or not fault enabling bits are write
797   *        protected for a timer
798   */
799 #define HRTIM_TIMFAULTLOCK_READWRITE (0x00000000U)           /*!< Timer fault enabling bits are read/write */
800 #define HRTIM_TIMFAULTLOCK_READONLY  (HRTIM_FLTR_FLTLCK)     /*!< Timer fault enabling bits are read only */
801 /**
802   * @}
803   */
804 
805 /** @defgroup HRTIM_Timer_Deadtime_Insertion HRTIM Timer Dead-time Insertion
806   * @{
807   * @brief Constants defining whether or not fault the dead time insertion
808   *        feature is enabled for a timer
809   */
810 #define HRTIM_TIMDEADTIMEINSERTION_DISABLED   (0x00000000U)           /*!< Output 1 and output 2 signals are independent */
811 #define HRTIM_TIMDEADTIMEINSERTION_ENABLED    HRTIM_OUTR_DTEN         /*!< Dead-time is inserted between output 1 and output 2U */
812 /**
813   * @}
814   */
815 
816 /** @defgroup HRTIM_Timer_Delayed_Protection_Mode HRTIM Timer Delayed Protection Mode
817   * @{
818   * @brief Constants defining all possible delayed protection modes
819   *        for a timer. Also define the source and outputs on which the delayed
820   *        protection schemes are applied
821   */
822 #define HRTIM_TIMER_A_B_C_DELAYEDPROTECTION_DISABLED          (0x00000000U)                                                                           /*!< No action */
823 #define HRTIM_TIMER_A_B_C_DELAYEDPROTECTION_DELAYEDOUT1_EEV6  (HRTIM_OUTR_DLYPRTEN)                                                                   /*!< Timers A, B, C: Output 1 delayed Idle on external Event 6U */
824 #define HRTIM_TIMER_A_B_C_DELAYEDPROTECTION_DELAYEDOUT2_EEV6  (HRTIM_OUTR_DLYPRT_0 | HRTIM_OUTR_DLYPRTEN)                                             /*!< Timers A, B, C: Output 2 delayed Idle on external Event 6U */
825 #define HRTIM_TIMER_A_B_C_DELAYEDPROTECTION_DELAYEDBOTH_EEV6  (HRTIM_OUTR_DLYPRT_1 | HRTIM_OUTR_DLYPRTEN)                                             /*!< Timers A, B, C: Output 1 and output 2 delayed Idle on external Event 6U */
826 #define HRTIM_TIMER_A_B_C_DELAYEDPROTECTION_BALANCED_EEV6     (HRTIM_OUTR_DLYPRT_1 | HRTIM_OUTR_DLYPRT_0 | HRTIM_OUTR_DLYPRTEN)                       /*!< Timers A, B, C: Balanced Idle on external Event 6U */
827 #define HRTIM_TIMER_A_B_C_DELAYEDPROTECTION_DELAYEDOUT1_DEEV7 (HRTIM_OUTR_DLYPRT_2 | HRTIM_OUTR_DLYPRTEN)                                             /*!< Timers A, B, C: Output 1 delayed Idle on external Event 7U */
828 #define HRTIM_TIMER_A_B_C_DELAYEDPROTECTION_DELAYEDOUT2_DEEV7 (HRTIM_OUTR_DLYPRT_2 | HRTIM_OUTR_DLYPRT_0 | HRTIM_OUTR_DLYPRTEN)                       /*!< Timers A, B, C: Output 2 delayed Idle on external Event 7U */
829 #define HRTIM_TIMER_A_B_C_DELAYEDPROTECTION_DELAYEDBOTH_EEV7  (HRTIM_OUTR_DLYPRT_2 | HRTIM_OUTR_DLYPRT_1 | HRTIM_OUTR_DLYPRTEN)                       /*!< Timers A, B, C: Output 1 and output2 delayed Idle on external Event 7U */
830 #define HRTIM_TIMER_A_B_C_DELAYEDPROTECTION_BALANCED_EEV7     (HRTIM_OUTR_DLYPRT_2 | HRTIM_OUTR_DLYPRT_1 | HRTIM_OUTR_DLYPRT_0 | HRTIM_OUTR_DLYPRTEN) /*!< Timers A, B, C: Balanced Idle on external Event 7U */
831 
832 #define HRTIM_TIMER_D_E_DELAYEDPROTECTION_DISABLED            (0x00000000U)                                                                             /*!< No action */
833 #define HRTIM_TIMER_D_E_DELAYEDPROTECTION_DELAYEDOUT1_EEV8    (HRTIM_OUTR_DLYPRTEN)                                                                     /*!< Timers D, E: Output 1 delayed Idle on external Event 6U */
834 #define HRTIM_TIMER_D_E_DELAYEDPROTECTION_DELAYEDOUT2_EEV8    (HRTIM_OUTR_DLYPRT_0 | HRTIM_OUTR_DLYPRTEN)                                               /*!< Timers D, E: Output 2 delayed Idle on external Event 6U */
835 #define HRTIM_TIMER_D_E_DELAYEDPROTECTION_DELAYEDBOTH_EEV8    (HRTIM_OUTR_DLYPRT_1 | HRTIM_OUTR_DLYPRTEN)                                               /*!< Timers D, E: Output 1 and output 2 delayed Idle on external Event 6U */
836 #define HRTIM_TIMER_D_E_DELAYEDPROTECTION_BALANCED_EEV8       (HRTIM_OUTR_DLYPRT_1 | HRTIM_OUTR_DLYPRT_0 | HRTIM_OUTR_DLYPRTEN)                         /*!< Timers D, E: Balanced Idle on external Event 6U */
837 #define HRTIM_TIMER_D_E_DELAYEDPROTECTION_DELAYEDOUT1_DEEV9   (HRTIM_OUTR_DLYPRT_2 | HRTIM_OUTR_DLYPRTEN)                                               /*!< Timers D, E: Output 1 delayed Idle on external Event 7U */
838 #define HRTIM_TIMER_D_E_DELAYEDPROTECTION_DELAYEDOUT2_DEEV9   (HRTIM_OUTR_DLYPRT_2 | HRTIM_OUTR_DLYPRT_0 | HRTIM_OUTR_DLYPRTEN)                         /*!< Timers D, E: Output 2 delayed Idle on external Event 7U */
839 #define HRTIM_TIMER_D_E_DELAYEDPROTECTION_DELAYEDBOTH_EEV9    (HRTIM_OUTR_DLYPRT_2 | HRTIM_OUTR_DLYPRT_1 | HRTIM_OUTR_DLYPRTEN)                         /*!< Timers D, E: Output 1 and output2 delayed Idle on external Event 7U */
840 #define HRTIM_TIMER_D_E_DELAYEDPROTECTION_BALANCED_EEV9       (HRTIM_OUTR_DLYPRT_2 | HRTIM_OUTR_DLYPRT_1 | HRTIM_OUTR_DLYPRT_0 | HRTIM_OUTR_DLYPRTEN)   /*!< Timers D, E: Balanced Idle on external Event 7U */
841 /**
842   * @}
843   */
844 
845 /** @defgroup HRTIM_Timer_Update_Trigger HRTIM Timer Update Trigger
846   * @{
847   * @brief Constants defining whether the registers update is done synchronously
848   *        with any other timer or master update
849   */
850 #define HRTIM_TIMUPDATETRIGGER_NONE     0x00000000U          /*!< Register update is disabled */
851 #define HRTIM_TIMUPDATETRIGGER_MASTER   (HRTIM_TIMCR_MSTU)   /*!< Register update is triggered by the master timer update */
852 #define HRTIM_TIMUPDATETRIGGER_TIMER_A  (HRTIM_TIMCR_TAU)    /*!< Register update is triggered by the timer A update */
853 #define HRTIM_TIMUPDATETRIGGER_TIMER_B  (HRTIM_TIMCR_TBU)    /*!< Register update is triggered by the timer B update */
854 #define HRTIM_TIMUPDATETRIGGER_TIMER_C  (HRTIM_TIMCR_TCU)    /*!< Register update is triggered by the timer C update*/
855 #define HRTIM_TIMUPDATETRIGGER_TIMER_D  (HRTIM_TIMCR_TDU)    /*!< Register update is triggered by the timer D update */
856 #define HRTIM_TIMUPDATETRIGGER_TIMER_E  (HRTIM_TIMCR_TEU)    /*!< Register update is triggered by the timer E update */
857 /**
858   * @}
859   */
860 
861 /** @defgroup HRTIM_Timer_Reset_Trigger HRTIM Timer Reset Trigger
862   * @{
863   * @brief Constants defining the events that can be selected to trigger the reset
864   *        of the timer counter
865   */
866 #define HRTIM_TIMRESETTRIGGER_NONE        0x00000000U            /*!< No counter reset trigger */
867 #define HRTIM_TIMRESETTRIGGER_UPDATE      (HRTIM_RSTR_UPDATE)    /*!< The timer counter is reset upon update event */
868 #define HRTIM_TIMRESETTRIGGER_CMP2        (HRTIM_RSTR_CMP2)      /*!< The timer counter is reset upon Timer Compare 2 event */
869 #define HRTIM_TIMRESETTRIGGER_CMP4        (HRTIM_RSTR_CMP4)      /*!< The timer counter is reset upon Timer Compare 4 event */
870 #define HRTIM_TIMRESETTRIGGER_MASTER_PER  (HRTIM_RSTR_MSTPER)    /*!< The timer counter is reset upon master timer period event */
871 #define HRTIM_TIMRESETTRIGGER_MASTER_CMP1 (HRTIM_RSTR_MSTCMP1)   /*!< The timer counter is reset upon master timer Compare 1 event */
872 #define HRTIM_TIMRESETTRIGGER_MASTER_CMP2 (HRTIM_RSTR_MSTCMP2)   /*!< The timer counter is reset upon master timer Compare 2 event */
873 #define HRTIM_TIMRESETTRIGGER_MASTER_CMP3 (HRTIM_RSTR_MSTCMP3)   /*!< The timer counter is reset upon master timer Compare 3 event */
874 #define HRTIM_TIMRESETTRIGGER_MASTER_CMP4 (HRTIM_RSTR_MSTCMP4)   /*!< The timer counter is reset upon master timer Compare 4 event */
875 #define HRTIM_TIMRESETTRIGGER_EEV_1       (HRTIM_RSTR_EXTEVNT1)  /*!< The timer counter is reset upon external event 1U */
876 #define HRTIM_TIMRESETTRIGGER_EEV_2       (HRTIM_RSTR_EXTEVNT2)  /*!< The timer counter is reset upon external event 2U */
877 #define HRTIM_TIMRESETTRIGGER_EEV_3       (HRTIM_RSTR_EXTEVNT3)  /*!< The timer counter is reset upon external event 3U */
878 #define HRTIM_TIMRESETTRIGGER_EEV_4       (HRTIM_RSTR_EXTEVNT4)  /*!< The timer counter is reset upon external event 4U */
879 #define HRTIM_TIMRESETTRIGGER_EEV_5       (HRTIM_RSTR_EXTEVNT5)  /*!< The timer counter is reset upon external event 5U */
880 #define HRTIM_TIMRESETTRIGGER_EEV_6       (HRTIM_RSTR_EXTEVNT6)  /*!< The timer counter is reset upon external event 6U */
881 #define HRTIM_TIMRESETTRIGGER_EEV_7       (HRTIM_RSTR_EXTEVNT7)  /*!< The timer counter is reset upon external event 7U */
882 #define HRTIM_TIMRESETTRIGGER_EEV_8       (HRTIM_RSTR_EXTEVNT8)  /*!< The timer counter is reset upon external event 8U */
883 #define HRTIM_TIMRESETTRIGGER_EEV_9       (HRTIM_RSTR_EXTEVNT9)  /*!< The timer counter is reset upon external event 9U */
884 #define HRTIM_TIMRESETTRIGGER_EEV_10      (HRTIM_RSTR_EXTEVNT10) /*!< The timer counter is reset upon external event 10U */
885 #define HRTIM_TIMRESETTRIGGER_OTHER1_CMP1 (HRTIM_RSTR_TIMBCMP1)  /*!< The timer counter is reset upon other timer Compare 1 event */
886 #define HRTIM_TIMRESETTRIGGER_OTHER1_CMP2 (HRTIM_RSTR_TIMBCMP2)  /*!< The timer counter is reset upon other timer Compare 2 event */
887 #define HRTIM_TIMRESETTRIGGER_OTHER1_CMP4 (HRTIM_RSTR_TIMBCMP4)  /*!< The timer counter is reset upon other timer Compare 4 event */
888 #define HRTIM_TIMRESETTRIGGER_OTHER2_CMP1 (HRTIM_RSTR_TIMCCMP1)  /*!< The timer counter is reset upon other timer Compare 1 event */
889 #define HRTIM_TIMRESETTRIGGER_OTHER2_CMP2 (HRTIM_RSTR_TIMCCMP2)  /*!< The timer counter is reset upon other timer Compare 2 event */
890 #define HRTIM_TIMRESETTRIGGER_OTHER2_CMP4 (HRTIM_RSTR_TIMCCMP4)  /*!< The timer counter is reset upon other timer Compare 4 event */
891 #define HRTIM_TIMRESETTRIGGER_OTHER3_CMP1 (HRTIM_RSTR_TIMDCMP1)  /*!< The timer counter is reset upon other timer Compare 1 event */
892 #define HRTIM_TIMRESETTRIGGER_OTHER3_CMP2 (HRTIM_RSTR_TIMDCMP2)  /*!< The timer counter is reset upon other timer Compare 2 event */
893 #define HRTIM_TIMRESETTRIGGER_OTHER3_CMP4 (HRTIM_RSTR_TIMDCMP4)  /*!< The timer counter is reset upon other timer Compare 4 event */
894 #define HRTIM_TIMRESETTRIGGER_OTHER4_CMP1 (HRTIM_RSTR_TIMECMP1)  /*!< The timer counter is reset upon other timer Compare 1 event */
895 #define HRTIM_TIMRESETTRIGGER_OTHER4_CMP2 (HRTIM_RSTR_TIMECMP2)  /*!< The timer counter is reset upon other timer Compare 2 event */
896 #define HRTIM_TIMRESETTRIGGER_OTHER4_CMP4 (HRTIM_RSTR_TIMECMP4)  /*!< The timer counter is reset upon other timer Compare 4 event */
897 /**
898   * @}
899   */
900 
901 /** @defgroup HRTIM_Timer_Reset_Update HRTIM Timer Reset Update
902   * @{
903   * @brief Constants defining whether the register are updated upon Timerx
904   *        counter reset or roll-over to 0 after reaching the period value
905   *        in continuous mode
906   */
907 #define HRTIM_TIMUPDATEONRESET_DISABLED 0x00000000U           /*!< Update by timer x reset / roll-over disabled */
908 #define HRTIM_TIMUPDATEONRESET_ENABLED (HRTIM_TIMCR_TRSTU)    /*!< Update by timer x reset / roll-over enabled */
909 /**
910   * @}
911   */
912 
913 /** @defgroup HRTIM_Compare_Unit_Auto_Delayed_Mode HRTIM Compare Unit Auto Delayed Mode
914   * @{
915   * @brief Constants defining whether the compare register is behaving in
916   *        regular mode (compare match issued as soon as counter equal compare),
917   *        or in auto-delayed mode
918   */
919 #define HRTIM_AUTODELAYEDMODE_REGULAR                 (0x00000000U)                                   /*!< standard compare mode */
920 #define HRTIM_AUTODELAYEDMODE_AUTODELAYED_NOTIMEOUT   (HRTIM_TIMCR_DELCMP2_0)                         /*!< Compare event generated only if a capture has occurred */
921 #define HRTIM_AUTODELAYEDMODE_AUTODELAYED_TIMEOUTCMP1 (HRTIM_TIMCR_DELCMP2_1)                         /*!< Compare event generated if a capture has occurred or after a Compare 1 match (timeout if capture event is missing) */
922 #define HRTIM_AUTODELAYEDMODE_AUTODELAYED_TIMEOUTCMP3 (HRTIM_TIMCR_DELCMP2_1 | HRTIM_TIMCR_DELCMP2_0) /*!< Compare event generated if a capture has occurred or after a Compare 3 match (timeout if capture event is missing) */
923 /**
924   * @}
925   */
926 
927 /** @defgroup HRTIM_Simple_OC_Mode HRTIM Simple OC Mode
928   * @{
929   * @brief Constants defining the behavior of the output signal when the timer
930            operates in basic output compare mode
931   */
932 #define HRTIM_BASICOCMODE_TOGGLE    (0x00000001U)  /*!< Output toggles when the timer counter reaches the compare value */
933 #define HRTIM_BASICOCMODE_INACTIVE  (0x00000002U)  /*!< Output forced to active level when the timer counter reaches the compare value */
934 #define HRTIM_BASICOCMODE_ACTIVE    (0x00000003U)  /*!< Output forced to inactive level when the timer counter reaches the compare value */
935 
936 #define IS_HRTIM_BASICOCMODE(BASICOCMODE)\
937               (((BASICOCMODE) == HRTIM_BASICOCMODE_TOGGLE)   || \
938                ((BASICOCMODE) == HRTIM_BASICOCMODE_INACTIVE) || \
939                ((BASICOCMODE) == HRTIM_BASICOCMODE_ACTIVE))
940 /**
941   * @}
942   */
943 
944 /** @defgroup HRTIM_Output_Polarity HRTIM Output Polarity
945   * @{
946   * @brief Constants defining the polarity of a timer output
947   */
948 #define HRTIM_OUTPUTPOLARITY_HIGH    (0x00000000U)           /*!< Output is active HIGH */
949 #define HRTIM_OUTPUTPOLARITY_LOW     (HRTIM_OUTR_POL1)       /*!< Output is active LOW */
950 /**
951   * @}
952   */
953 
954 /** @defgroup HRTIM_Output_Set_Source HRTIM Output Set Source
955   * @{
956   * @brief Constants defining the events that can be selected to configure the
957   *        set crossbar of a timer output
958   */
959 #define HRTIM_OUTPUTSET_NONE       0x00000000U                      /*!< Reset the output set crossbar */
960 #define HRTIM_OUTPUTSET_RESYNC     (HRTIM_SET1R_RESYNC)             /*!< Timer reset event coming solely from software or SYNC input forces the output to its active state */
961 #define HRTIM_OUTPUTSET_TIMPER     (HRTIM_SET1R_PER)                /*!< Timer period event forces the output to its active state */
962 #define HRTIM_OUTPUTSET_TIMCMP1    (HRTIM_SET1R_CMP1)               /*!< Timer compare 1 event forces the output to its active state */
963 #define HRTIM_OUTPUTSET_TIMCMP2    (HRTIM_SET1R_CMP2)               /*!< Timer compare 2 event forces the output to its active state */
964 #define HRTIM_OUTPUTSET_TIMCMP3    (HRTIM_SET1R_CMP3)               /*!< Timer compare 3 event forces the output to its active state */
965 #define HRTIM_OUTPUTSET_TIMCMP4    (HRTIM_SET1R_CMP4)               /*!< Timer compare 4 event forces the output to its active state */
966 #define HRTIM_OUTPUTSET_MASTERPER  (HRTIM_SET1R_MSTPER)             /*!< The master timer period event forces the output to its active state */
967 #define HRTIM_OUTPUTSET_MASTERCMP1 (HRTIM_SET1R_MSTCMP1)            /*!< Master Timer compare 1 event forces the output to its active state */
968 #define HRTIM_OUTPUTSET_MASTERCMP2 (HRTIM_SET1R_MSTCMP2)            /*!< Master Timer compare 2 event forces the output to its active state */
969 #define HRTIM_OUTPUTSET_MASTERCMP3 (HRTIM_SET1R_MSTCMP3)            /*!< Master Timer compare 3 event forces the output to its active state */
970 #define HRTIM_OUTPUTSET_MASTERCMP4 (HRTIM_SET1R_MSTCMP4)            /*!< Master Timer compare 4 event forces the output to its active state */
971 #define HRTIM_OUTPUTSET_TIMEV_1    (HRTIM_SET1R_TIMEVNT1)           /*!< Timer event 1 forces the output to its active state */
972 #define HRTIM_OUTPUTSET_TIMEV_2    (HRTIM_SET1R_TIMEVNT2)           /*!< Timer event 2 forces the output to its active state */
973 #define HRTIM_OUTPUTSET_TIMEV_3    (HRTIM_SET1R_TIMEVNT3)           /*!< Timer event 3 forces the output to its active state */
974 #define HRTIM_OUTPUTSET_TIMEV_4    (HRTIM_SET1R_TIMEVNT4)           /*!< Timer event 4 forces the output to its active state */
975 #define HRTIM_OUTPUTSET_TIMEV_5    (HRTIM_SET1R_TIMEVNT5)           /*!< Timer event 5 forces the output to its active state */
976 #define HRTIM_OUTPUTSET_TIMEV_6    (HRTIM_SET1R_TIMEVNT6)           /*!< Timer event 6 forces the output to its active state */
977 #define HRTIM_OUTPUTSET_TIMEV_7    (HRTIM_SET1R_TIMEVNT7)           /*!< Timer event 7 forces the output to its active state */
978 #define HRTIM_OUTPUTSET_TIMEV_8    (HRTIM_SET1R_TIMEVNT8)           /*!< Timer event 8 forces the output to its active state */
979 #define HRTIM_OUTPUTSET_TIMEV_9    (HRTIM_SET1R_TIMEVNT9)           /*!< Timer event 9 forces the output to its active state */
980 #define HRTIM_OUTPUTSET_EEV_1      (HRTIM_SET1R_EXTVNT1)            /*!< External event 1 forces the output to its active state */
981 #define HRTIM_OUTPUTSET_EEV_2      (HRTIM_SET1R_EXTVNT2)            /*!< External event 2 forces the output to its active state */
982 #define HRTIM_OUTPUTSET_EEV_3      (HRTIM_SET1R_EXTVNT3)            /*!< External event 3 forces the output to its active state */
983 #define HRTIM_OUTPUTSET_EEV_4      (HRTIM_SET1R_EXTVNT4)            /*!< External event 4 forces the output to its active state */
984 #define HRTIM_OUTPUTSET_EEV_5      (HRTIM_SET1R_EXTVNT5)            /*!< External event 5 forces the output to its active state */
985 #define HRTIM_OUTPUTSET_EEV_6      (HRTIM_SET1R_EXTVNT6)            /*!< External event 6 forces the output to its active state */
986 #define HRTIM_OUTPUTSET_EEV_7      (HRTIM_SET1R_EXTVNT7)            /*!< External event 7 forces the output to its active state */
987 #define HRTIM_OUTPUTSET_EEV_8      (HRTIM_SET1R_EXTVNT8)            /*!< External event 8 forces the output to its active state */
988 #define HRTIM_OUTPUTSET_EEV_9      (HRTIM_SET1R_EXTVNT9)            /*!< External event 9 forces the output to its active state */
989 #define HRTIM_OUTPUTSET_EEV_10     (HRTIM_SET1R_EXTVNT10)           /*!< External event 10 forces the output to its active state */
990 #define HRTIM_OUTPUTSET_UPDATE     (HRTIM_SET1R_UPDATE)             /*!< Timer register update event forces the output to its active state */
991 /**
992   * @}
993   */
994 
995 /** @defgroup HRTIM_Output_Reset_Source HRTIM Output Reset Source
996   * @{
997   * @brief Constants defining the events that can be selected to configure the
998   *        reset crossbar of a timer output
999   */
1000 #define HRTIM_OUTPUTRESET_NONE       0x00000000U                      /*!< Reset the output reset crossbar */
1001 #define HRTIM_OUTPUTRESET_RESYNC     (HRTIM_RST1R_RESYNC)             /*!< Timer reset event coming solely from software or SYNC input forces the output to its inactive state */
1002 #define HRTIM_OUTPUTRESET_TIMPER     (HRTIM_RST1R_PER)                /*!< Timer period event forces the output to its inactive state */
1003 #define HRTIM_OUTPUTRESET_TIMCMP1    (HRTIM_RST1R_CMP1)               /*!< Timer compare 1 event forces the output to its inactive state */
1004 #define HRTIM_OUTPUTRESET_TIMCMP2    (HRTIM_RST1R_CMP2)               /*!< Timer compare 2 event forces the output to its inactive state */
1005 #define HRTIM_OUTPUTRESET_TIMCMP3    (HRTIM_RST1R_CMP3)               /*!< Timer compare 3 event forces the output to its inactive state */
1006 #define HRTIM_OUTPUTRESET_TIMCMP4    (HRTIM_RST1R_CMP4)               /*!< Timer compare 4 event forces the output to its inactive state */
1007 #define HRTIM_OUTPUTRESET_MASTERPER  (HRTIM_RST1R_MSTPER)             /*!< The master timer period event forces the output to its inactive state */
1008 #define HRTIM_OUTPUTRESET_MASTERCMP1 (HRTIM_RST1R_MSTCMP1)            /*!< Master Timer compare 1 event forces the output to its inactive state */
1009 #define HRTIM_OUTPUTRESET_MASTERCMP2 (HRTIM_RST1R_MSTCMP2)            /*!< Master Timer compare 2 event forces the output to its inactive state */
1010 #define HRTIM_OUTPUTRESET_MASTERCMP3 (HRTIM_RST1R_MSTCMP3)            /*!< Master Timer compare 3 event forces the output to its inactive state */
1011 #define HRTIM_OUTPUTRESET_MASTERCMP4 (HRTIM_RST1R_MSTCMP4)            /*!< Master Timer compare 4 event forces the output to its inactive state */
1012 #define HRTIM_OUTPUTRESET_TIMEV_1    (HRTIM_RST1R_TIMEVNT1)           /*!< Timer event 1 forces the output to its active state */
1013 #define HRTIM_OUTPUTRESET_TIMEV_2    (HRTIM_RST1R_TIMEVNT2)           /*!< Timer event 2 forces the output to its active state */
1014 #define HRTIM_OUTPUTRESET_TIMEV_3    (HRTIM_RST1R_TIMEVNT3)           /*!< Timer event 3 forces the output to its active state */
1015 #define HRTIM_OUTPUTRESET_TIMEV_4    (HRTIM_RST1R_TIMEVNT4)           /*!< Timer event 4 forces the output to its active state */
1016 #define HRTIM_OUTPUTRESET_TIMEV_5    (HRTIM_RST1R_TIMEVNT5)           /*!< Timer event 5 forces the output to its active state */
1017 #define HRTIM_OUTPUTRESET_TIMEV_6    (HRTIM_RST1R_TIMEVNT6)           /*!< Timer event 6 forces the output to its active state */
1018 #define HRTIM_OUTPUTRESET_TIMEV_7    (HRTIM_RST1R_TIMEVNT7)           /*!< Timer event 7 forces the output to its active state */
1019 #define HRTIM_OUTPUTRESET_TIMEV_8    (HRTIM_RST1R_TIMEVNT8)           /*!< Timer event 8 forces the output to its active state */
1020 #define HRTIM_OUTPUTRESET_TIMEV_9    (HRTIM_RST1R_TIMEVNT9)           /*!< Timer event 9 forces the output to its active state */
1021 #define HRTIM_OUTPUTRESET_EEV_1      (HRTIM_RST1R_EXTVNT1)            /*!< External event 1 forces the output to its inactive state */
1022 #define HRTIM_OUTPUTRESET_EEV_2      (HRTIM_RST1R_EXTVNT2)            /*!< External event 2 forces the output to its inactive state */
1023 #define HRTIM_OUTPUTRESET_EEV_3      (HRTIM_RST1R_EXTVNT3)            /*!< External event 3 forces the output to its inactive state */
1024 #define HRTIM_OUTPUTRESET_EEV_4      (HRTIM_RST1R_EXTVNT4)            /*!< External event 4 forces the output to its inactive state */
1025 #define HRTIM_OUTPUTRESET_EEV_5      (HRTIM_RST1R_EXTVNT5)            /*!< External event 5 forces the output to its inactive state */
1026 #define HRTIM_OUTPUTRESET_EEV_6      (HRTIM_RST1R_EXTVNT6)            /*!< External event 6 forces the output to its inactive state */
1027 #define HRTIM_OUTPUTRESET_EEV_7      (HRTIM_RST1R_EXTVNT7)            /*!< External event 7 forces the output to its inactive state */
1028 #define HRTIM_OUTPUTRESET_EEV_8      (HRTIM_RST1R_EXTVNT8)            /*!< External event 8 forces the output to its inactive state */
1029 #define HRTIM_OUTPUTRESET_EEV_9      (HRTIM_RST1R_EXTVNT9)            /*!< External event 9 forces the output to its inactive state */
1030 #define HRTIM_OUTPUTRESET_EEV_10     (HRTIM_RST1R_EXTVNT10)           /*!< External event 10 forces the output to its inactive state */
1031 #define HRTIM_OUTPUTRESET_UPDATE     (HRTIM_RST1R_UPDATE)             /*!< Timer register update event forces the output to its inactive state */
1032 /**
1033   * @}
1034   */
1035 
1036 /** @defgroup HRTIM_Output_Idle_Mode HRTIM Output Idle Mode
1037   * @{
1038   * @brief Constants defining whether or not the timer output transition to its
1039            IDLE state when burst mode is entered
1040   */
1041 #define HRTIM_OUTPUTIDLEMODE_NONE     0x00000000U           /*!< The output is not affected by the burst mode operation */
1042 #define HRTIM_OUTPUTIDLEMODE_IDLE     (HRTIM_OUTR_IDLM1)    /*!< The output is in idle state when requested by the burst mode controller */
1043  /**
1044   * @}
1045   */
1046 
1047 /** @defgroup HRTIM_Output_IDLE_Level HRTIM Output IDLE Level
1048   * @{
1049   * @brief Constants defining the output level when output is in IDLE state
1050   */
1051 #define HRTIM_OUTPUTIDLELEVEL_INACTIVE   0x00000000U           /*!< Output at inactive level when in IDLE state */
1052 #define HRTIM_OUTPUTIDLELEVEL_ACTIVE     (HRTIM_OUTR_IDLES1)   /*!< Output at active level when in IDLE state */
1053 /**
1054   * @}
1055   */
1056 
1057 /** @defgroup HRTIM_Output_FAULT_Level HRTIM Output FAULT Level
1058   * @{
1059   * @brief Constants defining the output level when output is in FAULT state
1060   */
1061 #define HRTIM_OUTPUTFAULTLEVEL_NONE      0x00000000U                                  /*!< The output is not affected by the fault input */
1062 #define HRTIM_OUTPUTFAULTLEVEL_ACTIVE    (HRTIM_OUTR_FAULT1_0)                        /*!< Output at active level when in FAULT state */
1063 #define HRTIM_OUTPUTFAULTLEVEL_INACTIVE  (HRTIM_OUTR_FAULT1_1)                        /*!< Output at inactive level when in FAULT state */
1064 #define HRTIM_OUTPUTFAULTLEVEL_HIGHZ     (HRTIM_OUTR_FAULT1_1 | HRTIM_OUTR_FAULT1_0)  /*!< Output is tri-stated when in FAULT state */
1065 /**
1066   * @}
1067   */
1068 
1069 /** @defgroup HRTIM_Output_Chopper_Mode_Enable HRTIM Output Chopper Mode Enable
1070   * @{
1071   * @brief Constants defining whether or not chopper mode is enabled for a timer
1072            output
1073   */
1074 #define HRTIM_OUTPUTCHOPPERMODE_DISABLED   0x00000000U           /*!< Output signal is not altered  */
1075 #define HRTIM_OUTPUTCHOPPERMODE_ENABLED    (HRTIM_OUTR_CHP1)     /*!< Output signal is chopped by a carrier signal  */
1076 /**
1077   * @}
1078   */
1079 
1080 /** @defgroup HRTIM_Output_Burst_Mode_Entry_Delayed HRTIM Output Burst Mode Entry Delayed
1081   * @{
1082   * @brief Constants defining the idle mode entry is delayed by forcing a
1083            dead-time insertion before switching the outputs to their idle state
1084   */
1085 #define HRTIM_OUTPUTBURSTMODEENTRY_REGULAR   0x00000000U           /*!< The programmed Idle state is applied immediately to the Output */
1086 #define HRTIM_OUTPUTBURSTMODEENTRY_DELAYED   (HRTIM_OUTR_DIDL1)    /*!< Dead-time is inserted on output before entering the idle mode */
1087 /**
1088   * @}
1089   */
1090 
1091 
1092 /** @defgroup HRTIM_Capture_Unit_Trigger HRTIM Capture Unit Trigger
1093   * @{
1094   * @brief Constants defining the events that can be selected to trigger the
1095   *        capture of the timing unit counter
1096   */
1097 #define HRTIM_CAPTURETRIGGER_NONE         0x00000000U              /*!< Capture trigger is disabled */
1098 #define HRTIM_CAPTURETRIGGER_UPDATE       (HRTIM_CPT1CR_UPDCPT)    /*!< The update event triggers the Capture */
1099 #define HRTIM_CAPTURETRIGGER_EEV_1        (HRTIM_CPT1CR_EXEV1CPT)  /*!< The External event 1 triggers the Capture */
1100 #define HRTIM_CAPTURETRIGGER_EEV_2        (HRTIM_CPT1CR_EXEV2CPT)  /*!< The External event 2 triggers the Capture */
1101 #define HRTIM_CAPTURETRIGGER_EEV_3        (HRTIM_CPT1CR_EXEV3CPT)  /*!< The External event 3 triggers the Capture */
1102 #define HRTIM_CAPTURETRIGGER_EEV_4        (HRTIM_CPT1CR_EXEV4CPT)  /*!< The External event 4 triggers the Capture */
1103 #define HRTIM_CAPTURETRIGGER_EEV_5        (HRTIM_CPT1CR_EXEV5CPT)  /*!< The External event 5 triggers the Capture */
1104 #define HRTIM_CAPTURETRIGGER_EEV_6        (HRTIM_CPT1CR_EXEV6CPT)  /*!< The External event 6 triggers the Capture */
1105 #define HRTIM_CAPTURETRIGGER_EEV_7        (HRTIM_CPT1CR_EXEV7CPT)  /*!< The External event 7 triggers the Capture */
1106 #define HRTIM_CAPTURETRIGGER_EEV_8        (HRTIM_CPT1CR_EXEV8CPT)  /*!< The External event 8 triggers the Capture */
1107 #define HRTIM_CAPTURETRIGGER_EEV_9        (HRTIM_CPT1CR_EXEV9CPT)  /*!< The External event 9 triggers the Capture */
1108 #define HRTIM_CAPTURETRIGGER_EEV_10       (HRTIM_CPT1CR_EXEV10CPT) /*!< The External event 10 triggers the Capture */
1109 #define HRTIM_CAPTURETRIGGER_TA1_SET      (HRTIM_CPT1CR_TA1SET)    /*!< Capture is triggered by TA1 output inactive to active transition */
1110 #define HRTIM_CAPTURETRIGGER_TA1_RESET    (HRTIM_CPT1CR_TA1RST)    /*!< Capture is triggered by TA1 output active to inactive transition */
1111 #define HRTIM_CAPTURETRIGGER_TIMERA_CMP1  (HRTIM_CPT1CR_TIMACMP1)  /*!< Timer A Compare 1 triggers Capture */
1112 #define HRTIM_CAPTURETRIGGER_TIMERA_CMP2  (HRTIM_CPT1CR_TIMACMP2)  /*!< Timer A Compare 2 triggers Capture */
1113 #define HRTIM_CAPTURETRIGGER_TB1_SET      (HRTIM_CPT1CR_TB1SET)    /*!< Capture is triggered by TB1 output inactive to active transition */
1114 #define HRTIM_CAPTURETRIGGER_TB1_RESET    (HRTIM_CPT1CR_TB1RST)    /*!< Capture is triggered by TB1 output active to inactive transition */
1115 #define HRTIM_CAPTURETRIGGER_TIMERB_CMP1  (HRTIM_CPT1CR_TIMBCMP1)  /*!< Timer B Compare 1 triggers Capture */
1116 #define HRTIM_CAPTURETRIGGER_TIMERB_CMP2  (HRTIM_CPT1CR_TIMBCMP2)  /*!< Timer B Compare 2 triggers Capture */
1117 #define HRTIM_CAPTURETRIGGER_TC1_SET      (HRTIM_CPT1CR_TC1SET)    /*!< Capture is triggered by TC1 output inactive to active transition */
1118 #define HRTIM_CAPTURETRIGGER_TC1_RESET    (HRTIM_CPT1CR_TC1RST)    /*!< Capture is triggered by TC1 output active to inactive transition */
1119 #define HRTIM_CAPTURETRIGGER_TIMERC_CMP1  (HRTIM_CPT1CR_TIMCCMP1)  /*!< Timer C Compare 1 triggers Capture */
1120 #define HRTIM_CAPTURETRIGGER_TIMERC_CMP2  (HRTIM_CPT1CR_TIMCCMP2)  /*!< Timer C Compare 2 triggers Capture */
1121 #define HRTIM_CAPTURETRIGGER_TD1_SET      (HRTIM_CPT1CR_TD1SET)    /*!< Capture is triggered by TD1 output inactive to active transition */
1122 #define HRTIM_CAPTURETRIGGER_TD1_RESET    (HRTIM_CPT1CR_TD1RST)    /*!< Capture is triggered by TD1 output active to inactive transition */
1123 #define HRTIM_CAPTURETRIGGER_TIMERD_CMP1  (HRTIM_CPT1CR_TIMDCMP1)  /*!< Timer D Compare 1 triggers Capture */
1124 #define HRTIM_CAPTURETRIGGER_TIMERD_CMP2  (HRTIM_CPT1CR_TIMDCMP2)  /*!< Timer D Compare 2 triggers Capture */
1125 #define HRTIM_CAPTURETRIGGER_TE1_SET      (HRTIM_CPT1CR_TE1SET)    /*!< Capture is triggered by TE1 output inactive to active transition */
1126 #define HRTIM_CAPTURETRIGGER_TE1_RESET    (HRTIM_CPT1CR_TE1RST)    /*!< Capture is triggered by TE1 output active to inactive transition */
1127 #define HRTIM_CAPTURETRIGGER_TIMERE_CMP1  (HRTIM_CPT1CR_TIMECMP1)  /*!< Timer E Compare 1 triggers Capture */
1128 #define HRTIM_CAPTURETRIGGER_TIMERE_CMP2  (HRTIM_CPT1CR_TIMECMP2)  /*!< Timer E Compare 2 triggers Capture */
1129 /**
1130   * @}
1131   */
1132 
1133 /** @defgroup HRTIM_Timer_External_Event_Filter HRTIM Timer External Event Filter
1134   * @{
1135   * @brief Constants defining the event filtering applied to external events
1136   *        by a timer
1137   */
1138 #define HRTIM_TIMEVENTFILTER_NONE             (0x00000000U)
1139 #define HRTIM_TIMEVENTFILTER_BLANKINGCMP1     (HRTIM_EEFR1_EE1FLTR_0)                                                                          /*!< Blanking from counter reset/roll-over to Compare 1U  */
1140 #define HRTIM_TIMEVENTFILTER_BLANKINGCMP2     (HRTIM_EEFR1_EE1FLTR_1)                                                                          /*!< Blanking from counter reset/roll-over to Compare 2U  */
1141 #define HRTIM_TIMEVENTFILTER_BLANKINGCMP3     (HRTIM_EEFR1_EE1FLTR_1 | HRTIM_EEFR1_EE1FLTR_0)                                                  /*!< Blanking from counter reset/roll-over to Compare 3U  */
1142 #define HRTIM_TIMEVENTFILTER_BLANKINGCMP4     (HRTIM_EEFR1_EE1FLTR_2)                                                                          /*!< Blanking from counter reset/roll-over to Compare 4U  */
1143 #define HRTIM_TIMEVENTFILTER_BLANKINGFLTR1    (HRTIM_EEFR1_EE1FLTR_2 | HRTIM_EEFR1_EE1FLTR_0)                                                  /*!< Blanking from another timing unit: TIMFLTR1 source   */
1144 #define HRTIM_TIMEVENTFILTER_BLANKINGFLTR2    (HRTIM_EEFR1_EE1FLTR_2 | HRTIM_EEFR1_EE1FLTR_1)                                                  /*!< Blanking from another timing unit: TIMFLTR2 source   */
1145 #define HRTIM_TIMEVENTFILTER_BLANKINGFLTR3    (HRTIM_EEFR1_EE1FLTR_2 | HRTIM_EEFR1_EE1FLTR_1 | HRTIM_EEFR1_EE1FLTR_0)                          /*!< Blanking from another timing unit: TIMFLTR3 source   */
1146 #define HRTIM_TIMEVENTFILTER_BLANKINGFLTR4    (HRTIM_EEFR1_EE1FLTR_3)                                                                          /*!< Blanking from another timing unit: TIMFLTR4 source   */
1147 #define HRTIM_TIMEVENTFILTER_BLANKINGFLTR5    (HRTIM_EEFR1_EE1FLTR_3 | HRTIM_EEFR1_EE1FLTR_0)                                                  /*!< Blanking from another timing unit: TIMFLTR5 source   */
1148 #define HRTIM_TIMEVENTFILTER_BLANKINGFLTR6    (HRTIM_EEFR1_EE1FLTR_3 | HRTIM_EEFR1_EE1FLTR_1)                                                  /*!< Blanking from another timing unit: TIMFLTR6 source   */
1149 #define HRTIM_TIMEVENTFILTER_BLANKINGFLTR7    (HRTIM_EEFR1_EE1FLTR_3 | HRTIM_EEFR1_EE1FLTR_1 | HRTIM_EEFR1_EE1FLTR_0)                          /*!< Blanking from another timing unit: TIMFLTR7 source   */
1150 #define HRTIM_TIMEVENTFILTER_BLANKINGFLTR8    (HRTIM_EEFR1_EE1FLTR_3 | HRTIM_EEFR1_EE1FLTR_2)                                                  /*!< Blanking from another timing unit: TIMFLTR8 source   */
1151 #define HRTIM_TIMEVENTFILTER_WINDOWINGCMP2    (HRTIM_EEFR1_EE1FLTR_3 | HRTIM_EEFR1_EE1FLTR_2 | HRTIM_EEFR1_EE1FLTR_0)                          /*!< Windowing from counter reset/roll-over to Compare 2U */
1152 #define HRTIM_TIMEVENTFILTER_WINDOWINGCMP3    (HRTIM_EEFR1_EE1FLTR_3 | HRTIM_EEFR1_EE1FLTR_2 | HRTIM_EEFR1_EE1FLTR_1)                          /*!< Windowing from counter reset/roll-over to Compare 3U */
1153 #define HRTIM_TIMEVENTFILTER_WINDOWINGTIM     (HRTIM_EEFR1_EE1FLTR_3 | HRTIM_EEFR1_EE1FLTR_2 | HRTIM_EEFR1_EE1FLTR_1 | HRTIM_EEFR1_EE1FLTR_0)  /*!< Windowing from another timing unit: TIMWIN source    */
1154 /**
1155   * @}
1156   */
1157 
1158 /** @defgroup HRTIM_Timer_External_Event_Latch HRTIM Timer External Event Latch
1159   * @{
1160   * @brief Constants defining whether or not the external event is
1161   *        memorized (latched) and generated as soon as the blanking period
1162   *        is completed or the window ends
1163   */
1164 #define HRTIM_TIMEVENTLATCH_DISABLED    (0x00000000U)           /*!< Event is ignored if it happens during a blank, or passed through during a window */
1165 #define HRTIM_TIMEVENTLATCH_ENABLED     HRTIM_EEFR1_EE1LTCH     /*!< Event is latched and delayed till the end of the blanking or windowing period */
1166 /**
1167   * @}
1168   */
1169 
1170 /** @defgroup HRTIM_Deadtime_Prescaler_Ratio HRTIM Dead-time Prescaler Ratio
1171   * @{
1172   * @brief Constants defining division ratio between the timer clock frequency
1173   *        (fHRTIM) and the dead-time generator clock (fDTG)
1174   */
1175 #define HRTIM_TIMDEADTIME_PRESCALERRATIO_DIV1    (HRTIM_DTR_DTPRSC_1 | HRTIM_DTR_DTPRSC_0)                       /*!< fDTG = fHRTIM */
1176 #define HRTIM_TIMDEADTIME_PRESCALERRATIO_DIV2    (HRTIM_DTR_DTPRSC_2)                                            /*!< fDTG = fHRTIM / 2U */
1177 #define HRTIM_TIMDEADTIME_PRESCALERRATIO_DIV4    (HRTIM_DTR_DTPRSC_2 | HRTIM_DTR_DTPRSC_0)                       /*!< fDTG = fHRTIM / 4U */
1178 #define HRTIM_TIMDEADTIME_PRESCALERRATIO_DIV8    (HRTIM_DTR_DTPRSC_2 | HRTIM_DTR_DTPRSC_1)                       /*!< fDTG = fHRTIM / 8U */
1179 #define HRTIM_TIMDEADTIME_PRESCALERRATIO_DIV16   (HRTIM_DTR_DTPRSC_2 | HRTIM_DTR_DTPRSC_1 | HRTIM_DTR_DTPRSC_0)  /*!< fDTG = fHRTIM / 16U */
1180 /**
1181   * @}
1182   */
1183 
1184 /** @defgroup HRTIM_Deadtime_Rising_Sign HRTIM Dead-time Rising Sign
1185   * @{
1186   * @brief Constants defining whether the dead-time is positive or negative
1187   *        (overlapping signal) on rising edge
1188   */
1189 #define HRTIM_TIMDEADTIME_RISINGSIGN_POSITIVE    (0x00000000U)           /*!< Positive dead-time on rising edge */
1190 #define HRTIM_TIMDEADTIME_RISINGSIGN_NEGATIVE    (HRTIM_DTR_SDTR)        /*!< Negative dead-time on rising edge */
1191 /**
1192   * @}
1193   */
1194 
1195 /** @defgroup HRTIM_Deadtime_Rising_Lock HRTIM Dead-time Rising Lock
1196   * @{
1197   * @brief Constants defining whether or not the dead-time (rising sign and
1198   *        value) is write protected
1199   */
1200 #define HRTIM_TIMDEADTIME_RISINGLOCK_WRITE    (0x00000000U)           /*!< Dead-time rising value and sign is writeable */
1201 #define HRTIM_TIMDEADTIME_RISINGLOCK_READONLY (HRTIM_DTR_DTRLK)       /*!< Dead-time rising value and sign is read-only */
1202 /**
1203   * @}
1204   */
1205 
1206 /** @defgroup HRTIM_Deadtime_Rising_Sign_Lock HRTIM Dead-time Rising Sign Lock
1207   * @{
1208   * @brief Constants defining whether or not the dead-time rising sign is write
1209   *        protected
1210   */
1211 #define HRTIM_TIMDEADTIME_RISINGSIGNLOCK_WRITE    (0x00000000U)           /*!< Dead-time rising sign is writeable */
1212 #define HRTIM_TIMDEADTIME_RISINGSIGNLOCK_READONLY (HRTIM_DTR_DTRSLK)      /*!< Dead-time rising sign is read-only */
1213 /**
1214   * @}
1215   */
1216 
1217 /** @defgroup HRTIM_Deadtime_Falling_Sign HRTIM Dead-time Falling Sign
1218   * @{
1219   * @brief Constants defining whether the dead-time is positive or negative
1220   *        (overlapping signal) on falling edge
1221   */
1222 #define HRTIM_TIMDEADTIME_FALLINGSIGN_POSITIVE    (0x00000000U)           /*!< Positive dead-time on falling edge */
1223 #define HRTIM_TIMDEADTIME_FALLINGSIGN_NEGATIVE    (HRTIM_DTR_SDTF)        /*!< Negative dead-time on falling edge */
1224 /**
1225   * @}
1226   */
1227 
1228 /** @defgroup HRTIM_Deadtime_Falling_Lock HRTIM Dead-time Falling Lock
1229   * @{
1230   * @brief Constants defining whether or not the dead-time (falling sign and
1231   *        value) is write protected
1232   */
1233 #define HRTIM_TIMDEADTIME_FALLINGLOCK_WRITE    (0x00000000U)           /*!< Dead-time falling value and sign is writeable */
1234 #define HRTIM_TIMDEADTIME_FALLINGLOCK_READONLY (HRTIM_DTR_DTFLK)       /*!< Dead-time falling value and sign is read-only */
1235 /**
1236   * @}
1237   */
1238 
1239 /** @defgroup HRTIM_Deadtime_Falling_Sign_Lock HRTIM Dead-time Falling Sign Lock
1240   * @{
1241   * @brief Constants defining whether or not the dead-time falling sign is write
1242   *        protected
1243   */
1244 #define HRTIM_TIMDEADTIME_FALLINGSIGNLOCK_WRITE    (0x00000000U)           /*!< Dead-time falling sign is writeable */
1245 #define HRTIM_TIMDEADTIME_FALLINGSIGNLOCK_READONLY (HRTIM_DTR_DTFSLK)      /*!< Dead-time falling sign is read-only */
1246 /**
1247   * @}
1248   */
1249 
1250 /** @defgroup HRTIM_Chopper_Frequency HRTIM Chopper Frequency
1251   * @{
1252   * @brief Constants defining the frequency of the generated high frequency carrier
1253   */
1254 #define HRTIM_CHOPPER_PRESCALERRATIO_DIV16  (0x000000U)                                                                     /*!< fCHPFRQ = fHRTIM / 16  */
1255 #define HRTIM_CHOPPER_PRESCALERRATIO_DIV32  (HRTIM_CHPR_CARFRQ_0)                                                                    /*!< fCHPFRQ = fHRTIM / 32  */
1256 #define HRTIM_CHOPPER_PRESCALERRATIO_DIV48  (HRTIM_CHPR_CARFRQ_1)                                                                    /*!< fCHPFRQ = fHRTIM / 48  */
1257 #define HRTIM_CHOPPER_PRESCALERRATIO_DIV64  (HRTIM_CHPR_CARFRQ_1 | HRTIM_CHPR_CARFRQ_0)                                              /*!< fCHPFRQ = fHRTIM / 64  */
1258 #define HRTIM_CHOPPER_PRESCALERRATIO_DIV80  (HRTIM_CHPR_CARFRQ_2)                                                                    /*!< fCHPFRQ = fHRTIM / 80  */
1259 #define HRTIM_CHOPPER_PRESCALERRATIO_DIV96  (HRTIM_CHPR_CARFRQ_2 | HRTIM_CHPR_CARFRQ_0)                                              /*!< fCHPFRQ = fHRTIM / 96  */
1260 #define HRTIM_CHOPPER_PRESCALERRATIO_DIV112 (HRTIM_CHPR_CARFRQ_2 | HRTIM_CHPR_CARFRQ_1)                                              /*!< fCHPFRQ = fHRTIM / 112  */
1261 #define HRTIM_CHOPPER_PRESCALERRATIO_DIV128 (HRTIM_CHPR_CARFRQ_2 | HRTIM_CHPR_CARFRQ_1 | HRTIM_CHPR_CARFRQ_0)                        /*!< fCHPFRQ = fHRTIM / 128  */
1262 #define HRTIM_CHOPPER_PRESCALERRATIO_DIV144 (HRTIM_CHPR_CARFRQ_3)                                                                    /*!< fCHPFRQ = fHRTIM / 144  */
1263 #define HRTIM_CHOPPER_PRESCALERRATIO_DIV160 (HRTIM_CHPR_CARFRQ_3 | HRTIM_CHPR_CARFRQ_0)                                              /*!< fCHPFRQ = fHRTIM / 160  */
1264 #define HRTIM_CHOPPER_PRESCALERRATIO_DIV176 (HRTIM_CHPR_CARFRQ_3 | HRTIM_CHPR_CARFRQ_1)                                              /*!< fCHPFRQ = fHRTIM / 176  */
1265 #define HRTIM_CHOPPER_PRESCALERRATIO_DIV192 (HRTIM_CHPR_CARFRQ_3 | HRTIM_CHPR_CARFRQ_1 | HRTIM_CHPR_CARFRQ_0)                        /*!< fCHPFRQ = fHRTIM / 192  */
1266 #define HRTIM_CHOPPER_PRESCALERRATIO_DIV208 (HRTIM_CHPR_CARFRQ_3 | HRTIM_CHPR_CARFRQ_2)                                              /*!< fCHPFRQ = fHRTIM / 208  */
1267 #define HRTIM_CHOPPER_PRESCALERRATIO_DIV224 (HRTIM_CHPR_CARFRQ_3 | HRTIM_CHPR_CARFRQ_2 | HRTIM_CHPR_CARFRQ_0)                        /*!< fCHPFRQ = fHRTIM / 224  */
1268 #define HRTIM_CHOPPER_PRESCALERRATIO_DIV240 (HRTIM_CHPR_CARFRQ_3 | HRTIM_CHPR_CARFRQ_2 | HRTIM_CHPR_CARFRQ_1)                        /*!< fCHPFRQ = fHRTIM / 240  */
1269 #define HRTIM_CHOPPER_PRESCALERRATIO_DIV256 (HRTIM_CHPR_CARFRQ_3 | HRTIM_CHPR_CARFRQ_2 | HRTIM_CHPR_CARFRQ_1 | HRTIM_CHPR_CARFRQ_0)  /*!< fCHPFRQ = fHRTIM / 256  */
1270  /**
1271   * @}
1272   */
1273 
1274 /** @defgroup HRTIM_Chopper_Duty_Cycle HRTIM Chopper Duty Cycle
1275   * @{
1276   * @brief Constants defining the duty cycle of the generated high frequency carrier
1277   *        Duty cycle can be adjusted by 1/8 step (from 0/8 up to 7/8)
1278   */
1279 #define HRTIM_CHOPPER_DUTYCYCLE_0    (0x000000U)                                                       /*!< Only 1st pulse is present */
1280 #define HRTIM_CHOPPER_DUTYCYCLE_125  (HRTIM_CHPR_CARDTY_0)                                             /*!< Duty cycle of the carrier signal is 12.5U % */
1281 #define HRTIM_CHOPPER_DUTYCYCLE_250  (HRTIM_CHPR_CARDTY_1)                                             /*!< Duty cycle of the carrier signal is 25U % */
1282 #define HRTIM_CHOPPER_DUTYCYCLE_375  (HRTIM_CHPR_CARDTY_1 | HRTIM_CHPR_CARDTY_0)                       /*!< Duty cycle of the carrier signal is 37.5U % */
1283 #define HRTIM_CHOPPER_DUTYCYCLE_500  (HRTIM_CHPR_CARDTY_2)                                             /*!< Duty cycle of the carrier signal is 50U % */
1284 #define HRTIM_CHOPPER_DUTYCYCLE_625  (HRTIM_CHPR_CARDTY_2 | HRTIM_CHPR_CARDTY_0)                       /*!< Duty cycle of the carrier signal is 62.5U % */
1285 #define HRTIM_CHOPPER_DUTYCYCLE_750  (HRTIM_CHPR_CARDTY_2 | HRTIM_CHPR_CARDTY_1)                       /*!< Duty cycle of the carrier signal is 75U % */
1286 #define HRTIM_CHOPPER_DUTYCYCLE_875  (HRTIM_CHPR_CARDTY_2 | HRTIM_CHPR_CARDTY_1 | HRTIM_CHPR_CARDTY_0) /*!< Duty cycle of the carrier signal is 87.5U % */
1287 /**
1288   * @}
1289   */
1290 
1291 /** @defgroup HRTIM_Chopper_Start_Pulse_Width HRTIM Chopper Start Pulse Width
1292   * @{
1293   * @brief Constants defining the pulse width of the first pulse of the generated
1294   *        high frequency carrier
1295   */
1296 #define HRTIM_CHOPPER_PULSEWIDTH_16   (0x000000U)                                                                          /*!< tSTPW = tHRTIM x 16  */
1297 #define HRTIM_CHOPPER_PULSEWIDTH_32   (HRTIM_CHPR_STRPW_0)                                                                 /*!< tSTPW = tHRTIM x 32  */
1298 #define HRTIM_CHOPPER_PULSEWIDTH_48   (HRTIM_CHPR_STRPW_1)                                                                 /*!< tSTPW = tHRTIM x 48  */
1299 #define HRTIM_CHOPPER_PULSEWIDTH_64   (HRTIM_CHPR_STRPW_1 | HRTIM_CHPR_STRPW_0)                                            /*!< tSTPW = tHRTIM x 64  */
1300 #define HRTIM_CHOPPER_PULSEWIDTH_80   (HRTIM_CHPR_STRPW_2)                                                                 /*!< tSTPW = tHRTIM x 80  */
1301 #define HRTIM_CHOPPER_PULSEWIDTH_96   (HRTIM_CHPR_STRPW_2 | HRTIM_CHPR_STRPW_0)                                            /*!< tSTPW = tHRTIM x 96  */
1302 #define HRTIM_CHOPPER_PULSEWIDTH_112  (HRTIM_CHPR_STRPW_2 | HRTIM_CHPR_STRPW_1)                                            /*!< tSTPW = tHRTIM x 112  */
1303 #define HRTIM_CHOPPER_PULSEWIDTH_128  (HRTIM_CHPR_STRPW_2 | HRTIM_CHPR_STRPW_1 | HRTIM_CHPR_STRPW_0)                       /*!< tSTPW = tHRTIM x 128  */
1304 #define HRTIM_CHOPPER_PULSEWIDTH_144  (HRTIM_CHPR_STRPW_3)                                                                 /*!< tSTPW = tHRTIM x 144  */
1305 #define HRTIM_CHOPPER_PULSEWIDTH_160  (HRTIM_CHPR_STRPW_3 | HRTIM_CHPR_STRPW_0)                                            /*!< tSTPW = tHRTIM x 160  */
1306 #define HRTIM_CHOPPER_PULSEWIDTH_176  (HRTIM_CHPR_STRPW_3 | HRTIM_CHPR_STRPW_1)                                            /*!< tSTPW = tHRTIM x 176  */
1307 #define HRTIM_CHOPPER_PULSEWIDTH_192  (HRTIM_CHPR_STRPW_3 | HRTIM_CHPR_STRPW_1 | HRTIM_CHPR_STRPW_0)                       /*!< tSTPW = tHRTIM x 192  */
1308 #define HRTIM_CHOPPER_PULSEWIDTH_208  (HRTIM_CHPR_STRPW_3 | HRTIM_CHPR_STRPW_2)                                            /*!< tSTPW = tHRTIM x 208  */
1309 #define HRTIM_CHOPPER_PULSEWIDTH_224  (HRTIM_CHPR_STRPW_3 | HRTIM_CHPR_STRPW_2 | HRTIM_CHPR_STRPW_0)                       /*!< tSTPW = tHRTIM x 224  */
1310 #define HRTIM_CHOPPER_PULSEWIDTH_240  (HRTIM_CHPR_STRPW_3 | HRTIM_CHPR_STRPW_2 | HRTIM_CHPR_STRPW_1)                       /*!< tSTPW = tHRTIM x 240  */
1311 #define HRTIM_CHOPPER_PULSEWIDTH_256  (HRTIM_CHPR_STRPW_3 | HRTIM_CHPR_STRPW_2 | HRTIM_CHPR_STRPW_1 | HRTIM_CHPR_STRPW_0)  /*!< tSTPW = tHRTIM x 256  */
1312 /**
1313   * @}
1314   */
1315 
1316 /** @defgroup HRTIM_Synchronization_Options HRTIM Synchronization Options
1317   * @{
1318   * @brief Constants defining the options for synchronizing multiple HRTIM
1319   *        instances, as a master unit (generating a synchronization signal)
1320   *        or as a slave (waiting for a trigger to be synchronized)
1321   */
1322 #define HRTIM_SYNCOPTION_NONE   0x00000000U   /*!< HRTIM instance doesn't handle external synchronization signals (SYNCIN, SYNCOUT) */
1323 #define HRTIM_SYNCOPTION_MASTER 0x00000001U   /*!< HRTIM instance acts as a MASTER, i.e. generates external synchronization output (SYNCOUT)*/
1324 #define HRTIM_SYNCOPTION_SLAVE  0x00000002U   /*!< HRTIM instance acts as a SLAVE, i.e. it is synchronized by external sources (SYNCIN) */
1325 /**
1326   * @}
1327   */
1328 
1329 /** @defgroup HRTIM_Synchronization_Input_Source HRTIM Synchronization Input Source
1330   * @{
1331   * @brief Constants defining defining the synchronization input source
1332   */
1333 #define HRTIM_SYNCINPUTSOURCE_NONE           0x00000000U                                  /*!< disabled. HRTIM is not synchronized and runs in standalone mode */
1334 #define HRTIM_SYNCINPUTSOURCE_INTERNALEVENT  HRTIM_MCR_SYNC_IN_1                          /*!< The HRTIM is synchronized with the on-chip timer */
1335 #define HRTIM_SYNCINPUTSOURCE_EXTERNALEVENT  (HRTIM_MCR_SYNC_IN_1 | HRTIM_MCR_SYNC_IN_0)  /*!< A positive pulse on SYNCIN input triggers the HRTIM */
1336 /**
1337   * @}
1338   */
1339 
1340 /** @defgroup HRTIM_Synchronization_Output_Source HRTIM Synchronization Output Source
1341   * @{
1342   * @brief Constants defining the source and event to be sent on the
1343   *        synchronization outputs
1344   */
1345 #define HRTIM_SYNCOUTPUTSOURCE_MASTER_START 0x00000000U                                    /*!< A pulse is sent on HRTIM_SCOUT output and hrtim_out_sync2 upon master timer start event      */
1346 #define HRTIM_SYNCOUTPUTSOURCE_MASTER_CMP1  (HRTIM_MCR_SYNC_SRC_0)                         /*!< A pulse is sent on HRTIM_SCOUT output and hrtim_out_sync2 upon master timer compare 1 event  */
1347 #define HRTIM_SYNCOUTPUTSOURCE_TIMA_START   (HRTIM_MCR_SYNC_SRC_1)                         /*!< A pulse is sent on HRTIM_SCOUT output and hrtim_out_sync2 upon timer A start or reset events */
1348 #define HRTIM_SYNCOUTPUTSOURCE_TIMA_CMP1    (HRTIM_MCR_SYNC_SRC_1 | HRTIM_MCR_SYNC_SRC_0)  /*!< A pulse is sent on HRTIM_SCOUT output and hrtim_out_sync2 upon timer A compare 1 event       */
1349 /**
1350   * @}
1351   */
1352 
1353 /** @defgroup HRTIM_Synchronization_Output_Polarity HRTIM Synchronization Output Polarity
1354   * @{
1355   * @brief Constants defining the routing and conditioning of the synchronization output event
1356   */
1357 #define HRTIM_SYNCOUTPUTPOLARITY_NONE      0x00000000U                                   /*!< Synchronization output event is disabled */
1358 #define HRTIM_SYNCOUTPUTPOLARITY_POSITIVE  (HRTIM_MCR_SYNC_OUT_1)                        /*!< SCOUT pin has a low idle level and issues a positive pulse of 16 fHRTIM clock cycles length for the synchronization */
1359 #define HRTIM_SYNCOUTPUTPOLARITY_NEGATIVE  (HRTIM_MCR_SYNC_OUT_1 | HRTIM_MCR_SYNC_OUT_0) /*!< SCOUT pin has a high idle level and issues a negative pulse of 16 fHRTIM clock cycles length for the synchronization */
1360 /**
1361   * @}
1362   */
1363 
1364 /** @defgroup HRTIM_External_Event_Sources HRTIM External Event Sources
1365   * @{
1366   * @brief Constants defining available sources associated to external events
1367   */
1368 #define HRTIM_EVENTSRC_1         (0x00000000U)                                  /*!< External event source 1U */
1369 #define HRTIM_EVENTSRC_2         (HRTIM_EECR1_EE1SRC_0)                         /*!< External event source 2U */
1370 #define HRTIM_EVENTSRC_3         (HRTIM_EECR1_EE1SRC_1)                         /*!< External event source 3U */
1371 #define HRTIM_EVENTSRC_4         (HRTIM_EECR1_EE1SRC_1 | HRTIM_EECR1_EE1SRC_0)  /*!< External event source 4U */
1372 /**
1373   * @}
1374   */
1375 
1376 /** @defgroup HRTIM_External_Event_Polarity HRTIM External Event Polarity
1377   * @{
1378   * @brief Constants defining the polarity of an external event
1379   */
1380 #define HRTIM_EVENTPOLARITY_HIGH    (0x00000000U)           /*!< External event is active high */
1381 #define HRTIM_EVENTPOLARITY_LOW     (HRTIM_EECR1_EE1POL)    /*!< External event is active low */
1382 /**
1383   * @}
1384   */
1385 
1386 /** @defgroup HRTIM_External_Event_Sensitivity HRTIM External Event Sensitivity
1387   * @{
1388   * @brief Constants defining the sensitivity (level-sensitive or edge-sensitive)
1389   *        of an external event
1390   */
1391 #define HRTIM_EVENTSENSITIVITY_LEVEL          (0x00000000U)                                  /*!< External event is active on level */
1392 #define HRTIM_EVENTSENSITIVITY_RISINGEDGE     (HRTIM_EECR1_EE1SNS_0)                         /*!< External event is active on Rising edge */
1393 #define HRTIM_EVENTSENSITIVITY_FALLINGEDGE    (HRTIM_EECR1_EE1SNS_1)                         /*!< External event is active on Falling edge */
1394 #define HRTIM_EVENTSENSITIVITY_BOTHEDGES      (HRTIM_EECR1_EE1SNS_1 | HRTIM_EECR1_EE1SNS_0)  /*!< External event is active on Rising and Falling edges */
1395 /**
1396   * @}
1397   */
1398 
1399 /** @defgroup HRTIM_External_Event_Fast_Mode HRTIM External Event Fast Mode
1400   * @{
1401   * @brief Constants defining whether or not an external event is programmed in
1402            fast mode
1403   */
1404 #define HRTIM_EVENTFASTMODE_DISABLE    (0x00000000U)               /*!< External Event is re-synchronized by the HRTIM logic before acting on outputs */
1405 #define HRTIM_EVENTFASTMODE_ENABLE     (HRTIM_EECR1_EE1FAST)       /*!< External Event is acting asynchronously on outputs (low latency mode) */
1406 /**
1407   * @}
1408   */
1409 
1410 /** @defgroup HRTIM_External_Event_Filter HRTIM External Event Filter
1411   * @{
1412   * @brief Constants defining the frequency used to sample an external event 6
1413   *        input and the length (N) of the digital filter applied
1414   */
1415 #define HRTIM_EVENTFILTER_NONE      (0x00000000U)                                                                         /*!< Filter disabled */
1416 #define HRTIM_EVENTFILTER_1         (HRTIM_EECR3_EE6F_0)                                                                  /*!< fSAMPLING= fHRTIM, N=2U */
1417 #define HRTIM_EVENTFILTER_2         (HRTIM_EECR3_EE6F_1)                                                                  /*!< fSAMPLING= fHRTIM, N=4U */
1418 #define HRTIM_EVENTFILTER_3         (HRTIM_EECR3_EE6F_1 | HRTIM_EECR3_EE6F_0)                                             /*!< fSAMPLING= fHRTIM, N=8U */
1419 #define HRTIM_EVENTFILTER_4         (HRTIM_EECR3_EE6F_2)                                                                  /*!< fSAMPLING= fEEVS/2U, N=6U */
1420 #define HRTIM_EVENTFILTER_5         (HRTIM_EECR3_EE6F_2 | HRTIM_EECR3_EE6F_0)                                             /*!< fSAMPLING= fEEVS/2U, N=8U */
1421 #define HRTIM_EVENTFILTER_6         (HRTIM_EECR3_EE6F_2 | HRTIM_EECR3_EE6F_1)                                             /*!< fSAMPLING= fEEVS/4U, N=6U */
1422 #define HRTIM_EVENTFILTER_7         (HRTIM_EECR3_EE6F_2 | HRTIM_EECR3_EE6F_1 | HRTIM_EECR3_EE6F_0)                        /*!< fSAMPLING= fEEVS/4U, N=8U */
1423 #define HRTIM_EVENTFILTER_8         (HRTIM_EECR3_EE6F_3)                                                                  /*!< fSAMPLING= fEEVS/8U, N=6U */
1424 #define HRTIM_EVENTFILTER_9         (HRTIM_EECR3_EE6F_3 | HRTIM_EECR3_EE6F_0)                                             /*!< fSAMPLING= fEEVS/8U, N=8U */
1425 #define HRTIM_EVENTFILTER_10        (HRTIM_EECR3_EE6F_3 | HRTIM_EECR3_EE6F_1)                                             /*!< fSAMPLING= fEEVS/16U, N=5U */
1426 #define HRTIM_EVENTFILTER_11        (HRTIM_EECR3_EE6F_3 | HRTIM_EECR3_EE6F_1 | HRTIM_EECR3_EE6F_0)                        /*!< fSAMPLING= fEEVS/16U, N=6U */
1427 #define HRTIM_EVENTFILTER_12        (HRTIM_EECR3_EE6F_3 | HRTIM_EECR3_EE6F_2)                                             /*!< fSAMPLING= fEEVS/16U, N=8U */
1428 #define HRTIM_EVENTFILTER_13        (HRTIM_EECR3_EE6F_3 | HRTIM_EECR3_EE6F_2  | HRTIM_EECR3_EE6F_0)                       /*!< fSAMPLING= fEEVS/32U, N=5U */
1429 #define HRTIM_EVENTFILTER_14        (HRTIM_EECR3_EE6F_3 | HRTIM_EECR3_EE6F_2  | HRTIM_EECR3_EE6F_1)                       /*!< fSAMPLING= fEEVS/32U, N=6U */
1430 #define HRTIM_EVENTFILTER_15        (HRTIM_EECR3_EE6F_3 | HRTIM_EECR3_EE6F_2  | HRTIM_EECR3_EE6F_1 | HRTIM_EECR3_EE6F_0)  /*!< fSAMPLING= fEEVS/32U, N=8U */
1431 /**
1432   * @}
1433   */
1434 
1435 /** @defgroup HRTIM_External_Event_Prescaler HRTIM External Event Prescaler
1436   * @{
1437   * @brief Constants defining division ratio between the timer clock frequency
1438   *        fHRTIM) and the external event signal sampling clock (fEEVS)
1439   *        used by the digital filters
1440   */
1441 #define HRTIM_EVENTPRESCALER_DIV1    (0x00000000U)                                   /*!< fEEVS=fHRTIM */
1442 #define HRTIM_EVENTPRESCALER_DIV2    (HRTIM_EECR3_EEVSD_0)                           /*!< fEEVS=fHRTIM / 2U */
1443 #define HRTIM_EVENTPRESCALER_DIV4    (HRTIM_EECR3_EEVSD_1)                           /*!< fEEVS=fHRTIM / 4U */
1444 #define HRTIM_EVENTPRESCALER_DIV8    (HRTIM_EECR3_EEVSD_1 | HRTIM_EECR3_EEVSD_0)     /*!< fEEVS=fHRTIM / 8U */
1445 /**
1446   * @}
1447   */
1448 
1449 /** @defgroup HRTIM_Fault_Sources HRTIM Fault Sources
1450   * @{
1451   * @brief Constants defining whether a fault is triggered by any external
1452   *        or internal fault source
1453   */
1454 #define HRTIM_FAULTSOURCE_DIGITALINPUT      (0x00000000U)              /*!< Fault input is FLT input pin */
1455 #define HRTIM_FAULTSOURCE_INTERNAL          (HRTIM_FLTINR1_FLT1SRC)    /*!< Fault input is FLT_Int signal (e.g. internal comparator) */
1456 /**
1457   * @}
1458   */
1459 
1460 /** @defgroup HRTIM_Fault_Polarity HRTIM Fault Polarity
1461   * @{
1462   * @brief Constants defining the polarity of a fault event
1463   */
1464 #define HRTIM_FAULTPOLARITY_LOW     (0x00000000U)            /*!< Fault input is active low */
1465 #define HRTIM_FAULTPOLARITY_HIGH    (HRTIM_FLTINR1_FLT1P)    /*!< Fault input is active high */
1466 /**
1467   * @}
1468   */
1469 
1470 /** @defgroup HRTIM_Fault_Filter HRTIM Fault Filter
1471   * @{
1472   * @ brief Constants defining the frequency used to sample the fault input and
1473   *         the length (N) of the digital filter applied
1474   */
1475 #define HRTIM_FAULTFILTER_NONE      (0x00000000U)                                                                                    /*!< Filter disabled */
1476 #define HRTIM_FAULTFILTER_1         (HRTIM_FLTINR1_FLT1F_0)                                                                          /*!< fSAMPLING= fHRTIM, N=2U */
1477 #define HRTIM_FAULTFILTER_2         (HRTIM_FLTINR1_FLT1F_1)                                                                          /*!< fSAMPLING= fHRTIM, N=4U */
1478 #define HRTIM_FAULTFILTER_3         (HRTIM_FLTINR1_FLT1F_1 | HRTIM_FLTINR1_FLT1F_0)                                                  /*!< fSAMPLING= fHRTIM, N=8U */
1479 #define HRTIM_FAULTFILTER_4         (HRTIM_FLTINR1_FLT1F_2)                                                                          /*!< fSAMPLING= fFLTS/2U, N=6U */
1480 #define HRTIM_FAULTFILTER_5         (HRTIM_FLTINR1_FLT1F_2 | HRTIM_FLTINR1_FLT1F_0)                                                  /*!< fSAMPLING= fFLTS/2U, N=8U */
1481 #define HRTIM_FAULTFILTER_6         (HRTIM_FLTINR1_FLT1F_2 | HRTIM_FLTINR1_FLT1F_1)                                                  /*!< fSAMPLING= fFLTS/4U, N=6U */
1482 #define HRTIM_FAULTFILTER_7         (HRTIM_FLTINR1_FLT1F_2 | HRTIM_FLTINR1_FLT1F_1 | HRTIM_FLTINR1_FLT1F_0)                          /*!< fSAMPLING= fFLTS/4U, N=8U */
1483 #define HRTIM_FAULTFILTER_8         (HRTIM_FLTINR1_FLT1F_3)                                                                          /*!< fSAMPLING= fFLTS/8U, N=6U */
1484 #define HRTIM_FAULTFILTER_9         (HRTIM_FLTINR1_FLT1F_3 | HRTIM_FLTINR1_FLT1F_0)                                                  /*!< fSAMPLING= fFLTS/8U, N=8U */
1485 #define HRTIM_FAULTFILTER_10        (HRTIM_FLTINR1_FLT1F_3 | HRTIM_FLTINR1_FLT1F_1)                                                  /*!< fSAMPLING= fFLTS/16U, N=5U */
1486 #define HRTIM_FAULTFILTER_11        (HRTIM_FLTINR1_FLT1F_3 | HRTIM_FLTINR1_FLT1F_1 | HRTIM_FLTINR1_FLT1F_0)                          /*!< fSAMPLING= fFLTS/16U, N=6U */
1487 #define HRTIM_FAULTFILTER_12        (HRTIM_FLTINR1_FLT1F_3 | HRTIM_FLTINR1_FLT1F_2)                                                  /*!< fSAMPLING= fFLTS/16U, N=8U */
1488 #define HRTIM_FAULTFILTER_13        (HRTIM_FLTINR1_FLT1F_3 | HRTIM_FLTINR1_FLT1F_2 | HRTIM_FLTINR1_FLT1F_0)                          /*!< fSAMPLING= fFLTS/32U, N=5U */
1489 #define HRTIM_FAULTFILTER_14        (HRTIM_FLTINR1_FLT1F_3 | HRTIM_FLTINR1_FLT1F_2 | HRTIM_FLTINR1_FLT1F_1)                          /*!< fSAMPLING= fFLTS/32U, N=6U */
1490 #define HRTIM_FAULTFILTER_15        (HRTIM_FLTINR1_FLT1F_3 | HRTIM_FLTINR1_FLT1F_2 | HRTIM_FLTINR1_FLT1F_1 | HRTIM_FLTINR1_FLT1F_0)  /*!< fSAMPLING= fFLTS/32U, N=8U */
1491 /**
1492   * @}
1493   */
1494 
1495 /** @defgroup HRTIM_Fault_Lock HRTIM Fault Lock
1496   * @{
1497   * @brief Constants defining whether or not the fault programming bits are
1498            write protected
1499   */
1500 #define HRTIM_FAULTLOCK_READWRITE       (0x00000000U)               /*!< Fault settings bits are read/write */
1501 #define HRTIM_FAULTLOCK_READONLY        (HRTIM_FLTINR1_FLT1LCK)     /*!< Fault settings bits are read only */
1502 /**
1503   * @}
1504   */
1505 
1506 /** @defgroup HRTIM_External_Fault_Prescaler HRTIM External Fault Prescaler
1507   * @{
1508   * @brief Constants defining the division ratio between the timer clock
1509   *        frequency (fHRTIM) and the fault signal sampling clock (fFLTS) used
1510   *        by the digital filters.
1511   */
1512 #define HRTIM_FAULTPRESCALER_DIV1    (0x00000000U)                                     /*!< fFLTS=fHRTIM */
1513 #define HRTIM_FAULTPRESCALER_DIV2    (HRTIM_FLTINR2_FLTSD_0)                           /*!< fFLTS=fHRTIM / 2U */
1514 #define HRTIM_FAULTPRESCALER_DIV4    (HRTIM_FLTINR2_FLTSD_1)                           /*!< fFLTS=fHRTIM / 4U */
1515 #define HRTIM_FAULTPRESCALER_DIV8    (HRTIM_FLTINR2_FLTSD_1 | HRTIM_FLTINR2_FLTSD_0)   /*!< fFLTS=fHRTIM / 8U */
1516 /**
1517   * @}
1518   */
1519 
1520 /** @defgroup HRTIM_Burst_Mode_Operating_Mode HRTIM Burst Mode Operating Mode
1521   * @{
1522   * @brief Constants defining if the burst mode is entered once or if it is
1523   *        continuously operating
1524   */
1525 #define HRTIM_BURSTMODE_SINGLESHOT (0x00000000U)           /*!< Burst mode operates in single shot mode */
1526 #define HRTIM_BURSTMODE_CONTINOUS   (HRTIM_BMCR_BMOM)      /*!< Burst mode operates in continuous mode */
1527 /**
1528   * @}
1529   */
1530 
1531 /** @defgroup HRTIM_Burst_Mode_Clock_Source HRTIM Burst Mode Clock Source
1532   * @{
1533   * @brief Constants defining the clock source for the burst mode counter
1534   */
1535 #define HRTIM_BURSTMODECLOCKSOURCE_MASTER     (0x00000000U)                                                   /*!< Master timer counter reset/roll-over is used as clock source for the burst mode counter */
1536 #define HRTIM_BURSTMODECLOCKSOURCE_TIMER_A    (HRTIM_BMCR_BMCLK_0)                                            /*!< Timer A counter reset/roll-over is used as clock source for the burst mode counter */
1537 #define HRTIM_BURSTMODECLOCKSOURCE_TIMER_B    (HRTIM_BMCR_BMCLK_1)                                            /*!< Timer B counter reset/roll-over is used as clock source for the burst mode counter */
1538 #define HRTIM_BURSTMODECLOCKSOURCE_TIMER_C    (HRTIM_BMCR_BMCLK_1 | HRTIM_BMCR_BMCLK_0)                       /*!< Timer C counter reset/roll-over is used as clock source for the burst mode counter */
1539 #define HRTIM_BURSTMODECLOCKSOURCE_TIMER_D    (HRTIM_BMCR_BMCLK_2)                                            /*!< Timer D counter reset/roll-over is used as clock source for the burst mode counter */
1540 #define HRTIM_BURSTMODECLOCKSOURCE_TIMER_E    (HRTIM_BMCR_BMCLK_2 | HRTIM_BMCR_BMCLK_0)                       /*!< Timer E counter reset/roll-over is used as clock source for the burst mode counter */
1541 #define HRTIM_BURSTMODECLOCKSOURCE_TIM16_OC   (HRTIM_BMCR_BMCLK_2 | HRTIM_BMCR_BMCLK_1)                       /*!< On-chip Event 1 (BMClk[1]), acting as a burst mode counter clock */
1542 #define HRTIM_BURSTMODECLOCKSOURCE_TIM17_OC   (HRTIM_BMCR_BMCLK_2 | HRTIM_BMCR_BMCLK_1 | HRTIM_BMCR_BMCLK_0)  /*!< On-chip Event 2 (BMClk[2]), acting as a burst mode counter clock */
1543 #define HRTIM_BURSTMODECLOCKSOURCE_TIM7_TRGO  (HRTIM_BMCR_BMCLK_3)                                            /*!< On-chip Event 3 (BMClk[3]), acting as a burst mode counter clock */
1544 #define HRTIM_BURSTMODECLOCKSOURCE_FHRTIM     (HRTIM_BMCR_BMCLK_3 | HRTIM_BMCR_BMCLK_1)                       /*!< Prescaled fHRTIM clock is used as clock source for the burst mode counter */
1545 /**
1546   * @}
1547   */
1548 
1549 /** @defgroup HRTIM_Burst_Mode_Prescaler HRTIM Burst Mode Prescaler
1550   * @{
1551   * @brief Constants defining the prescaling ratio of the fHRTIM clock
1552   *        for the burst mode controller
1553   */
1554 #define HRTIM_BURSTMODEPRESCALER_DIV1     (0x00000000U)                                                                           /*!< fBRST = fHRTIM */
1555 #define HRTIM_BURSTMODEPRESCALER_DIV2     (HRTIM_BMCR_BMPRSC_0)                                                                   /*!< fBRST = fHRTIM/2U */
1556 #define HRTIM_BURSTMODEPRESCALER_DIV4     (HRTIM_BMCR_BMPRSC_1)                                                                   /*!< fBRST = fHRTIM/4U */
1557 #define HRTIM_BURSTMODEPRESCALER_DIV8     (HRTIM_BMCR_BMPRSC_1 | HRTIM_BMCR_BMPRSC_0)                                             /*!< fBRST = fHRTIM/8U */
1558 #define HRTIM_BURSTMODEPRESCALER_DIV16    (HRTIM_BMCR_BMPRSC_2)                                                                   /*!< fBRST = fHRTIM/16U */
1559 #define HRTIM_BURSTMODEPRESCALER_DIV32    (HRTIM_BMCR_BMPRSC_2 | HRTIM_BMCR_BMPRSC_0)                                             /*!< fBRST = fHRTIM/32U */
1560 #define HRTIM_BURSTMODEPRESCALER_DIV64    (HRTIM_BMCR_BMPRSC_2 | HRTIM_BMCR_BMPRSC_1)                                             /*!< fBRST = fHRTIM/64U */
1561 #define HRTIM_BURSTMODEPRESCALER_DIV128   (HRTIM_BMCR_BMPRSC_2 | HRTIM_BMCR_BMPRSC_1 | HRTIM_BMCR_BMPRSC_0)                       /*!< fBRST = fHRTIM/128U */
1562 #define HRTIM_BURSTMODEPRESCALER_DIV256   (HRTIM_BMCR_BMPRSC_3)                                                                   /*!< fBRST = fHRTIM/256U */
1563 #define HRTIM_BURSTMODEPRESCALER_DIV512   (HRTIM_BMCR_BMPRSC_3 | HRTIM_BMCR_BMPRSC_0)                                             /*!< fBRST = fHRTIM/512U */
1564 #define HRTIM_BURSTMODEPRESCALER_DIV1024  (HRTIM_BMCR_BMPRSC_3 | HRTIM_BMCR_BMPRSC_1)                                             /*!< fBRST = fHRTIM/1024U */
1565 #define HRTIM_BURSTMODEPRESCALER_DIV2048  (HRTIM_BMCR_BMPRSC_3 | HRTIM_BMCR_BMPRSC_1 | HRTIM_BMCR_BMPRSC_0)                       /*!< fBRST = fHRTIM/2048U*/
1566 #define HRTIM_BURSTMODEPRESCALER_DIV4096  (HRTIM_BMCR_BMPRSC_3 | HRTIM_BMCR_BMPRSC_2)                                             /*!< fBRST = fHRTIM/4096U */
1567 #define HRTIM_BURSTMODEPRESCALER_DIV8192  (HRTIM_BMCR_BMPRSC_3 | HRTIM_BMCR_BMPRSC_2 | HRTIM_BMCR_BMPRSC_0)                       /*!< fBRST = fHRTIM/8192U */
1568 #define HRTIM_BURSTMODEPRESCALER_DIV16384 (HRTIM_BMCR_BMPRSC_3 | HRTIM_BMCR_BMPRSC_2 | HRTIM_BMCR_BMPRSC_1)                       /*!< fBRST = fHRTIM/16384U */
1569 #define HRTIM_BURSTMODEPRESCALER_DIV32768 (HRTIM_BMCR_BMPRSC_3 | HRTIM_BMCR_BMPRSC_2 | HRTIM_BMCR_BMPRSC_1 | HRTIM_BMCR_BMPRSC_0) /*!< fBRST = fHRTIM/32768U */
1570 /**
1571   * @}
1572   */
1573 
1574 /** @defgroup HRTIM_Burst_Mode_Register_Preload_Enable HRTIM Burst Mode Register Preload Enable
1575   * @{
1576   * @brief Constants defining whether or not burst mode registers preload
1577            mechanism is enabled, i.e. a write access into a preloadable register
1578           (HRTIM_BMCMPR, HRTIM_BMPER) is done into the active or the preload register
1579   */
1580 #define HRIM_BURSTMODEPRELOAD_DISABLED (0x00000000U)  /*!< Preload disabled: the write access is directly done into active registers */
1581 #define HRIM_BURSTMODEPRELOAD_ENABLED  (HRTIM_BMCR_BMPREN)     /*!< Preload enabled: the write access is done into preload registers */
1582 /**
1583   * @}
1584   */
1585 
1586 /** @defgroup HRTIM_Burst_Mode_Trigger HRTIM Burst Mode Trigger
1587   * @{
1588   * @brief Constants defining the events that can be used to trig the burst
1589   *        mode operation
1590   */
1591 #define HRTIM_BURSTMODETRIGGER_NONE               0x00000000U             /*!<  No trigger */
1592 #define HRTIM_BURSTMODETRIGGER_MASTER_RESET       (HRTIM_BMTRGR_MSTRST)   /*!<  Master reset */
1593 #define HRTIM_BURSTMODETRIGGER_MASTER_REPETITION  (HRTIM_BMTRGR_MSTREP)   /*!<  Master repetition */
1594 #define HRTIM_BURSTMODETRIGGER_MASTER_CMP1        (HRTIM_BMTRGR_MSTCMP1)  /*!<  Master compare 1U */
1595 #define HRTIM_BURSTMODETRIGGER_MASTER_CMP2        (HRTIM_BMTRGR_MSTCMP2)  /*!<  Master compare 2U */
1596 #define HRTIM_BURSTMODETRIGGER_MASTER_CMP3        (HRTIM_BMTRGR_MSTCMP3)  /*!<  Master compare 3U */
1597 #define HRTIM_BURSTMODETRIGGER_MASTER_CMP4        (HRTIM_BMTRGR_MSTCMP4)  /*!<  Master compare 4U */
1598 #define HRTIM_BURSTMODETRIGGER_TIMERA_RESET       (HRTIM_BMTRGR_TARST)    /*!< Timer A reset  */
1599 #define HRTIM_BURSTMODETRIGGER_TIMERA_REPETITION  (HRTIM_BMTRGR_TAREP)    /*!< Timer A repetition  */
1600 #define HRTIM_BURSTMODETRIGGER_TIMERA_CMP1        (HRTIM_BMTRGR_TACMP1)   /*!< Timer A compare 1  */
1601 #define HRTIM_BURSTMODETRIGGER_TIMERA_CMP2        (HRTIM_BMTRGR_TACMP2)   /*!< Timer A compare 2  */
1602 #define HRTIM_BURSTMODETRIGGER_TIMERB_RESET       (HRTIM_BMTRGR_TBRST)    /*!< Timer B reset  */
1603 #define HRTIM_BURSTMODETRIGGER_TIMERB_REPETITION  (HRTIM_BMTRGR_TBREP)    /*!< Timer B repetition  */
1604 #define HRTIM_BURSTMODETRIGGER_TIMERB_CMP1        (HRTIM_BMTRGR_TBCMP1)   /*!< Timer B compare 1  */
1605 #define HRTIM_BURSTMODETRIGGER_TIMERB_CMP2        (HRTIM_BMTRGR_TBCMP2)   /*!< Timer B compare 2  */
1606 #define HRTIM_BURSTMODETRIGGER_TIMERC_RESET       (HRTIM_BMTRGR_TCRST)    /*!< Timer C reset  */
1607 #define HRTIM_BURSTMODETRIGGER_TIMERC_REPETITION  (HRTIM_BMTRGR_TCREP)    /*!< Timer C repetition  */
1608 #define HRTIM_BURSTMODETRIGGER_TIMERC_CMP1        (HRTIM_BMTRGR_TCCMP1)   /*!< Timer C compare 1  */
1609 #define HRTIM_BURSTMODETRIGGER_TIMERC_CMP2        (HRTIM_BMTRGR_TCCMP2)   /*!< Timer C compare 2  */
1610 #define HRTIM_BURSTMODETRIGGER_TIMERD_RESET       (HRTIM_BMTRGR_TDRST)    /*!< Timer D reset  */
1611 #define HRTIM_BURSTMODETRIGGER_TIMERD_REPETITION  (HRTIM_BMTRGR_TDREP)    /*!< Timer D repetition  */
1612 #define HRTIM_BURSTMODETRIGGER_TIMERD_CMP1        (HRTIM_BMTRGR_TDCMP1)   /*!< Timer D compare 1  */
1613 #define HRTIM_BURSTMODETRIGGER_TIMERD_CMP2        (HRTIM_BMTRGR_TDCMP2)   /*!< Timer D compare 2  */
1614 #define HRTIM_BURSTMODETRIGGER_TIMERE_RESET       (HRTIM_BMTRGR_TERST)    /*!< Timer E reset  */
1615 #define HRTIM_BURSTMODETRIGGER_TIMERE_REPETITION  (HRTIM_BMTRGR_TEREP)    /*!< Timer E repetition  */
1616 #define HRTIM_BURSTMODETRIGGER_TIMERE_CMP1        (HRTIM_BMTRGR_TECMP1)   /*!< Timer E compare 1  */
1617 #define HRTIM_BURSTMODETRIGGER_TIMERE_CMP2        (HRTIM_BMTRGR_TECMP2)   /*!< Timer E compare 2  */
1618 #define HRTIM_BURSTMODETRIGGER_TIMERA_EVENT7      (HRTIM_BMTRGR_TAEEV7)   /*!< Timer A period following External Event 7  */
1619 #define HRTIM_BURSTMODETRIGGER_TIMERD_EVENT8      (HRTIM_BMTRGR_TDEEV8)   /*!< Timer D period following External Event 8  */
1620 #define HRTIM_BURSTMODETRIGGER_EVENT_7            (HRTIM_BMTRGR_EEV7)     /*!< External Event 7 (timer A filters applied) */
1621 #define HRTIM_BURSTMODETRIGGER_EVENT_8            (HRTIM_BMTRGR_EEV8)     /*!< External Event 8 (timer D filters applied)*/
1622 #define HRTIM_BURSTMODETRIGGER_EVENT_ONCHIP       (HRTIM_BMTRGR_OCHPEV)   /*!< On-chip Event */
1623 /**
1624   * @}
1625   */
1626 
1627 /** @defgroup HRTIM_ADC_Trigger_Update_Source HRTIM ADC Trigger Update Source
1628   * @{
1629   * @brief constants defining the source triggering the update of the
1630      HRTIM_ADCxR register (transfer from preload to active register).
1631   */
1632 #define HRTIM_ADCTRIGGERUPDATE_MASTER  0x00000000U                                   /*!< Master timer */
1633 #define HRTIM_ADCTRIGGERUPDATE_TIMER_A (HRTIM_CR1_ADC1USRC_0)                        /*!< Timer A */
1634 #define HRTIM_ADCTRIGGERUPDATE_TIMER_B (HRTIM_CR1_ADC1USRC_1)                        /*!< Timer B */
1635 #define HRTIM_ADCTRIGGERUPDATE_TIMER_C (HRTIM_CR1_ADC1USRC_1 | HRTIM_CR1_ADC1USRC_0) /*!< Timer C */
1636 #define HRTIM_ADCTRIGGERUPDATE_TIMER_D (HRTIM_CR1_ADC1USRC_2)                        /*!< Timer D */
1637 #define HRTIM_ADCTRIGGERUPDATE_TIMER_E (HRTIM_CR1_ADC1USRC_2 | HRTIM_CR1_ADC1USRC_0) /*!< Timer E */
1638 /**
1639   * @}
1640   */
1641 
1642 /** @defgroup HRTIM_ADC_Trigger_Event HRTIM ADC Trigger Event
1643   * @{
1644   * @brief constants defining the events triggering ADC conversion.
1645   *        HRTIM_ADCTRIGGEREVENT13_*: ADC Triggers 1 and 3
1646   *        HRTIM_ADCTRIGGEREVENT24_*: ADC Triggers 2 and 4
1647   */
1648 #define HRTIM_ADCTRIGGEREVENT13_NONE           0x00000000U              /*!< No ADC trigger event */
1649 #define HRTIM_ADCTRIGGEREVENT13_MASTER_CMP1    (HRTIM_ADC1R_AD1MC1)     /*!< ADC Trigger on master compare 1U */
1650 #define HRTIM_ADCTRIGGEREVENT13_MASTER_CMP2    (HRTIM_ADC1R_AD1MC2)     /*!< ADC Trigger on master compare 2U */
1651 #define HRTIM_ADCTRIGGEREVENT13_MASTER_CMP3    (HRTIM_ADC1R_AD1MC3)     /*!< ADC Trigger on master compare 3U */
1652 #define HRTIM_ADCTRIGGEREVENT13_MASTER_CMP4    (HRTIM_ADC1R_AD1MC4)     /*!< ADC Trigger on master compare 4U */
1653 #define HRTIM_ADCTRIGGEREVENT13_MASTER_PERIOD  (HRTIM_ADC1R_AD1MPER)    /*!< ADC Trigger on master period */
1654 #define HRTIM_ADCTRIGGEREVENT13_EVENT_1        (HRTIM_ADC1R_AD1EEV1)    /*!< ADC Trigger on external event 1U */
1655 #define HRTIM_ADCTRIGGEREVENT13_EVENT_2        (HRTIM_ADC1R_AD1EEV2)    /*!< ADC Trigger on external event 2U */
1656 #define HRTIM_ADCTRIGGEREVENT13_EVENT_3        (HRTIM_ADC1R_AD1EEV3)    /*!< ADC Trigger on external event 3U */
1657 #define HRTIM_ADCTRIGGEREVENT13_EVENT_4        (HRTIM_ADC1R_AD1EEV4)    /*!< ADC Trigger on external event 4U */
1658 #define HRTIM_ADCTRIGGEREVENT13_EVENT_5        (HRTIM_ADC1R_AD1EEV5)    /*!< ADC Trigger on external event 5U */
1659 #define HRTIM_ADCTRIGGEREVENT13_TIMERA_CMP2    (HRTIM_ADC1R_AD1TAC2)    /*!< ADC Trigger on Timer A compare 2U */
1660 #define HRTIM_ADCTRIGGEREVENT13_TIMERA_CMP3    (HRTIM_ADC1R_AD1TAC3)    /*!< ADC Trigger on Timer A compare 3U */
1661 #define HRTIM_ADCTRIGGEREVENT13_TIMERA_CMP4    (HRTIM_ADC1R_AD1TAC4)    /*!< ADC Trigger on Timer A compare 4U */
1662 #define HRTIM_ADCTRIGGEREVENT13_TIMERA_PERIOD  (HRTIM_ADC1R_AD1TAPER)   /*!< ADC Trigger on Timer A period */
1663 #define HRTIM_ADCTRIGGEREVENT13_TIMERA_RESET   (HRTIM_ADC1R_AD1TARST)   /*!< ADC Trigger on Timer A reset */
1664 #define HRTIM_ADCTRIGGEREVENT13_TIMERB_CMP2    (HRTIM_ADC1R_AD1TBC2)    /*!< ADC Trigger on Timer B compare 2U */
1665 #define HRTIM_ADCTRIGGEREVENT13_TIMERB_CMP3    (HRTIM_ADC1R_AD1TBC3)    /*!< ADC Trigger on Timer B compare 3U */
1666 #define HRTIM_ADCTRIGGEREVENT13_TIMERB_CMP4    (HRTIM_ADC1R_AD1TBC4)    /*!< ADC Trigger on Timer B compare 4U */
1667 #define HRTIM_ADCTRIGGEREVENT13_TIMERB_PERIOD  (HRTIM_ADC1R_AD1TBPER)   /*!< ADC Trigger on Timer B period */
1668 #define HRTIM_ADCTRIGGEREVENT13_TIMERB_RESET   (HRTIM_ADC1R_AD1TBRST)   /*!< ADC Trigger on Timer B reset */
1669 #define HRTIM_ADCTRIGGEREVENT13_TIMERC_CMP2    (HRTIM_ADC1R_AD1TCC2)    /*!< ADC Trigger on Timer C compare 2U */
1670 #define HRTIM_ADCTRIGGEREVENT13_TIMERC_CMP3    (HRTIM_ADC1R_AD1TCC3)    /*!< ADC Trigger on Timer C compare 3U */
1671 #define HRTIM_ADCTRIGGEREVENT13_TIMERC_CMP4    (HRTIM_ADC1R_AD1TCC4)    /*!< ADC Trigger on Timer C compare 4U */
1672 #define HRTIM_ADCTRIGGEREVENT13_TIMERC_PERIOD  (HRTIM_ADC1R_AD1TCPER)   /*!< ADC Trigger on Timer C period */
1673 #define HRTIM_ADCTRIGGEREVENT13_TIMERD_CMP2    (HRTIM_ADC1R_AD1TDC2)    /*!< ADC Trigger on Timer D compare 2U */
1674 #define HRTIM_ADCTRIGGEREVENT13_TIMERD_CMP3    (HRTIM_ADC1R_AD1TDC3)    /*!< ADC Trigger on Timer D compare 3U */
1675 #define HRTIM_ADCTRIGGEREVENT13_TIMERD_CMP4    (HRTIM_ADC1R_AD1TDC4)    /*!< ADC Trigger on Timer D compare 4U */
1676 #define HRTIM_ADCTRIGGEREVENT13_TIMERD_PERIOD  (HRTIM_ADC1R_AD1TDPER)   /*!< ADC Trigger on Timer D period */
1677 #define HRTIM_ADCTRIGGEREVENT13_TIMERE_CMP2    (HRTIM_ADC1R_AD1TEC2)    /*!< ADC Trigger on Timer E compare 2U */
1678 #define HRTIM_ADCTRIGGEREVENT13_TIMERE_CMP3    (HRTIM_ADC1R_AD1TEC3)    /*!< ADC Trigger on Timer E compare 3U */
1679 #define HRTIM_ADCTRIGGEREVENT13_TIMERE_CMP4    (HRTIM_ADC1R_AD1TEC4)    /*!< ADC Trigger on Timer E compare 4U */
1680 #define HRTIM_ADCTRIGGEREVENT13_TIMERE_PERIOD  (HRTIM_ADC1R_AD1TEPER)   /*!< ADC Trigger on Timer E period */
1681 
1682 #define HRTIM_ADCTRIGGEREVENT24_NONE           0x00000000U               /*!< No ADC trigger event */
1683 #define HRTIM_ADCTRIGGEREVENT24_MASTER_CMP1    (HRTIM_ADC2R_AD2MC1)     /*!< ADC Trigger on master compare 1U */
1684 #define HRTIM_ADCTRIGGEREVENT24_MASTER_CMP2    (HRTIM_ADC2R_AD2MC2)     /*!< ADC Trigger on master compare 2U */
1685 #define HRTIM_ADCTRIGGEREVENT24_MASTER_CMP3    (HRTIM_ADC2R_AD2MC3)     /*!< ADC Trigger on master compare 3U */
1686 #define HRTIM_ADCTRIGGEREVENT24_MASTER_CMP4    (HRTIM_ADC2R_AD2MC4)     /*!< ADC Trigger on master compare 4U */
1687 #define HRTIM_ADCTRIGGEREVENT24_MASTER_PERIOD  (HRTIM_ADC2R_AD2MPER)    /*!< ADC Trigger on master period */
1688 #define HRTIM_ADCTRIGGEREVENT24_EVENT_6        (HRTIM_ADC2R_AD2EEV6)    /*!< ADC Trigger on external event 6U */
1689 #define HRTIM_ADCTRIGGEREVENT24_EVENT_7        (HRTIM_ADC2R_AD2EEV7)    /*!< ADC Trigger on external event 7U */
1690 #define HRTIM_ADCTRIGGEREVENT24_EVENT_8        (HRTIM_ADC2R_AD2EEV8)    /*!< ADC Trigger on external event 8U */
1691 #define HRTIM_ADCTRIGGEREVENT24_EVENT_9        (HRTIM_ADC2R_AD2EEV9)    /*!< ADC Trigger on external event 9U */
1692 #define HRTIM_ADCTRIGGEREVENT24_EVENT_10       (HRTIM_ADC2R_AD2EEV10)   /*!< ADC Trigger on external event 10U */
1693 #define HRTIM_ADCTRIGGEREVENT24_TIMERA_CMP2    (HRTIM_ADC2R_AD2TAC2)    /*!< ADC Trigger on Timer A compare 2U */
1694 #define HRTIM_ADCTRIGGEREVENT24_TIMERA_CMP3    (HRTIM_ADC2R_AD2TAC3)    /*!< ADC Trigger on Timer A compare 3U */
1695 #define HRTIM_ADCTRIGGEREVENT24_TIMERA_CMP4    (HRTIM_ADC2R_AD2TAC4)    /*!< ADC Trigger on Timer A compare 4U */
1696 #define HRTIM_ADCTRIGGEREVENT24_TIMERA_PERIOD  (HRTIM_ADC2R_AD2TAPER)   /*!< ADC Trigger on Timer A period */
1697 #define HRTIM_ADCTRIGGEREVENT24_TIMERB_CMP2    (HRTIM_ADC2R_AD2TBC2)    /*!< ADC Trigger on Timer B compare 2U */
1698 #define HRTIM_ADCTRIGGEREVENT24_TIMERB_CMP3    (HRTIM_ADC2R_AD2TBC3)    /*!< ADC Trigger on Timer B compare 3U */
1699 #define HRTIM_ADCTRIGGEREVENT24_TIMERB_CMP4    (HRTIM_ADC2R_AD2TBC4)    /*!< ADC Trigger on Timer B compare 4U */
1700 #define HRTIM_ADCTRIGGEREVENT24_TIMERB_PERIOD  (HRTIM_ADC2R_AD2TBPER)   /*!< ADC Trigger on Timer B period */
1701 #define HRTIM_ADCTRIGGEREVENT24_TIMERC_CMP2    (HRTIM_ADC2R_AD2TCC2)    /*!< ADC Trigger on Timer C compare 2U */
1702 #define HRTIM_ADCTRIGGEREVENT24_TIMERC_CMP3    (HRTIM_ADC2R_AD2TCC3)    /*!< ADC Trigger on Timer C compare 3U */
1703 #define HRTIM_ADCTRIGGEREVENT24_TIMERC_CMP4    (HRTIM_ADC2R_AD2TCC4)    /*!< ADC Trigger on Timer C compare 4U */
1704 #define HRTIM_ADCTRIGGEREVENT24_TIMERC_PERIOD  (HRTIM_ADC2R_AD2TCPER)   /*!< ADC Trigger on Timer C period */
1705 #define HRTIM_ADCTRIGGEREVENT24_TIMERC_RESET   (HRTIM_ADC2R_AD2TCRST)   /*!< ADC Trigger on Timer C reset */
1706 #define HRTIM_ADCTRIGGEREVENT24_TIMERD_CMP2    (HRTIM_ADC2R_AD2TDC2)    /*!< ADC Trigger on Timer D compare 2U */
1707 #define HRTIM_ADCTRIGGEREVENT24_TIMERD_CMP3    (HRTIM_ADC2R_AD2TDC3)    /*!< ADC Trigger on Timer D compare 3U */
1708 #define HRTIM_ADCTRIGGEREVENT24_TIMERD_CMP4    (HRTIM_ADC2R_AD2TDC4)    /*!< ADC Trigger on Timer D compare 4U */
1709 #define HRTIM_ADCTRIGGEREVENT24_TIMERD_PERIOD  (HRTIM_ADC2R_AD2TDPER)   /*!< ADC Trigger on Timer D period */
1710 #define HRTIM_ADCTRIGGEREVENT24_TIMERD_RESET   (HRTIM_ADC2R_AD2TDRST)   /*!< ADC Trigger on Timer D reset */
1711 #define HRTIM_ADCTRIGGEREVENT24_TIMERE_CMP2    (HRTIM_ADC2R_AD2TEC2)    /*!< ADC Trigger on Timer E compare 2U */
1712 #define HRTIM_ADCTRIGGEREVENT24_TIMERE_CMP3    (HRTIM_ADC2R_AD2TEC3)    /*!< ADC Trigger on Timer E compare 3U */
1713 #define HRTIM_ADCTRIGGEREVENT24_TIMERE_CMP4    (HRTIM_ADC2R_AD2TEC4)    /*!< ADC Trigger on Timer E compare 4U */
1714 #define HRTIM_ADCTRIGGEREVENT24_TIMERE_RESET   (HRTIM_ADC2R_AD2TERST)   /*!< ADC Trigger on Timer E reset */
1715 
1716 /**
1717   * @}
1718   */
1719 
1720 /** @defgroup HRTIM_Burst_DMA_Registers_Update HRTIM Burst DMA Registers Update
1721   * @{
1722   * @brief Constants defining the registers that can be written during a burst
1723   *        DMA operation
1724   */
1725 #define HRTIM_BURSTDMA_NONE  0x00000000U               /*!< No register is updated by Burst DMA accesses */
1726 #define HRTIM_BURSTDMA_CR    (HRTIM_BDTUPR_TIMCR)      /*!< MCR or TIMxCR register is updated by Burst DMA accesses */
1727 #define HRTIM_BURSTDMA_ICR   (HRTIM_BDTUPR_TIMICR)     /*!< MICR or TIMxICR register is updated by Burst DMA accesses */
1728 #define HRTIM_BURSTDMA_DIER  (HRTIM_BDTUPR_TIMDIER)    /*!< MDIER or TIMxDIER register is updated by Burst DMA accesses */
1729 #define HRTIM_BURSTDMA_CNT   (HRTIM_BDTUPR_TIMCNT)     /*!< MCNTR or CNTxCR register is updated by Burst DMA accesses */
1730 #define HRTIM_BURSTDMA_PER   (HRTIM_BDTUPR_TIMPER)     /*!< MPER or PERxR register is updated by Burst DMA accesses */
1731 #define HRTIM_BURSTDMA_REP   (HRTIM_BDTUPR_TIMREP)     /*!< MREPR or REPxR register is updated by Burst DMA accesses */
1732 #define HRTIM_BURSTDMA_CMP1  (HRTIM_BDTUPR_TIMCMP1)    /*!< MCMP1R or CMP1xR register is updated by Burst DMA accesses */
1733 #define HRTIM_BURSTDMA_CMP2  (HRTIM_BDTUPR_TIMCMP2)    /*!< MCMP2R or CMP2xR register is updated by Burst DMA accesses */
1734 #define HRTIM_BURSTDMA_CMP3  (HRTIM_BDTUPR_TIMCMP3)    /*!< MCMP3R or CMP3xR register is updated by Burst DMA accesses */
1735 #define HRTIM_BURSTDMA_CMP4  (HRTIM_BDTUPR_TIMCMP4)    /*!< MCMP4R or CMP4xR register is updated by Burst DMA accesses */
1736 #define HRTIM_BURSTDMA_DTR   (HRTIM_BDTUPR_TIMDTR)     /*!< TDxR register is updated by Burst DMA accesses */
1737 #define HRTIM_BURSTDMA_SET1R (HRTIM_BDTUPR_TIMSET1R)   /*!< SET1R register is updated by Burst DMA accesses */
1738 #define HRTIM_BURSTDMA_RST1R (HRTIM_BDTUPR_TIMRST1R)   /*!< RST1R register is updated by Burst DMA accesses */
1739 #define HRTIM_BURSTDMA_SET2R (HRTIM_BDTUPR_TIMSET2R)   /*!< SET2R register is updated by Burst DMA accesses */
1740 #define HRTIM_BURSTDMA_RST2R (HRTIM_BDTUPR_TIMRST2R)   /*!< RST1R register is updated by Burst DMA accesses */
1741 #define HRTIM_BURSTDMA_EEFR1 (HRTIM_BDTUPR_TIMEEFR1)   /*!< EEFxR1 register is updated by Burst DMA accesses */
1742 #define HRTIM_BURSTDMA_EEFR2 (HRTIM_BDTUPR_TIMEEFR2)   /*!< EEFxR2 register is updated by Burst DMA accesses */
1743 #define HRTIM_BURSTDMA_RSTR  (HRTIM_BDTUPR_TIMRSTR)    /*!< RSTxR register is updated by Burst DMA accesses */
1744 #define HRTIM_BURSTDMA_CHPR  (HRTIM_BDTUPR_TIMCHPR)    /*!< CHPxR register is updated by Burst DMA accesses */
1745 #define HRTIM_BURSTDMA_OUTR  (HRTIM_BDTUPR_TIMOUTR)    /*!< OUTxR register is updated by Burst DMA accesses */
1746 #define HRTIM_BURSTDMA_FLTR  (HRTIM_BDTUPR_TIMFLTR)    /*!< FLTxR register is updated by Burst DMA accesses */
1747 /**
1748   * @}
1749   */
1750 
1751 /** @defgroup HRTIM_Burst_Mode_Control HRTIM Burst Mode Control
1752   * @{
1753   * @brief Constants used to enable or disable the burst mode controller
1754   */
1755 #define HRTIM_BURSTMODECTL_DISABLED 0x00000000U          /*!< Burst mode disabled */
1756 #define HRTIM_BURSTMODECTL_ENABLED  (HRTIM_BMCR_BME)     /*!< Burst mode enabled */
1757 /**
1758   * @}
1759   */
1760 
1761 /** @defgroup HRTIM_Fault_Mode_Control  HRTIM Fault Mode Control
1762   * @{
1763   * @brief Constants used to enable or disable a fault channel
1764   */
1765 #define HRTIM_FAULTMODECTL_DISABLED 0x00000000U /*!< Fault channel is disabled */
1766 #define HRTIM_FAULTMODECTL_ENABLED  0x00000001U /*!< Fault channel is  enabled */
1767 /**
1768   * @}
1769   */
1770 
1771 /** @defgroup HRTIM_Software_Timer_Update HRTIM Software Timer Update
1772   * @{
1773   * @brief Constants used to force timer registers update
1774   */
1775 #define HRTIM_TIMERUPDATE_MASTER    (HRTIM_CR2_MSWU)     /*!< Force an immediate transfer from the preload to the active register in the master timer */
1776 #define HRTIM_TIMERUPDATE_A         (HRTIM_CR2_TASWU)    /*!< Force an immediate transfer from the preload to the active register in the timer A */
1777 #define HRTIM_TIMERUPDATE_B         (HRTIM_CR2_TBSWU)    /*!< Force an immediate transfer from the preload to the active register in the timer B */
1778 #define HRTIM_TIMERUPDATE_C         (HRTIM_CR2_TCSWU)    /*!< Force an immediate transfer from the preload to the active register in the timer C */
1779 #define HRTIM_TIMERUPDATE_D         (HRTIM_CR2_TDSWU)    /*!< Force an immediate transfer from the preload to the active register in the timer D */
1780 #define HRTIM_TIMERUPDATE_E         (HRTIM_CR2_TESWU)    /*!< Force an immediate transfer from the preload to the active register in the timer E */
1781 /**
1782   * @}
1783   */
1784 
1785 /** @defgroup HRTIM_Software_Timer_Reset HRTIM Software Timer Reset
1786   * @{
1787   * @brief Constants used to force timer counter reset
1788   */
1789 #define HRTIM_TIMERRESET_MASTER    (HRTIM_CR2_MRST)     /*!< Reset the master timer counter */
1790 #define HRTIM_TIMERRESET_TIMER_A   (HRTIM_CR2_TARST)    /*!< Reset the timer A counter */
1791 #define HRTIM_TIMERRESET_TIMER_B   (HRTIM_CR2_TBRST)    /*!< Reset the timer B counter */
1792 #define HRTIM_TIMERRESET_TIMER_C   (HRTIM_CR2_TCRST)    /*!< Reset the timer C counter */
1793 #define HRTIM_TIMERRESET_TIMER_D   (HRTIM_CR2_TDRST)    /*!< Reset the timer D counter */
1794 #define HRTIM_TIMERRESET_TIMER_E   (HRTIM_CR2_TERST)    /*!< Reset the timer E counter */
1795 /**
1796   * @}
1797   */
1798 
1799 /** @defgroup HRTIM_Output_Level HRTIM Output Level
1800   * @{
1801   * @brief Constants defining the level of a timer output
1802   */
1803 #define HRTIM_OUTPUTLEVEL_ACTIVE     (0x00000001U) /*!< Force the output to its active state */
1804 #define HRTIM_OUTPUTLEVEL_INACTIVE   (0x00000002U) /*!< Force the output to its inactive state */
1805 
1806 #define IS_HRTIM_OUTPUTLEVEL(OUTPUTLEVEL)\
1807     (((OUTPUTLEVEL) == HRTIM_OUTPUTLEVEL_ACTIVE)  || \
1808      ((OUTPUTLEVEL) == HRTIM_OUTPUTLEVEL_INACTIVE))
1809 /**
1810   * @}
1811   */
1812 
1813 /** @defgroup HRTIM_Output_State HRTIM Output State
1814   * @{
1815   * @brief Constants defining the state of a timer output
1816   */
1817 #define HRTIM_OUTPUTSTATE_IDLE     (0x00000001U)  /*!< Main operating mode, where the output can take the active or
1818                                                               inactive level as programmed in the crossbar unit */
1819 #define HRTIM_OUTPUTSTATE_RUN      (0x00000002U)  /*!< Default operating state (e.g. after an HRTIM reset, when the
1820                                                               outputs are disabled by software or during a burst mode operation */
1821 #define HRTIM_OUTPUTSTATE_FAULT    (0x00000003U)  /*!< Safety state, entered in case of a shut-down request on
1822                                                               FAULTx inputs */
1823 /**
1824   * @}
1825   */
1826 
1827 /** @defgroup HRTIM_Burst_Mode_Status HRTIM Burst Mode Status
1828   * @{
1829   * @brief Constants defining the operating state of the burst mode controller
1830   */
1831 #define HRTIM_BURSTMODESTATUS_NORMAL   0x00000000U          /*!< Normal operation */
1832 #define HRTIM_BURSTMODESTATUS_ONGOING (HRTIM_BMCR_BMSTAT)   /*!< Burst operation on-going */
1833 /**
1834   * @}
1835   */
1836 
1837 /** @defgroup HRTIM_Current_Push_Pull_Status HRTIM Current Push Pull Status
1838   * @{
1839   * @brief Constants defining on which output the signal is currently applied
1840   *        in push-pull mode
1841   */
1842 #define HRTIM_PUSHPULL_CURRENTSTATUS_OUTPUT1    0x00000000U            /*!< Signal applied on output 1 and output 2 forced inactive */
1843 #define HRTIM_PUSHPULL_CURRENTSTATUS_OUTPUT2   (HRTIM_TIMISR_CPPSTAT)  /*!< Signal applied on output 2 and output 1 forced inactive */
1844 /**
1845   * @}
1846   */
1847 
1848 /** @defgroup HRTIM_Idle_Push_Pull_Status HRTIM Idle Push Pull Status
1849   * @{
1850   * @brief Constants defining on which output the signal was applied, in
1851   *        push-pull mode balanced fault mode or delayed idle mode, when the
1852   *        protection was triggered
1853   */
1854 #define HRTIM_PUSHPULL_IDLESTATUS_OUTPUT1    0x00000000U               /*!< Protection occurred when the output 1 was active and output 2 forced inactive */
1855 #define HRTIM_PUSHPULL_IDLESTATUS_OUTPUT2   (HRTIM_TIMISR_IPPSTAT)     /*!< Protection occurred when the output 2 was active and output 1 forced inactive */
1856 /**
1857   * @}
1858   */
1859 
1860 /** @defgroup HRTIM_Common_Interrupt_Enable HRTIM Common Interrupt Enable
1861   * @{
1862   */
1863 #define HRTIM_IT_NONE           0x00000000U           /*!< No interrupt enabled */
1864 #define HRTIM_IT_FLT1           HRTIM_IER_FLT1        /*!< Fault 1 interrupt enable */
1865 #define HRTIM_IT_FLT2           HRTIM_IER_FLT2        /*!< Fault 2 interrupt enable */
1866 #define HRTIM_IT_FLT3           HRTIM_IER_FLT3        /*!< Fault 3 interrupt enable */
1867 #define HRTIM_IT_FLT4           HRTIM_IER_FLT4        /*!< Fault 4 interrupt enable */
1868 #define HRTIM_IT_FLT5           HRTIM_IER_FLT5        /*!< Fault 5 interrupt enable */
1869 #define HRTIM_IT_SYSFLT         HRTIM_IER_SYSFLT      /*!< System Fault interrupt enable */
1870 #define HRTIM_IT_BMPER          HRTIM_IER_BMPER       /*!<  Burst mode period interrupt enable */
1871 /**
1872   * @}
1873   */
1874 
1875 /** @defgroup HRTIM_Master_Interrupt_Enable HRTIM Master Interrupt Enable
1876   * @{
1877   */
1878 #define HRTIM_MASTER_IT_NONE         0x00000000U           /*!< No interrupt enabled */
1879 #define HRTIM_MASTER_IT_MCMP1        HRTIM_MDIER_MCMP1IE   /*!< Master compare 1 interrupt enable */
1880 #define HRTIM_MASTER_IT_MCMP2        HRTIM_MDIER_MCMP2IE   /*!< Master compare 2 interrupt enable */
1881 #define HRTIM_MASTER_IT_MCMP3        HRTIM_MDIER_MCMP3IE   /*!< Master compare 3 interrupt enable */
1882 #define HRTIM_MASTER_IT_MCMP4        HRTIM_MDIER_MCMP4IE   /*!< Master compare 4 interrupt enable */
1883 #define HRTIM_MASTER_IT_MREP         HRTIM_MDIER_MREPIE    /*!< Master Repetition interrupt enable */
1884 #define HRTIM_MASTER_IT_SYNC         HRTIM_MDIER_SYNCIE    /*!< Synchronization input interrupt enable */
1885 #define HRTIM_MASTER_IT_MUPD         HRTIM_MDIER_MUPDIE    /*!< Master update interrupt enable */
1886 /**
1887   * @}
1888   */
1889 
1890 /** @defgroup HRTIM_Timing_Unit_Interrupt_Enable HRTIM Timing Unit Interrupt Enable
1891   * @{
1892   */
1893 #define HRTIM_TIM_IT_NONE       0x00000000U               /*!< No interrupt enabled */
1894 #define HRTIM_TIM_IT_CMP1       HRTIM_TIMDIER_CMP1IE      /*!< Timer compare 1 interrupt enable */
1895 #define HRTIM_TIM_IT_CMP2       HRTIM_TIMDIER_CMP2IE      /*!< Timer compare 2 interrupt enable */
1896 #define HRTIM_TIM_IT_CMP3       HRTIM_TIMDIER_CMP3IE      /*!< Timer compare 3 interrupt enable */
1897 #define HRTIM_TIM_IT_CMP4       HRTIM_TIMDIER_CMP4IE      /*!< Timer compare 4 interrupt enable */
1898 #define HRTIM_TIM_IT_REP        HRTIM_TIMDIER_REPIE       /*!< Timer repetition interrupt enable */
1899 #define HRTIM_TIM_IT_UPD        HRTIM_TIMDIER_UPDIE       /*!< Timer update interrupt enable */
1900 #define HRTIM_TIM_IT_CPT1       HRTIM_TIMDIER_CPT1IE      /*!< Timer capture 1 interrupt enable */
1901 #define HRTIM_TIM_IT_CPT2       HRTIM_TIMDIER_CPT2IE      /*!< Timer capture 2 interrupt enable */
1902 #define HRTIM_TIM_IT_SET1       HRTIM_TIMDIER_SET1IE      /*!< Timer output 1 set interrupt enable */
1903 #define HRTIM_TIM_IT_RST1       HRTIM_TIMDIER_RST1IE      /*!< Timer output 1 reset interrupt enable */
1904 #define HRTIM_TIM_IT_SET2       HRTIM_TIMDIER_SET2IE      /*!< Timer output 2 set interrupt enable */
1905 #define HRTIM_TIM_IT_RST2       HRTIM_TIMDIER_RST2IE      /*!< Timer output 2 reset interrupt enable */
1906 #define HRTIM_TIM_IT_RST        HRTIM_TIMDIER_RSTIE       /*!< Timer reset interrupt enable */
1907 #define HRTIM_TIM_IT_DLYPRT     HRTIM_TIMDIER_DLYPRTIE    /*!< Timer delay protection interrupt enable */
1908 /**
1909   * @}
1910   */
1911 
1912 /** @defgroup HRTIM_Common_Interrupt_Flag HRTIM Common Interrupt Flag
1913   * @{
1914   */
1915 #define HRTIM_FLAG_FLT1           HRTIM_ISR_FLT1    /*!< Fault 1 interrupt flag */
1916 #define HRTIM_FLAG_FLT2           HRTIM_ISR_FLT2    /*!< Fault 2 interrupt flag */
1917 #define HRTIM_FLAG_FLT3           HRTIM_ISR_FLT3    /*!< Fault 3 interrupt flag */
1918 #define HRTIM_FLAG_FLT4           HRTIM_ISR_FLT4    /*!< Fault 4 interrupt flag */
1919 #define HRTIM_FLAG_FLT5           HRTIM_ISR_FLT5    /*!< Fault 5 interrupt flag */
1920 #define HRTIM_FLAG_SYSFLT         HRTIM_ISR_SYSFLT  /*!< System Fault interrupt flag */
1921 #define HRTIM_FLAG_BMPER          HRTIM_ISR_BMPER   /*!< Burst mode period interrupt flag */
1922 /**
1923   * @}
1924   */
1925 
1926 /** @defgroup HRTIM_Master_Interrupt_Flag HRTIM Master Interrupt Flag
1927   * @{
1928   */
1929 #define HRTIM_MASTER_FLAG_MCMP1        HRTIM_MISR_MCMP1    /*!< Master compare 1 interrupt flag */
1930 #define HRTIM_MASTER_FLAG_MCMP2        HRTIM_MISR_MCMP2    /*!< Master compare 2 interrupt flag */
1931 #define HRTIM_MASTER_FLAG_MCMP3        HRTIM_MISR_MCMP3    /*!< Master compare 3 interrupt flag */
1932 #define HRTIM_MASTER_FLAG_MCMP4        HRTIM_MISR_MCMP4    /*!< Master compare 4 interrupt flag */
1933 #define HRTIM_MASTER_FLAG_MREP         HRTIM_MISR_MREP     /*!< Master Repetition interrupt flag */
1934 #define HRTIM_MASTER_FLAG_SYNC         HRTIM_MISR_SYNC     /*!< Synchronization input interrupt flag */
1935 #define HRTIM_MASTER_FLAG_MUPD         HRTIM_MISR_MUPD     /*!< Master update interrupt flag */
1936 /**
1937   * @}
1938   */
1939 
1940 /** @defgroup HRTIM_Timing_Unit_Interrupt_Flag HRTIM Timing Unit Interrupt Flag
1941   * @{
1942   */
1943 #define HRTIM_TIM_FLAG_CMP1       HRTIM_TIMISR_CMP1      /*!< Timer compare 1 interrupt flag */
1944 #define HRTIM_TIM_FLAG_CMP2       HRTIM_TIMISR_CMP2      /*!< Timer compare 2 interrupt flag */
1945 #define HRTIM_TIM_FLAG_CMP3       HRTIM_TIMISR_CMP3      /*!< Timer compare 3 interrupt flag */
1946 #define HRTIM_TIM_FLAG_CMP4       HRTIM_TIMISR_CMP4      /*!< Timer compare 4 interrupt flag */
1947 #define HRTIM_TIM_FLAG_REP        HRTIM_TIMISR_REP       /*!< Timer repetition interrupt flag */
1948 #define HRTIM_TIM_FLAG_UPD        HRTIM_TIMISR_UPD       /*!< Timer update interrupt flag */
1949 #define HRTIM_TIM_FLAG_CPT1       HRTIM_TIMISR_CPT1      /*!< Timer capture 1 interrupt flag */
1950 #define HRTIM_TIM_FLAG_CPT2       HRTIM_TIMISR_CPT2      /*!< Timer capture 2 interrupt flag */
1951 #define HRTIM_TIM_FLAG_SET1       HRTIM_TIMISR_SET1      /*!< Timer output 1 set interrupt flag */
1952 #define HRTIM_TIM_FLAG_RST1       HRTIM_TIMISR_RST1      /*!< Timer output 1 reset interrupt flag */
1953 #define HRTIM_TIM_FLAG_SET2       HRTIM_TIMISR_SET2      /*!< Timer output 2 set interrupt flag */
1954 #define HRTIM_TIM_FLAG_RST2       HRTIM_TIMISR_RST2      /*!< Timer output 2 reset interrupt flag */
1955 #define HRTIM_TIM_FLAG_RST        HRTIM_TIMISR_RST       /*!< Timer reset interrupt flag */
1956 #define HRTIM_TIM_FLAG_DLYPRT     HRTIM_TIMISR_DLYPRT    /*!< Timer delay protection interrupt flag */
1957 /**
1958   * @}
1959   */
1960 
1961 /** @defgroup HRTIM_Master_DMA_Request_Enable HRTIM Master DMA Request Enable
1962   * @{
1963   */
1964 #define HRTIM_MASTER_DMA_NONE         0x00000000U            /*!< No DMA request enable */
1965 #define HRTIM_MASTER_DMA_MCMP1        HRTIM_MDIER_MCMP1DE    /*!< Master compare 1 DMA request enable */
1966 #define HRTIM_MASTER_DMA_MCMP2        HRTIM_MDIER_MCMP2DE    /*!< Master compare 2 DMA request enable */
1967 #define HRTIM_MASTER_DMA_MCMP3        HRTIM_MDIER_MCMP3DE    /*!< Master compare 3 DMA request enable */
1968 #define HRTIM_MASTER_DMA_MCMP4        HRTIM_MDIER_MCMP4DE    /*!< Master compare 4 DMA request enable */
1969 #define HRTIM_MASTER_DMA_MREP         HRTIM_MDIER_MREPDE     /*!< Master Repetition DMA request enable */
1970 #define HRTIM_MASTER_DMA_SYNC         HRTIM_MDIER_SYNCDE     /*!< Synchronization input DMA request enable */
1971 #define HRTIM_MASTER_DMA_MUPD         HRTIM_MDIER_MUPDDE     /*!< Master update DMA request enable */
1972 /**
1973   * @}
1974   */
1975 
1976 /** @defgroup HRTIM_Timing_Unit_DMA_Request_Enable HRTIM Timing Unit DMA Request Enable
1977   * @{
1978   */
1979 #define HRTIM_TIM_DMA_NONE       0x00000000U               /*!< No DMA request enable */
1980 #define HRTIM_TIM_DMA_CMP1       HRTIM_TIMDIER_CMP1DE      /*!< Timer compare 1 DMA request enable */
1981 #define HRTIM_TIM_DMA_CMP2       HRTIM_TIMDIER_CMP2DE      /*!< Timer compare 2 DMA request enable */
1982 #define HRTIM_TIM_DMA_CMP3       HRTIM_TIMDIER_CMP3DE      /*!< Timer compare 3 DMA request enable */
1983 #define HRTIM_TIM_DMA_CMP4       HRTIM_TIMDIER_CMP4DE      /*!< Timer compare 4 DMA request enable */
1984 #define HRTIM_TIM_DMA_REP        HRTIM_TIMDIER_REPDE       /*!< Timer repetition DMA request enable */
1985 #define HRTIM_TIM_DMA_UPD        HRTIM_TIMDIER_UPDDE       /*!< Timer update DMA request enable */
1986 #define HRTIM_TIM_DMA_CPT1       HRTIM_TIMDIER_CPT1DE      /*!< Timer capture 1 DMA request enable */
1987 #define HRTIM_TIM_DMA_CPT2       HRTIM_TIMDIER_CPT2DE      /*!< Timer capture 2 DMA request enable */
1988 #define HRTIM_TIM_DMA_SET1       HRTIM_TIMDIER_SET1DE      /*!< Timer output 1 set DMA request enable */
1989 #define HRTIM_TIM_DMA_RST1       HRTIM_TIMDIER_RST1DE      /*!< Timer output 1 reset DMA request enable */
1990 #define HRTIM_TIM_DMA_SET2       HRTIM_TIMDIER_SET2DE      /*!< Timer output 2 set DMA request enable */
1991 #define HRTIM_TIM_DMA_RST2       HRTIM_TIMDIER_RST2DE      /*!< Timer output 2 reset DMA request enable */
1992 #define HRTIM_TIM_DMA_RST        HRTIM_TIMDIER_RSTDE       /*!< Timer reset DMA request enable */
1993 #define HRTIM_TIM_DMA_DLYPRT     HRTIM_TIMDIER_DLYPRTDE    /*!< Timer delay protection DMA request enable */
1994 /**
1995   * @}
1996   */
1997 
1998 /**
1999   * @}
2000   */
2001 
2002   /* Private macros --------------------------------------------------------*/
2003 /** @addtogroup HRTIM_Private_Macros
2004   * @{
2005   */
2006 #define IS_HRTIM_TIMERINDEX(TIMERINDEX)\
2007     (((TIMERINDEX) == HRTIM_TIMERINDEX_MASTER)   || \
2008      ((TIMERINDEX) == HRTIM_TIMERINDEX_TIMER_A)  || \
2009      ((TIMERINDEX) == HRTIM_TIMERINDEX_TIMER_B)  || \
2010      ((TIMERINDEX) == HRTIM_TIMERINDEX_TIMER_C)  || \
2011      ((TIMERINDEX) == HRTIM_TIMERINDEX_TIMER_D)  || \
2012      ((TIMERINDEX) == HRTIM_TIMERINDEX_TIMER_E))
2013 
2014 #define IS_HRTIM_TIMING_UNIT(TIMERINDEX)\
2015      (((TIMERINDEX) == HRTIM_TIMERINDEX_TIMER_A)  || \
2016       ((TIMERINDEX) == HRTIM_TIMERINDEX_TIMER_B)  || \
2017       ((TIMERINDEX) == HRTIM_TIMERINDEX_TIMER_C)  || \
2018       ((TIMERINDEX) == HRTIM_TIMERINDEX_TIMER_D)  || \
2019       ((TIMERINDEX) == HRTIM_TIMERINDEX_TIMER_E))
2020 
2021 #define IS_HRTIM_TIMERID(TIMERID) (((TIMERID) & 0xFFC0FFFFU) == 0x00000000U)
2022 
2023 #define IS_HRTIM_COMPAREUNIT(COMPAREUNIT)\
2024     (((COMPAREUNIT) == HRTIM_COMPAREUNIT_1)  || \
2025      ((COMPAREUNIT) == HRTIM_COMPAREUNIT_2)  || \
2026      ((COMPAREUNIT) == HRTIM_COMPAREUNIT_3)  || \
2027      ((COMPAREUNIT) == HRTIM_COMPAREUNIT_4))
2028 
2029 #define IS_HRTIM_CAPTUREUNIT(CAPTUREUNIT)\
2030     (((CAPTUREUNIT) == HRTIM_CAPTUREUNIT_1)   || \
2031      ((CAPTUREUNIT) == HRTIM_CAPTUREUNIT_2))
2032 
2033 #define IS_HRTIM_OUTPUT(OUTPUT) (((OUTPUT) & 0xFFFFFC00U) == 0x00000000U)
2034 
2035 #define IS_HRTIM_TIMER_OUTPUT(TIMER, OUTPUT)\
2036     ((((TIMER) == HRTIM_TIMERINDEX_TIMER_A) &&   \
2037      (((OUTPUT) == HRTIM_OUTPUT_TA1) ||          \
2038       ((OUTPUT) == HRTIM_OUTPUT_TA2)))           \
2039     ||                                           \
2040     (((TIMER) == HRTIM_TIMERINDEX_TIMER_B) &&    \
2041      (((OUTPUT) == HRTIM_OUTPUT_TB1) ||          \
2042       ((OUTPUT) == HRTIM_OUTPUT_TB2)))           \
2043     ||                                           \
2044     (((TIMER) == HRTIM_TIMERINDEX_TIMER_C) &&    \
2045      (((OUTPUT) == HRTIM_OUTPUT_TC1) ||          \
2046       ((OUTPUT) == HRTIM_OUTPUT_TC2)))           \
2047     ||                                           \
2048     (((TIMER) == HRTIM_TIMERINDEX_TIMER_D) &&    \
2049      (((OUTPUT) == HRTIM_OUTPUT_TD1) ||          \
2050       ((OUTPUT) == HRTIM_OUTPUT_TD2)))           \
2051     ||                                           \
2052     (((TIMER) == HRTIM_TIMERINDEX_TIMER_E) &&    \
2053      (((OUTPUT) == HRTIM_OUTPUT_TE1) ||          \
2054       ((OUTPUT) == HRTIM_OUTPUT_TE2))))
2055 
2056 #define IS_HRTIM_EVENT(EVENT)\
2057       (((EVENT) == HRTIM_EVENT_NONE)|| \
2058        ((EVENT) == HRTIM_EVENT_1)   || \
2059        ((EVENT) == HRTIM_EVENT_2)   || \
2060        ((EVENT) == HRTIM_EVENT_3)   || \
2061        ((EVENT) == HRTIM_EVENT_4)   || \
2062        ((EVENT) == HRTIM_EVENT_5)   || \
2063        ((EVENT) == HRTIM_EVENT_6)   || \
2064        ((EVENT) == HRTIM_EVENT_7)   || \
2065        ((EVENT) == HRTIM_EVENT_8)   || \
2066        ((EVENT) == HRTIM_EVENT_9)   || \
2067        ((EVENT) == HRTIM_EVENT_10))
2068 
2069 #define IS_HRTIM_FAULT(FAULT)\
2070       (((FAULT) == HRTIM_FAULT_1)   || \
2071        ((FAULT) == HRTIM_FAULT_2)   || \
2072        ((FAULT) == HRTIM_FAULT_3)   || \
2073        ((FAULT) == HRTIM_FAULT_4)   || \
2074        ((FAULT) == HRTIM_FAULT_5))
2075 
2076 #define IS_HRTIM_PRESCALERRATIO(PRESCALERRATIO)\
2077         (((PRESCALERRATIO) == HRTIM_PRESCALERRATIO_DIV1) || \
2078          ((PRESCALERRATIO) == HRTIM_PRESCALERRATIO_DIV2)  || \
2079          ((PRESCALERRATIO) == HRTIM_PRESCALERRATIO_DIV4))
2080 
2081 #define IS_HRTIM_MODE(MODE)\
2082           (((MODE) == HRTIM_MODE_CONTINUOUS)  ||  \
2083            ((MODE) == HRTIM_MODE_SINGLESHOT) || \
2084            ((MODE) == HRTIM_MODE_SINGLESHOT_RETRIGGERABLE))
2085 
2086 #define IS_HRTIM_MODE_ONEPULSE(MODE)\
2087           (((MODE) == HRTIM_MODE_SINGLESHOT) || \
2088            ((MODE) == HRTIM_MODE_SINGLESHOT_RETRIGGERABLE))
2089 
2090 
2091 #define IS_HRTIM_HALFMODE(HALFMODE)\
2092             (((HALFMODE) == HRTIM_HALFMODE_DISABLED)  ||  \
2093              ((HALFMODE) == HRTIM_HALFMODE_ENABLED))
2094 
2095 #define IS_HRTIM_SYNCSTART(SYNCSTART)\
2096               (((SYNCSTART) == HRTIM_SYNCSTART_DISABLED)  ||  \
2097                ((SYNCSTART) == HRTIM_SYNCSTART_ENABLED))
2098 
2099 #define IS_HRTIM_SYNCRESET(SYNCRESET)\
2100                 (((SYNCRESET) == HRTIM_SYNCRESET_DISABLED)  ||  \
2101                  ((SYNCRESET) == HRTIM_SYNCRESET_ENABLED))
2102 
2103 #define IS_HRTIM_DACSYNC(DACSYNC)\
2104                 (((DACSYNC) == HRTIM_DACSYNC_NONE)          ||  \
2105                  ((DACSYNC) == HRTIM_DACSYNC_DACTRIGOUT_1)  ||  \
2106                  ((DACSYNC) == HRTIM_DACSYNC_DACTRIGOUT_2)  ||  \
2107                  ((DACSYNC) == HRTIM_DACSYNC_DACTRIGOUT_3))
2108 
2109 #define IS_HRTIM_PRELOAD(PRELOAD)\
2110                 (((PRELOAD) == HRTIM_PRELOAD_DISABLED)  ||  \
2111                  ((PRELOAD) == HRTIM_PRELOAD_ENABLED))
2112 
2113 #define IS_HRTIM_UPDATEGATING_MASTER(UPDATEGATING)\
2114                 (((UPDATEGATING) == HRTIM_UPDATEGATING_INDEPENDENT)      ||  \
2115                  ((UPDATEGATING) == HRTIM_UPDATEGATING_DMABURST)         ||  \
2116                  ((UPDATEGATING) == HRTIM_UPDATEGATING_DMABURST_UPDATE))
2117 
2118 #define IS_HRTIM_UPDATEGATING_TIM(UPDATEGATING)\
2119                 (((UPDATEGATING) == HRTIM_UPDATEGATING_INDEPENDENT)      ||  \
2120                  ((UPDATEGATING) == HRTIM_UPDATEGATING_DMABURST)         ||  \
2121                  ((UPDATEGATING) == HRTIM_UPDATEGATING_DMABURST_UPDATE)  ||  \
2122                  ((UPDATEGATING) == HRTIM_UPDATEGATING_UPDEN1)           ||  \
2123                  ((UPDATEGATING) == HRTIM_UPDATEGATING_UPDEN2)           ||  \
2124                  ((UPDATEGATING) == HRTIM_UPDATEGATING_UPDEN3)           ||  \
2125                  ((UPDATEGATING) == HRTIM_UPDATEGATING_UPDEN1_UPDATE)    ||  \
2126                  ((UPDATEGATING) == HRTIM_UPDATEGATING_UPDEN2_UPDATE)    ||  \
2127                  ((UPDATEGATING) == HRTIM_UPDATEGATING_UPDEN3_UPDATE))
2128 
2129 #define IS_HRTIM_TIMERBURSTMODE(MODE)                               \
2130                 (((MODE) == HRTIM_TIMERBURSTMODE_MAINTAINCLOCK)  || \
2131                  ((MODE) == HRTIM_TIMERBURSTMODE_RESETCOUNTER))
2132 #define IS_HRTIM_UPDATEONREPETITION(UPDATEONREPETITION)                               \
2133                 (((UPDATEONREPETITION) == HRTIM_UPDATEONREPETITION_DISABLED)  || \
2134                  ((UPDATEONREPETITION) == HRTIM_UPDATEONREPETITION_ENABLED))
2135 
2136 #define IS_HRTIM_TIMPUSHPULLMODE(TIMPUSHPULLMODE)\
2137                   (((TIMPUSHPULLMODE) == HRTIM_TIMPUSHPULLMODE_DISABLED) || \
2138                    ((TIMPUSHPULLMODE) == HRTIM_TIMPUSHPULLMODE_ENABLED))
2139 #define IS_HRTIM_TIMFAULTENABLE(TIMFAULTENABLE) (((TIMFAULTENABLE) & 0xFFFFFFE0U) == 0x00000000U)
2140 
2141 #define IS_HRTIM_TIMFAULTLOCK(TIMFAULTLOCK)\
2142       (((TIMFAULTLOCK) == HRTIM_TIMFAULTLOCK_READWRITE) || \
2143        ((TIMFAULTLOCK) == HRTIM_TIMFAULTLOCK_READONLY))
2144 
2145 #define IS_HRTIM_TIMDEADTIMEINSERTION(TIMPUSHPULLMODE, TIMDEADTIMEINSERTION)\
2146     ((((TIMPUSHPULLMODE) == HRTIM_TIMPUSHPULLMODE_DISABLED) &&               \
2147         ((((TIMDEADTIMEINSERTION) == HRTIM_TIMDEADTIMEINSERTION_DISABLED) || \
2148           ((TIMDEADTIMEINSERTION) == HRTIM_TIMDEADTIMEINSERTION_ENABLED))))  \
2149       ||                                                                     \
2150         (((TIMPUSHPULLMODE) == HRTIM_TIMPUSHPULLMODE_ENABLED) &&             \
2151          ((TIMDEADTIMEINSERTION) == HRTIM_TIMDEADTIMEINSERTION_DISABLED)))
2152 
2153 #define IS_HRTIM_TIMDELAYEDPROTECTION(TIMPUSHPULLMODE, TIMDELAYEDPROTECTION)\
2154           ((((TIMDELAYEDPROTECTION) == HRTIM_TIMER_A_B_C_DELAYEDPROTECTION_DISABLED)          || \
2155             ((TIMDELAYEDPROTECTION) == HRTIM_TIMER_A_B_C_DELAYEDPROTECTION_DELAYEDOUT1_EEV6)  || \
2156             ((TIMDELAYEDPROTECTION) == HRTIM_TIMER_A_B_C_DELAYEDPROTECTION_DELAYEDOUT2_EEV6)  || \
2157             ((TIMDELAYEDPROTECTION) == HRTIM_TIMER_A_B_C_DELAYEDPROTECTION_DELAYEDBOTH_EEV6)  || \
2158             ((TIMDELAYEDPROTECTION) == HRTIM_TIMER_A_B_C_DELAYEDPROTECTION_DELAYEDOUT1_DEEV7) || \
2159             ((TIMDELAYEDPROTECTION) == HRTIM_TIMER_A_B_C_DELAYEDPROTECTION_DELAYEDOUT2_DEEV7) || \
2160             ((TIMDELAYEDPROTECTION) == HRTIM_TIMER_A_B_C_DELAYEDPROTECTION_DELAYEDBOTH_EEV7))    \
2161             ||                                                                           \
2162             (((TIMPUSHPULLMODE) ==  HRTIM_TIMPUSHPULLMODE_ENABLED) &&                    \
2163              (((TIMDELAYEDPROTECTION) == HRTIM_TIMER_A_B_C_DELAYEDPROTECTION_BALANCED_EEV6)     || \
2164              ((TIMDELAYEDPROTECTION) == HRTIM_TIMER_A_B_C_DELAYEDPROTECTION_BALANCED_EEV7))))
2165 
2166 #define IS_HRTIM_TIMUPDATETRIGGER(TIMUPDATETRIGGER) (((TIMUPDATETRIGGER) & 0xFE07FFFFU) == 0x00000000U)
2167 
2168 #define IS_HRTIM_TIMRESETTRIGGER(TIMRESETTRIGGER) (((TIMRESETTRIGGER) & 0x80000001U) == 0x00000000U)
2169 
2170 
2171 #define IS_HRTIM_TIMUPDATEONRESET(TIMUPDATEONRESET)                       \
2172               (((TIMUPDATEONRESET) == HRTIM_TIMUPDATEONRESET_DISABLED) || \
2173                ((TIMUPDATEONRESET) == HRTIM_TIMUPDATEONRESET_ENABLED))
2174 
2175 #define IS_HRTIM_AUTODELAYEDMODE(AUTODELAYEDMODE)\
2176               (((AUTODELAYEDMODE) == HRTIM_AUTODELAYEDMODE_REGULAR)                  || \
2177                ((AUTODELAYEDMODE) == HRTIM_AUTODELAYEDMODE_AUTODELAYED_NOTIMEOUT)    || \
2178                ((AUTODELAYEDMODE) == HRTIM_AUTODELAYEDMODE_AUTODELAYED_TIMEOUTCMP1)  || \
2179                ((AUTODELAYEDMODE) == HRTIM_AUTODELAYEDMODE_AUTODELAYED_TIMEOUTCMP3))
2180 
2181 /* Auto delayed mode is only available for compare units 2 and 4U */
2182 #define IS_HRTIM_COMPAREUNIT_AUTODELAYEDMODE(COMPAREUNIT, AUTODELAYEDMODE)     \
2183     ((((COMPAREUNIT) == HRTIM_COMPAREUNIT_2) &&                                 \
2184      (((AUTODELAYEDMODE) == HRTIM_AUTODELAYEDMODE_REGULAR)                 ||  \
2185       ((AUTODELAYEDMODE) == HRTIM_AUTODELAYEDMODE_AUTODELAYED_NOTIMEOUT)   ||  \
2186       ((AUTODELAYEDMODE) == HRTIM_AUTODELAYEDMODE_AUTODELAYED_TIMEOUTCMP1) ||  \
2187       ((AUTODELAYEDMODE) == HRTIM_AUTODELAYEDMODE_AUTODELAYED_TIMEOUTCMP3)))   \
2188     ||                                                                         \
2189     (((COMPAREUNIT) == HRTIM_COMPAREUNIT_4) &&                                 \
2190      (((AUTODELAYEDMODE) == HRTIM_AUTODELAYEDMODE_REGULAR)                 ||  \
2191       ((AUTODELAYEDMODE) == HRTIM_AUTODELAYEDMODE_AUTODELAYED_NOTIMEOUT)   ||  \
2192       ((AUTODELAYEDMODE) == HRTIM_AUTODELAYEDMODE_AUTODELAYED_TIMEOUTCMP1) ||  \
2193       ((AUTODELAYEDMODE) == HRTIM_AUTODELAYEDMODE_AUTODELAYED_TIMEOUTCMP3))))
2194 
2195 #define IS_HRTIM_OUTPUTPOLARITY(OUTPUTPOLARITY)\
2196               (((OUTPUTPOLARITY) == HRTIM_OUTPUTPOLARITY_HIGH) || \
2197                ((OUTPUTPOLARITY) == HRTIM_OUTPUTPOLARITY_LOW))
2198 
2199 #define IS_HRTIM_OUTPUTPULSE(OUTPUTPULSE) ((OUTPUTPULSE) <= 0x0000FFFFU)
2200 
2201 #define IS_HRTIM_OUTPUTSET(OUTPUTSET)\
2202               (((OUTPUTSET) == HRTIM_OUTPUTSET_NONE)       || \
2203                ((OUTPUTSET) == HRTIM_OUTPUTSET_RESYNC)     || \
2204                ((OUTPUTSET) == HRTIM_OUTPUTSET_TIMPER)     || \
2205                ((OUTPUTSET) == HRTIM_OUTPUTSET_TIMCMP1)    || \
2206                ((OUTPUTSET) == HRTIM_OUTPUTSET_TIMCMP2)    || \
2207                ((OUTPUTSET) == HRTIM_OUTPUTSET_TIMCMP3)    || \
2208                ((OUTPUTSET) == HRTIM_OUTPUTSET_TIMCMP4)    || \
2209                ((OUTPUTSET) == HRTIM_OUTPUTSET_MASTERPER)  || \
2210                ((OUTPUTSET) == HRTIM_OUTPUTSET_MASTERCMP1) || \
2211                ((OUTPUTSET) == HRTIM_OUTPUTSET_MASTERCMP2) || \
2212                ((OUTPUTSET) == HRTIM_OUTPUTSET_MASTERCMP3) || \
2213                ((OUTPUTSET) == HRTIM_OUTPUTSET_MASTERCMP4) || \
2214                ((OUTPUTSET) == HRTIM_OUTPUTSET_TIMEV_1)    || \
2215                ((OUTPUTSET) == HRTIM_OUTPUTSET_TIMEV_2)    || \
2216                ((OUTPUTSET) == HRTIM_OUTPUTSET_TIMEV_3)    || \
2217                ((OUTPUTSET) == HRTIM_OUTPUTSET_TIMEV_4)    || \
2218                ((OUTPUTSET) == HRTIM_OUTPUTSET_TIMEV_5)    || \
2219                ((OUTPUTSET) == HRTIM_OUTPUTSET_TIMEV_6)    || \
2220                ((OUTPUTSET) == HRTIM_OUTPUTSET_TIMEV_7)    || \
2221                ((OUTPUTSET) == HRTIM_OUTPUTSET_TIMEV_8)    || \
2222                ((OUTPUTSET) == HRTIM_OUTPUTSET_TIMEV_9)    || \
2223                ((OUTPUTSET) == HRTIM_OUTPUTSET_EEV_1)      || \
2224                ((OUTPUTSET) == HRTIM_OUTPUTSET_EEV_2)      || \
2225                ((OUTPUTSET) == HRTIM_OUTPUTSET_EEV_3)      || \
2226                ((OUTPUTSET) == HRTIM_OUTPUTSET_EEV_4)      || \
2227                ((OUTPUTSET) == HRTIM_OUTPUTSET_EEV_5)      || \
2228                ((OUTPUTSET) == HRTIM_OUTPUTSET_EEV_6)      || \
2229                ((OUTPUTSET) == HRTIM_OUTPUTSET_EEV_7)      || \
2230                ((OUTPUTSET) == HRTIM_OUTPUTSET_EEV_8)      || \
2231                ((OUTPUTSET) == HRTIM_OUTPUTSET_EEV_9)      || \
2232                ((OUTPUTSET) == HRTIM_OUTPUTSET_EEV_10)     || \
2233                ((OUTPUTSET) == HRTIM_OUTPUTSET_UPDATE))
2234 
2235 #define IS_HRTIM_OUTPUTRESET(OUTPUTRESET)\
2236               (((OUTPUTRESET) == HRTIM_OUTPUTRESET_NONE)       || \
2237                ((OUTPUTRESET) == HRTIM_OUTPUTRESET_RESYNC)     || \
2238                ((OUTPUTRESET) == HRTIM_OUTPUTRESET_TIMPER)     || \
2239                ((OUTPUTRESET) == HRTIM_OUTPUTRESET_TIMCMP1)    || \
2240                ((OUTPUTRESET) == HRTIM_OUTPUTRESET_TIMCMP2)    || \
2241                ((OUTPUTRESET) == HRTIM_OUTPUTRESET_TIMCMP3)    || \
2242                ((OUTPUTRESET) == HRTIM_OUTPUTRESET_TIMCMP4)    || \
2243                ((OUTPUTRESET) == HRTIM_OUTPUTRESET_MASTERPER)  || \
2244                ((OUTPUTRESET) == HRTIM_OUTPUTRESET_MASTERCMP1) || \
2245                ((OUTPUTRESET) == HRTIM_OUTPUTRESET_MASTERCMP2) || \
2246                ((OUTPUTRESET) == HRTIM_OUTPUTRESET_MASTERCMP3) || \
2247                ((OUTPUTRESET) == HRTIM_OUTPUTRESET_MASTERCMP4) || \
2248                ((OUTPUTRESET) == HRTIM_OUTPUTRESET_TIMEV_1)    || \
2249                ((OUTPUTRESET) == HRTIM_OUTPUTRESET_TIMEV_2)    || \
2250                ((OUTPUTRESET) == HRTIM_OUTPUTRESET_TIMEV_3)    || \
2251                ((OUTPUTRESET) == HRTIM_OUTPUTRESET_TIMEV_4)    || \
2252                ((OUTPUTRESET) == HRTIM_OUTPUTRESET_TIMEV_5)    || \
2253                ((OUTPUTRESET) == HRTIM_OUTPUTRESET_TIMEV_6)    || \
2254                ((OUTPUTRESET) == HRTIM_OUTPUTRESET_TIMEV_7)    || \
2255                ((OUTPUTRESET) == HRTIM_OUTPUTRESET_TIMEV_8)    || \
2256                ((OUTPUTRESET) == HRTIM_OUTPUTRESET_TIMEV_9)    || \
2257                ((OUTPUTRESET) == HRTIM_OUTPUTRESET_EEV_1)      || \
2258                ((OUTPUTRESET) == HRTIM_OUTPUTRESET_EEV_2)      || \
2259                ((OUTPUTRESET) == HRTIM_OUTPUTRESET_EEV_3)      || \
2260                ((OUTPUTRESET) == HRTIM_OUTPUTRESET_EEV_4)      || \
2261                ((OUTPUTRESET) == HRTIM_OUTPUTRESET_EEV_5)      || \
2262                ((OUTPUTRESET) == HRTIM_OUTPUTRESET_EEV_6)      || \
2263                ((OUTPUTRESET) == HRTIM_OUTPUTRESET_EEV_7)      || \
2264                ((OUTPUTRESET) == HRTIM_OUTPUTRESET_EEV_8)      || \
2265                ((OUTPUTRESET) == HRTIM_OUTPUTRESET_EEV_9)      || \
2266                ((OUTPUTRESET) == HRTIM_OUTPUTRESET_EEV_10)     || \
2267                ((OUTPUTRESET) == HRTIM_OUTPUTRESET_UPDATE))
2268 
2269 #define IS_HRTIM_OUTPUTIDLEMODE(OUTPUTIDLEMODE)\
2270               (((OUTPUTIDLEMODE) == HRTIM_OUTPUTIDLEMODE_NONE) || \
2271                ((OUTPUTIDLEMODE) == HRTIM_OUTPUTIDLEMODE_IDLE))
2272 
2273 #define IS_HRTIM_OUTPUTIDLELEVEL(OUTPUTIDLELEVEL)\
2274               (((OUTPUTIDLELEVEL) == HRTIM_OUTPUTIDLELEVEL_INACTIVE) || \
2275                ((OUTPUTIDLELEVEL) == HRTIM_OUTPUTIDLELEVEL_ACTIVE))
2276 
2277 #define IS_HRTIM_OUTPUTFAULTLEVEL(OUTPUTFAULTLEVEL)\
2278               (((OUTPUTFAULTLEVEL) == HRTIM_OUTPUTFAULTLEVEL_NONE)     || \
2279                ((OUTPUTFAULTLEVEL) == HRTIM_OUTPUTFAULTLEVEL_ACTIVE)   || \
2280                ((OUTPUTFAULTLEVEL) == HRTIM_OUTPUTFAULTLEVEL_INACTIVE) || \
2281                ((OUTPUTFAULTLEVEL) == HRTIM_OUTPUTFAULTLEVEL_HIGHZ))
2282 
2283 #define IS_HRTIM_OUTPUTCHOPPERMODE(OUTPUTCHOPPERMODE)\
2284               (((OUTPUTCHOPPERMODE) == HRTIM_OUTPUTCHOPPERMODE_DISABLED)  || \
2285                ((OUTPUTCHOPPERMODE) == HRTIM_OUTPUTCHOPPERMODE_ENABLED))
2286 
2287 #define IS_HRTIM_OUTPUTBURSTMODEENTRY(OUTPUTBURSTMODEENTRY)\
2288               (((OUTPUTBURSTMODEENTRY) == HRTIM_OUTPUTBURSTMODEENTRY_REGULAR)  || \
2289                ((OUTPUTBURSTMODEENTRY) == HRTIM_OUTPUTBURSTMODEENTRY_DELAYED))
2290 
2291 
2292 #define IS_HRTIM_TIMER_CAPTURETRIGGER(TIMER, CAPTURETRIGGER)    \
2293    (((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_NONE)          || \
2294    ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_UPDATE)         || \
2295    ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_EEV_1)          || \
2296    ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_EEV_2)          || \
2297    ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_EEV_3)          || \
2298    ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_EEV_4)          || \
2299    ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_EEV_5)          || \
2300    ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_EEV_6)          || \
2301    ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_EEV_7)          || \
2302    ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_EEV_8)          || \
2303    ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_EEV_9)          || \
2304    ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_EEV_10)            \
2305    ||                                                           \
2306    (((TIMER) == HRTIM_TIMERINDEX_TIMER_A) &&                    \
2307      (((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TB1_SET)     || \
2308       ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TB1_RESET)   || \
2309       ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERB_CMP1) || \
2310       ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERB_CMP2) || \
2311       ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TC1_SET)     || \
2312       ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TC1_RESET)   || \
2313       ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERC_CMP1) || \
2314       ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERC_CMP2) || \
2315       ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TD1_SET)     || \
2316       ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TD1_RESET)   || \
2317       ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERD_CMP1) || \
2318       ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERD_CMP2) || \
2319       ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TE1_SET)     || \
2320       ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TE1_RESET)   || \
2321       ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERE_CMP1) || \
2322       ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERE_CMP2)))  \
2323     ||                                                          \
2324    (((TIMER) == HRTIM_TIMERINDEX_TIMER_B) &&                    \
2325      (((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TA1_SET)     || \
2326       ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TA1_RESET)   || \
2327       ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERA_CMP1) || \
2328       ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERA_CMP2) || \
2329       ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TC1_SET)     || \
2330       ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TC1_RESET)   || \
2331       ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERC_CMP1) || \
2332       ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERC_CMP2) || \
2333       ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TD1_SET)     || \
2334       ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TD1_RESET)   || \
2335       ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERD_CMP1) || \
2336       ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERD_CMP2) || \
2337       ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TE1_SET)     || \
2338       ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TE1_RESET)   || \
2339       ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERE_CMP1) || \
2340       ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERE_CMP2)))  \
2341     ||                                                          \
2342    (((TIMER) == HRTIM_TIMERINDEX_TIMER_C) &&                    \
2343      (((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TA1_SET)     || \
2344       ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TA1_RESET)   || \
2345       ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERA_CMP1) || \
2346       ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERA_CMP2) || \
2347       ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TB1_SET)     || \
2348       ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TB1_RESET)   || \
2349       ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERB_CMP1) || \
2350       ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERB_CMP2) || \
2351       ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TD1_SET)     || \
2352       ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TD1_RESET)   || \
2353       ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERD_CMP1) || \
2354       ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERD_CMP2) || \
2355       ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TE1_SET)     || \
2356       ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TE1_RESET)   || \
2357       ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERE_CMP1) || \
2358       ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERE_CMP2)))  \
2359     ||                                                          \
2360    (((TIMER) == HRTIM_TIMERINDEX_TIMER_D) &&                    \
2361      (((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TA1_SET)     || \
2362       ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TA1_RESET)   || \
2363       ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERA_CMP1) || \
2364       ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERA_CMP2) || \
2365       ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TB1_SET)     || \
2366       ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TB1_RESET)   || \
2367       ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERB_CMP1) || \
2368       ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERB_CMP2) || \
2369       ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TC1_SET)     || \
2370       ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TC1_RESET)   || \
2371       ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERC_CMP1) || \
2372       ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERC_CMP2) || \
2373       ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TE1_SET)     || \
2374       ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TE1_RESET)   || \
2375       ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERE_CMP1) || \
2376       ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERE_CMP2)))  \
2377     ||                                                          \
2378    (((TIMER) == HRTIM_TIMERINDEX_TIMER_E) &&                    \
2379      (((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TA1_SET)     || \
2380       ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TA1_RESET)   || \
2381       ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERA_CMP1) || \
2382       ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERA_CMP2) || \
2383       ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TB1_SET)     || \
2384       ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TB1_RESET)   || \
2385       ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERB_CMP1) || \
2386       ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERB_CMP2) || \
2387       ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TC1_SET)     || \
2388       ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TC1_RESET)   || \
2389       ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERC_CMP1) || \
2390       ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERC_CMP2) || \
2391       ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TD1_SET)     || \
2392       ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TD1_RESET)   || \
2393       ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERD_CMP1) || \
2394       ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERD_CMP2))))
2395 
2396 #define IS_HRTIM_TIMEVENTFILTER(TIMEVENTFILTER)\
2397                 (((TIMEVENTFILTER) == HRTIM_TIMEVENTFILTER_NONE)           || \
2398                  ((TIMEVENTFILTER) == HRTIM_TIMEVENTFILTER_BLANKINGCMP1)   || \
2399                  ((TIMEVENTFILTER) == HRTIM_TIMEVENTFILTER_BLANKINGCMP2)   || \
2400                  ((TIMEVENTFILTER) == HRTIM_TIMEVENTFILTER_BLANKINGCMP3)   || \
2401                  ((TIMEVENTFILTER) == HRTIM_TIMEVENTFILTER_BLANKINGCMP4)   || \
2402                  ((TIMEVENTFILTER) == HRTIM_TIMEVENTFILTER_BLANKINGFLTR1)  || \
2403                  ((TIMEVENTFILTER) == HRTIM_TIMEVENTFILTER_BLANKINGFLTR2)  || \
2404                  ((TIMEVENTFILTER) == HRTIM_TIMEVENTFILTER_BLANKINGFLTR3)  || \
2405                  ((TIMEVENTFILTER) == HRTIM_TIMEVENTFILTER_BLANKINGFLTR4)  || \
2406                  ((TIMEVENTFILTER) == HRTIM_TIMEVENTFILTER_BLANKINGFLTR5)  || \
2407                  ((TIMEVENTFILTER) == HRTIM_TIMEVENTFILTER_BLANKINGFLTR6)  || \
2408                  ((TIMEVENTFILTER) == HRTIM_TIMEVENTFILTER_BLANKINGFLTR7)  || \
2409                  ((TIMEVENTFILTER) == HRTIM_TIMEVENTFILTER_BLANKINGFLTR8)  || \
2410                  ((TIMEVENTFILTER) == HRTIM_TIMEVENTFILTER_WINDOWINGCMP2)  || \
2411                  ((TIMEVENTFILTER) == HRTIM_TIMEVENTFILTER_WINDOWINGCMP3)  || \
2412                  ((TIMEVENTFILTER) == HRTIM_TIMEVENTFILTER_WINDOWINGTIM))
2413 
2414 #define IS_HRTIM_TIMEVENTLATCH(TIMEVENTLATCH)\
2415               (((TIMEVENTLATCH) == HRTIM_TIMEVENTLATCH_DISABLED) || \
2416                ((TIMEVENTLATCH) == HRTIM_TIMEVENTLATCH_ENABLED))
2417 
2418 #define IS_HRTIM_TIMDEADTIME_PRESCALERRATIO(PRESCALERRATIO)\
2419                 (((PRESCALERRATIO) == HRTIM_TIMDEADTIME_PRESCALERRATIO_DIV1) || \
2420                  ((PRESCALERRATIO) == HRTIM_TIMDEADTIME_PRESCALERRATIO_DIV2) || \
2421                  ((PRESCALERRATIO) == HRTIM_TIMDEADTIME_PRESCALERRATIO_DIV4) || \
2422                  ((PRESCALERRATIO) == HRTIM_TIMDEADTIME_PRESCALERRATIO_DIV8) || \
2423                  ((PRESCALERRATIO) == HRTIM_TIMDEADTIME_PRESCALERRATIO_DIV16))
2424 
2425 #define IS_HRTIM_TIMDEADTIME_RISINGSIGN(RISINGSIGN)\
2426                 (((RISINGSIGN) == HRTIM_TIMDEADTIME_RISINGSIGN_POSITIVE)    || \
2427                  ((RISINGSIGN) == HRTIM_TIMDEADTIME_RISINGSIGN_NEGATIVE))
2428 
2429 #define IS_HRTIM_TIMDEADTIME_RISINGLOCK(RISINGLOCK)\
2430                     (((RISINGLOCK) == HRTIM_TIMDEADTIME_RISINGLOCK_WRITE)    || \
2431                      ((RISINGLOCK) == HRTIM_TIMDEADTIME_RISINGLOCK_READONLY))
2432 
2433 #define IS_HRTIM_TIMDEADTIME_RISINGSIGNLOCK(RISINGSIGNLOCK)\
2434                   (((RISINGSIGNLOCK) == HRTIM_TIMDEADTIME_RISINGSIGNLOCK_WRITE)    || \
2435                    ((RISINGSIGNLOCK) == HRTIM_TIMDEADTIME_RISINGSIGNLOCK_READONLY))
2436 
2437 #define IS_HRTIM_TIMDEADTIME_FALLINGSIGN(FALLINGSIGN)\
2438                       (((FALLINGSIGN) == HRTIM_TIMDEADTIME_FALLINGSIGN_POSITIVE)    || \
2439                        ((FALLINGSIGN) == HRTIM_TIMDEADTIME_FALLINGSIGN_NEGATIVE))
2440 
2441 #define IS_HRTIM_TIMDEADTIME_FALLINGLOCK(FALLINGLOCK)\
2442                           (((FALLINGLOCK) == HRTIM_TIMDEADTIME_FALLINGLOCK_WRITE)    || \
2443                            ((FALLINGLOCK) == HRTIM_TIMDEADTIME_FALLINGLOCK_READONLY))
2444 
2445 #define IS_HRTIM_TIMDEADTIME_FALLINGSIGNLOCK(FALLINGSIGNLOCK)\
2446                         (((FALLINGSIGNLOCK) == HRTIM_TIMDEADTIME_FALLINGSIGNLOCK_WRITE)    || \
2447                          ((FALLINGSIGNLOCK) == HRTIM_TIMDEADTIME_FALLINGSIGNLOCK_READONLY))
2448 
2449 #define IS_HRTIM_CHOPPER_PRESCALERRATIO(PRESCALERRATIO)\
2450                         (((PRESCALERRATIO) == HRTIM_CHOPPER_PRESCALERRATIO_DIV16)    || \
2451                          ((PRESCALERRATIO) == HRTIM_CHOPPER_PRESCALERRATIO_DIV32)    || \
2452                          ((PRESCALERRATIO) == HRTIM_CHOPPER_PRESCALERRATIO_DIV48)    || \
2453                          ((PRESCALERRATIO) == HRTIM_CHOPPER_PRESCALERRATIO_DIV64)    || \
2454                          ((PRESCALERRATIO) == HRTIM_CHOPPER_PRESCALERRATIO_DIV80)    || \
2455                          ((PRESCALERRATIO) == HRTIM_CHOPPER_PRESCALERRATIO_DIV96)    || \
2456                          ((PRESCALERRATIO) == HRTIM_CHOPPER_PRESCALERRATIO_DIV112)   || \
2457                          ((PRESCALERRATIO) == HRTIM_CHOPPER_PRESCALERRATIO_DIV128)   || \
2458                          ((PRESCALERRATIO) == HRTIM_CHOPPER_PRESCALERRATIO_DIV144)   || \
2459                          ((PRESCALERRATIO) == HRTIM_CHOPPER_PRESCALERRATIO_DIV160)   || \
2460                          ((PRESCALERRATIO) == HRTIM_CHOPPER_PRESCALERRATIO_DIV176)   || \
2461                          ((PRESCALERRATIO) == HRTIM_CHOPPER_PRESCALERRATIO_DIV192)   || \
2462                          ((PRESCALERRATIO) == HRTIM_CHOPPER_PRESCALERRATIO_DIV208)   || \
2463                          ((PRESCALERRATIO) == HRTIM_CHOPPER_PRESCALERRATIO_DIV224)   || \
2464                          ((PRESCALERRATIO) == HRTIM_CHOPPER_PRESCALERRATIO_DIV240)   || \
2465                          ((PRESCALERRATIO) == HRTIM_CHOPPER_PRESCALERRATIO_DIV256))
2466 
2467 #define IS_HRTIM_CHOPPER_DUTYCYCLE(DUTYCYCLE)\
2468                         (((DUTYCYCLE) == HRTIM_CHOPPER_DUTYCYCLE_0)    || \
2469                          ((DUTYCYCLE) == HRTIM_CHOPPER_DUTYCYCLE_125)  || \
2470                          ((DUTYCYCLE) == HRTIM_CHOPPER_DUTYCYCLE_250)  || \
2471                          ((DUTYCYCLE) == HRTIM_CHOPPER_DUTYCYCLE_375)  || \
2472                          ((DUTYCYCLE) == HRTIM_CHOPPER_DUTYCYCLE_500)  || \
2473                          ((DUTYCYCLE) == HRTIM_CHOPPER_DUTYCYCLE_625)  || \
2474                          ((DUTYCYCLE) == HRTIM_CHOPPER_DUTYCYCLE_750)  || \
2475                          ((DUTYCYCLE) == HRTIM_CHOPPER_DUTYCYCLE_875))
2476 
2477 #define IS_HRTIM_CHOPPER_PULSEWIDTH(PULSEWIDTH)\
2478                         (((PULSEWIDTH) == HRTIM_CHOPPER_PULSEWIDTH_16)   || \
2479                          ((PULSEWIDTH) == HRTIM_CHOPPER_PULSEWIDTH_32)   || \
2480                          ((PULSEWIDTH) == HRTIM_CHOPPER_PULSEWIDTH_48)   || \
2481                          ((PULSEWIDTH) == HRTIM_CHOPPER_PULSEWIDTH_64)   || \
2482                          ((PULSEWIDTH) == HRTIM_CHOPPER_PULSEWIDTH_80)   || \
2483                          ((PULSEWIDTH) == HRTIM_CHOPPER_PULSEWIDTH_96)   || \
2484                          ((PULSEWIDTH) == HRTIM_CHOPPER_PULSEWIDTH_112)  || \
2485                          ((PULSEWIDTH) == HRTIM_CHOPPER_PULSEWIDTH_128)  || \
2486                          ((PULSEWIDTH) == HRTIM_CHOPPER_PULSEWIDTH_144)  || \
2487                          ((PULSEWIDTH) == HRTIM_CHOPPER_PULSEWIDTH_160)  || \
2488                          ((PULSEWIDTH) == HRTIM_CHOPPER_PULSEWIDTH_176)  || \
2489                          ((PULSEWIDTH) == HRTIM_CHOPPER_PULSEWIDTH_192)  || \
2490                          ((PULSEWIDTH) == HRTIM_CHOPPER_PULSEWIDTH_208)  || \
2491                          ((PULSEWIDTH) == HRTIM_CHOPPER_PULSEWIDTH_224)  || \
2492                          ((PULSEWIDTH) == HRTIM_CHOPPER_PULSEWIDTH_240)  || \
2493                          ((PULSEWIDTH) == HRTIM_CHOPPER_PULSEWIDTH_256))
2494 
2495 #define IS_HRTIM_SYNCINPUTSOURCE(SYNCINPUTSOURCE)\
2496               (((SYNCINPUTSOURCE) == HRTIM_SYNCINPUTSOURCE_NONE)             || \
2497                ((SYNCINPUTSOURCE) == HRTIM_SYNCINPUTSOURCE_INTERNALEVENT)    || \
2498                ((SYNCINPUTSOURCE) == HRTIM_SYNCINPUTSOURCE_EXTERNALEVENT))
2499 
2500 #define IS_HRTIM_SYNCOUTPUTSOURCE(SYNCOUTPUTSOURCE)\
2501               (((SYNCOUTPUTSOURCE) == HRTIM_SYNCOUTPUTSOURCE_MASTER_START)  || \
2502                ((SYNCOUTPUTSOURCE) == HRTIM_SYNCOUTPUTSOURCE_MASTER_CMP1)   || \
2503                ((SYNCOUTPUTSOURCE) == HRTIM_SYNCOUTPUTSOURCE_TIMA_START)    || \
2504                ((SYNCOUTPUTSOURCE) == HRTIM_SYNCOUTPUTSOURCE_TIMA_CMP1))
2505 
2506 #define IS_HRTIM_SYNCOUTPUTPOLARITY(SYNCOUTPUTPOLARITY)\
2507               (((SYNCOUTPUTPOLARITY) == HRTIM_SYNCOUTPUTPOLARITY_NONE)  || \
2508                ((SYNCOUTPUTPOLARITY) == HRTIM_SYNCOUTPUTPOLARITY_POSITIVE)  || \
2509                ((SYNCOUTPUTPOLARITY) == HRTIM_SYNCOUTPUTPOLARITY_NEGATIVE))
2510 
2511 #define IS_HRTIM_EVENTSRC(EVENTSRC)\
2512                 (((EVENTSRC) == HRTIM_EVENTSRC_1)   || \
2513                  ((EVENTSRC) == HRTIM_EVENTSRC_2)   || \
2514                  ((EVENTSRC) == HRTIM_EVENTSRC_3)   || \
2515                  ((EVENTSRC) == HRTIM_EVENTSRC_4))
2516 
2517 #define IS_HRTIM_EVENTPOLARITY(EVENTSENSITIVITY, EVENTPOLARITY)\
2518     ((((EVENTSENSITIVITY) == HRTIM_EVENTSENSITIVITY_LEVEL)  &&      \
2519        (((EVENTPOLARITY) == HRTIM_EVENTPOLARITY_HIGH)  ||           \
2520         ((EVENTPOLARITY) == HRTIM_EVENTPOLARITY_LOW)))              \
2521       ||                                                            \
2522       (((EVENTSENSITIVITY) == HRTIM_EVENTSENSITIVITY_RISINGEDGE) || \
2523        ((EVENTSENSITIVITY) == HRTIM_EVENTSENSITIVITY_FALLINGEDGE)|| \
2524        ((EVENTSENSITIVITY) == HRTIM_EVENTSENSITIVITY_BOTHEDGES)))
2525 
2526 #define IS_HRTIM_EVENTSENSITIVITY(EVENTSENSITIVITY)\
2527                     (((EVENTSENSITIVITY) == HRTIM_EVENTSENSITIVITY_LEVEL)       || \
2528                      ((EVENTSENSITIVITY) == HRTIM_EVENTSENSITIVITY_RISINGEDGE)  || \
2529                      ((EVENTSENSITIVITY) == HRTIM_EVENTSENSITIVITY_FALLINGEDGE) || \
2530                      ((EVENTSENSITIVITY) == HRTIM_EVENTSENSITIVITY_BOTHEDGES))
2531 
2532 #define IS_HRTIM_EVENTFASTMODE(EVENT, FASTMODE)\
2533     (((((EVENT) == HRTIM_EVENT_1) ||                 \
2534        ((EVENT) == HRTIM_EVENT_2) ||                 \
2535        ((EVENT) == HRTIM_EVENT_3) ||                 \
2536        ((EVENT) == HRTIM_EVENT_4) ||                 \
2537        ((EVENT) == HRTIM_EVENT_5)) &&                \
2538       (((FASTMODE) == HRTIM_EVENTFASTMODE_ENABLE) || \
2539        ((FASTMODE) == HRTIM_EVENTFASTMODE_DISABLE))) \
2540     ||                                               \
2541     (((EVENT) == HRTIM_EVENT_6) ||                   \
2542      ((EVENT) == HRTIM_EVENT_7) ||                   \
2543      ((EVENT) == HRTIM_EVENT_8) ||                   \
2544      ((EVENT) == HRTIM_EVENT_9) ||                   \
2545      ((EVENT) == HRTIM_EVENT_10)))
2546 
2547 
2548 #define IS_HRTIM_EVENTFILTER(EVENT, FILTER)\
2549       ((((EVENT) == HRTIM_EVENT_1) ||            \
2550         ((EVENT) == HRTIM_EVENT_2) ||            \
2551         ((EVENT) == HRTIM_EVENT_3) ||            \
2552         ((EVENT) == HRTIM_EVENT_4) ||            \
2553         ((EVENT) == HRTIM_EVENT_5))              \
2554        ||                                        \
2555       ((((EVENT) == HRTIM_EVENT_6) ||            \
2556         ((EVENT) == HRTIM_EVENT_7) ||            \
2557         ((EVENT) == HRTIM_EVENT_8) ||            \
2558         ((EVENT) == HRTIM_EVENT_9) ||            \
2559         ((EVENT) == HRTIM_EVENT_10)) &&          \
2560         (((FILTER) == HRTIM_EVENTFILTER_NONE) || \
2561         ((FILTER) == HRTIM_EVENTFILTER_1)     || \
2562         ((FILTER) == HRTIM_EVENTFILTER_2)     || \
2563         ((FILTER) == HRTIM_EVENTFILTER_3)     || \
2564         ((FILTER) == HRTIM_EVENTFILTER_4)     || \
2565         ((FILTER) == HRTIM_EVENTFILTER_5)     || \
2566         ((FILTER) == HRTIM_EVENTFILTER_6)     || \
2567         ((FILTER) == HRTIM_EVENTFILTER_7)     || \
2568         ((FILTER) == HRTIM_EVENTFILTER_8)     || \
2569         ((FILTER) == HRTIM_EVENTFILTER_9)     || \
2570         ((FILTER) == HRTIM_EVENTFILTER_10)    || \
2571         ((FILTER) == HRTIM_EVENTFILTER_11)    || \
2572         ((FILTER) == HRTIM_EVENTFILTER_12)    || \
2573         ((FILTER) == HRTIM_EVENTFILTER_13)    || \
2574         ((FILTER) == HRTIM_EVENTFILTER_14)    || \
2575         ((FILTER) == HRTIM_EVENTFILTER_15))))
2576 
2577 #define IS_HRTIM_EVENTPRESCALER(EVENTPRESCALER)\
2578              (((EVENTPRESCALER) == HRTIM_EVENTPRESCALER_DIV1)  || \
2579               ((EVENTPRESCALER) == HRTIM_EVENTPRESCALER_DIV2)   || \
2580               ((EVENTPRESCALER) == HRTIM_EVENTPRESCALER_DIV4)   || \
2581               ((EVENTPRESCALER) == HRTIM_EVENTPRESCALER_DIV8))
2582 
2583 #define IS_HRTIM_FAULTSOURCE(FAULTSOURCE)\
2584               (((FAULTSOURCE) == HRTIM_FAULTSOURCE_DIGITALINPUT) || \
2585               ((FAULTSOURCE) == HRTIM_FAULTSOURCE_INTERNAL))
2586 
2587 #define IS_HRTIM_FAULTPOLARITY(HRTIM_FAULTPOLARITY)\
2588               (((HRTIM_FAULTPOLARITY) == HRTIM_FAULTPOLARITY_LOW) || \
2589                ((HRTIM_FAULTPOLARITY) == HRTIM_FAULTPOLARITY_HIGH))
2590 
2591 #define IS_HRTIM_FAULTMODECTL(FAULTMODECTL)\
2592     (((FAULTMODECTL) == HRTIM_FAULTMODECTL_DISABLED)  || \
2593      ((FAULTMODECTL) == HRTIM_FAULTMODECTL_ENABLED))
2594 
2595 #define IS_HRTIM_FAULTFILTER(FAULTFILTER)\
2596                 (((FAULTFILTER) == HRTIM_FAULTFILTER_NONE) || \
2597                  ((FAULTFILTER) == HRTIM_FAULTFILTER_1)    || \
2598                  ((FAULTFILTER) == HRTIM_FAULTFILTER_2)    || \
2599                  ((FAULTFILTER) == HRTIM_FAULTFILTER_3)    || \
2600                  ((FAULTFILTER) == HRTIM_FAULTFILTER_4)    || \
2601                  ((FAULTFILTER) == HRTIM_FAULTFILTER_5)    || \
2602                  ((FAULTFILTER) == HRTIM_FAULTFILTER_6)    || \
2603                  ((FAULTFILTER) == HRTIM_FAULTFILTER_7)    || \
2604                  ((FAULTFILTER) == HRTIM_FAULTFILTER_8)    || \
2605                  ((FAULTFILTER) == HRTIM_FAULTFILTER_9)    || \
2606                  ((FAULTFILTER) == HRTIM_FAULTFILTER_10)   || \
2607                  ((FAULTFILTER) == HRTIM_FAULTFILTER_11)   || \
2608                  ((FAULTFILTER) == HRTIM_FAULTFILTER_12)   || \
2609                  ((FAULTFILTER) == HRTIM_FAULTFILTER_13)   || \
2610                  ((FAULTFILTER) == HRTIM_FAULTFILTER_14)   || \
2611                  ((FAULTFILTER) == HRTIM_FAULTFILTER_15))
2612 
2613 #define IS_HRTIM_FAULTLOCK(FAULTLOCK)\
2614               (((FAULTLOCK) == HRTIM_FAULTLOCK_READWRITE) || \
2615                ((FAULTLOCK) == HRTIM_FAULTLOCK_READONLY))
2616 
2617 #define IS_HRTIM_FAULTPRESCALER(FAULTPRESCALER)\
2618              (((FAULTPRESCALER) == HRTIM_FAULTPRESCALER_DIV1)  || \
2619               ((FAULTPRESCALER) == HRTIM_FAULTPRESCALER_DIV2)   || \
2620               ((FAULTPRESCALER) == HRTIM_FAULTPRESCALER_DIV4)   || \
2621               ((FAULTPRESCALER) == HRTIM_FAULTPRESCALER_DIV8))
2622 
2623 #define IS_HRTIM_BURSTMODE(BURSTMODE)\
2624               (((BURSTMODE) == HRTIM_BURSTMODE_SINGLESHOT)  || \
2625                ((BURSTMODE) == HRTIM_BURSTMODE_CONTINOUS))
2626 
2627 #define IS_HRTIM_BURSTMODECLOCKSOURCE(BURSTMODECLOCKSOURCE)\
2628               (((BURSTMODECLOCKSOURCE) == HRTIM_BURSTMODECLOCKSOURCE_MASTER)      || \
2629                ((BURSTMODECLOCKSOURCE) == HRTIM_BURSTMODECLOCKSOURCE_TIMER_A)     || \
2630                ((BURSTMODECLOCKSOURCE) == HRTIM_BURSTMODECLOCKSOURCE_TIMER_B)     || \
2631                ((BURSTMODECLOCKSOURCE) == HRTIM_BURSTMODECLOCKSOURCE_TIMER_C)     || \
2632                ((BURSTMODECLOCKSOURCE) == HRTIM_BURSTMODECLOCKSOURCE_TIMER_D)     || \
2633                ((BURSTMODECLOCKSOURCE) == HRTIM_BURSTMODECLOCKSOURCE_TIMER_E)     || \
2634                ((BURSTMODECLOCKSOURCE) == HRTIM_BURSTMODECLOCKSOURCE_TIM16_OC)    || \
2635                ((BURSTMODECLOCKSOURCE) == HRTIM_BURSTMODECLOCKSOURCE_TIM17_OC)    || \
2636                ((BURSTMODECLOCKSOURCE) == HRTIM_BURSTMODECLOCKSOURCE_TIM7_TRGO)   || \
2637                ((BURSTMODECLOCKSOURCE) == HRTIM_BURSTMODECLOCKSOURCE_FHRTIM))
2638 
2639 #define IS_HRTIM_HRTIM_BURSTMODEPRESCALER(BURSTMODEPRESCALER)\
2640               (((BURSTMODEPRESCALER) == HRTIM_BURSTMODEPRESCALER_DIV1)     || \
2641                ((BURSTMODEPRESCALER) == HRTIM_BURSTMODEPRESCALER_DIV2)     || \
2642                ((BURSTMODEPRESCALER) == HRTIM_BURSTMODEPRESCALER_DIV4)     || \
2643                ((BURSTMODEPRESCALER) == HRTIM_BURSTMODEPRESCALER_DIV8)     || \
2644                ((BURSTMODEPRESCALER) == HRTIM_BURSTMODEPRESCALER_DIV16)    || \
2645                ((BURSTMODEPRESCALER) == HRTIM_BURSTMODEPRESCALER_DIV32)    || \
2646                ((BURSTMODEPRESCALER) == HRTIM_BURSTMODEPRESCALER_DIV64)    || \
2647                ((BURSTMODEPRESCALER) == HRTIM_BURSTMODEPRESCALER_DIV128)   || \
2648                ((BURSTMODEPRESCALER) == HRTIM_BURSTMODEPRESCALER_DIV256)   || \
2649                ((BURSTMODEPRESCALER) == HRTIM_BURSTMODEPRESCALER_DIV512)   || \
2650                ((BURSTMODEPRESCALER) == HRTIM_BURSTMODEPRESCALER_DIV1024)  || \
2651                ((BURSTMODEPRESCALER) == HRTIM_BURSTMODEPRESCALER_DIV2048)  || \
2652                ((BURSTMODEPRESCALER) == HRTIM_BURSTMODEPRESCALER_DIV4096)  || \
2653                ((BURSTMODEPRESCALER) == HRTIM_BURSTMODEPRESCALER_DIV8192)  || \
2654                ((BURSTMODEPRESCALER) == HRTIM_BURSTMODEPRESCALER_DIV16384) || \
2655                ((BURSTMODEPRESCALER) == HRTIM_BURSTMODEPRESCALER_DIV32768))
2656 
2657 #define IS_HRTIM_BURSTMODEPRELOAD(BURSTMODEPRELOAD)\
2658               (((BURSTMODEPRELOAD) == HRIM_BURSTMODEPRELOAD_DISABLED)  || \
2659                ((BURSTMODEPRELOAD) == HRIM_BURSTMODEPRELOAD_ENABLED))
2660 
2661 #define IS_HRTIM_BURSTMODETRIGGER(BURSTMODETRIGGER)\
2662               (((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_NONE)               || \
2663                ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_MASTER_RESET)       || \
2664                ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_MASTER_REPETITION)  || \
2665                ((BURSTMODETRIGGER) ==  HRTIM_BURSTMODETRIGGER_MASTER_CMP1)       || \
2666                ((BURSTMODETRIGGER) ==  HRTIM_BURSTMODETRIGGER_MASTER_CMP2)       || \
2667                ((BURSTMODETRIGGER) ==  HRTIM_BURSTMODETRIGGER_MASTER_CMP3)       || \
2668                ((BURSTMODETRIGGER) ==  HRTIM_BURSTMODETRIGGER_MASTER_CMP4)       || \
2669                ((BURSTMODETRIGGER) ==  HRTIM_BURSTMODETRIGGER_TIMERA_RESET)      || \
2670                ((BURSTMODETRIGGER) ==  HRTIM_BURSTMODETRIGGER_TIMERA_REPETITION) || \
2671                ((BURSTMODETRIGGER) ==  HRTIM_BURSTMODETRIGGER_TIMERA_CMP1)       || \
2672                ((BURSTMODETRIGGER) ==  HRTIM_BURSTMODETRIGGER_TIMERA_CMP2)       || \
2673                ((BURSTMODETRIGGER) ==  HRTIM_BURSTMODETRIGGER_TIMERB_RESET)      || \
2674                ((BURSTMODETRIGGER) ==  HRTIM_BURSTMODETRIGGER_TIMERB_REPETITION) || \
2675                ((BURSTMODETRIGGER) ==  HRTIM_BURSTMODETRIGGER_TIMERB_CMP1)       || \
2676                ((BURSTMODETRIGGER) ==  HRTIM_BURSTMODETRIGGER_TIMERB_CMP2)       || \
2677                ((BURSTMODETRIGGER) ==  HRTIM_BURSTMODETRIGGER_TIMERC_RESET)      || \
2678                ((BURSTMODETRIGGER) ==  HRTIM_BURSTMODETRIGGER_TIMERC_REPETITION) || \
2679                ((BURSTMODETRIGGER) ==  HRTIM_BURSTMODETRIGGER_TIMERC_CMP1)       || \
2680                ((BURSTMODETRIGGER) ==  HRTIM_BURSTMODETRIGGER_TIMERC_CMP2)       || \
2681                ((BURSTMODETRIGGER) ==  HRTIM_BURSTMODETRIGGER_TIMERD_RESET)      || \
2682                ((BURSTMODETRIGGER) ==  HRTIM_BURSTMODETRIGGER_TIMERD_REPETITION) || \
2683                ((BURSTMODETRIGGER) ==  HRTIM_BURSTMODETRIGGER_TIMERD_CMP1)       || \
2684                ((BURSTMODETRIGGER) ==  HRTIM_BURSTMODETRIGGER_TIMERD_CMP2)       || \
2685                ((BURSTMODETRIGGER) ==  HRTIM_BURSTMODETRIGGER_TIMERE_RESET)      || \
2686                ((BURSTMODETRIGGER) ==  HRTIM_BURSTMODETRIGGER_TIMERE_REPETITION) || \
2687                ((BURSTMODETRIGGER) ==  HRTIM_BURSTMODETRIGGER_TIMERE_CMP1)       || \
2688                ((BURSTMODETRIGGER) ==  HRTIM_BURSTMODETRIGGER_TIMERE_CMP2)       || \
2689                ((BURSTMODETRIGGER) ==  HRTIM_BURSTMODETRIGGER_TIMERA_EVENT7)     || \
2690                ((BURSTMODETRIGGER) ==  HRTIM_BURSTMODETRIGGER_TIMERD_EVENT8)     || \
2691                ((BURSTMODETRIGGER) ==  HRTIM_BURSTMODETRIGGER_EVENT_7)           || \
2692                ((BURSTMODETRIGGER) ==  HRTIM_BURSTMODETRIGGER_EVENT_8)           || \
2693                ((BURSTMODETRIGGER) ==  HRTIM_BURSTMODETRIGGER_EVENT_ONCHIP))
2694 
2695 #define IS_HRTIM_ADCTRIGGERUPDATE(ADCTRIGGERUPDATE)\
2696              (((ADCTRIGGERUPDATE) == HRTIM_ADCTRIGGERUPDATE_MASTER)   || \
2697               ((ADCTRIGGERUPDATE) == HRTIM_ADCTRIGGERUPDATE_TIMER_A)  || \
2698               ((ADCTRIGGERUPDATE) == HRTIM_ADCTRIGGERUPDATE_TIMER_B)  || \
2699               ((ADCTRIGGERUPDATE) == HRTIM_ADCTRIGGERUPDATE_TIMER_C)  || \
2700               ((ADCTRIGGERUPDATE) == HRTIM_ADCTRIGGERUPDATE_TIMER_D)  || \
2701               ((ADCTRIGGERUPDATE) == HRTIM_ADCTRIGGERUPDATE_TIMER_E))
2702 
2703 #define IS_HRTIM_CALIBRATIONRATE(CALIBRATIONRATE)\
2704     (((CALIBRATIONRATE) == HRTIM_SINGLE_CALIBRATION)   || \
2705      ((CALIBRATIONRATE) == HRTIM_CALIBRATIONRATE_7300) || \
2706      ((CALIBRATIONRATE) == HRTIM_CALIBRATIONRATE_910)  || \
2707      ((CALIBRATIONRATE) == HRTIM_CALIBRATIONRATE_114)  || \
2708      ((CALIBRATIONRATE) == HRTIM_CALIBRATIONRATE_14))
2709 
2710 #define IS_HRTIM_TIMER_BURSTDMA(TIMER, BURSTDMA)                                            \
2711     ((((TIMER) == HRTIM_TIMERINDEX_MASTER)  && (((BURSTDMA) & 0xFFFFC000U) == 0x00000000U)) \
2712   || (((TIMER) == HRTIM_TIMERINDEX_TIMER_A) && (((BURSTDMA) & 0xFFE00000U) == 0x00000000U)) \
2713   || (((TIMER) == HRTIM_TIMERINDEX_TIMER_B) && (((BURSTDMA) & 0xFFE00000U) == 0x00000000U)) \
2714   || (((TIMER) == HRTIM_TIMERINDEX_TIMER_C) && (((BURSTDMA) & 0xFFE00000U) == 0x00000000U)) \
2715   || (((TIMER) == HRTIM_TIMERINDEX_TIMER_D) && (((BURSTDMA) & 0xFFE00000U) == 0x00000000U)) \
2716   || (((TIMER) == HRTIM_TIMERINDEX_TIMER_E) && (((BURSTDMA) & 0xFFE00000U) == 0x00000000U)))
2717 
2718 #define IS_HRTIM_BURSTMODECTL(BURSTMODECTL)\
2719     (((BURSTMODECTL) == HRTIM_BURSTMODECTL_DISABLED)  || \
2720      ((BURSTMODECTL) == HRTIM_BURSTMODECTL_ENABLED))
2721 
2722 #define IS_HRTIM_TIMERUPDATE(TIMERUPDATE) (((TIMERUPDATE) & 0xFFFFFFC0U) == 0x00000000U)
2723 
2724 #define IS_HRTIM_TIMERRESET(TIMERRESET) (((TIMERRESET) & 0xFFFFC0FFU) == 0x00000000U)
2725 
2726 #define IS_HRTIM_IT(IT) (((IT) & 0xFFFCFFC0U) == 0x00000000U)
2727 
2728 
2729 #define IS_HRTIM_MASTER_IT(MASTER_IT) (((MASTER_IT) & 0xFFFFFF80U) == 0x00000000U)
2730 
2731 
2732 #define IS_HRTIM_TIM_IT(TIM_IT) (((TIM_IT) & 0xFFFF8020U) == 0x00000000U)
2733 
2734 
2735 #define IS_HRTIM_MASTER_DMA(MASTER_DMA) (((MASTER_DMA) & 0xFF80FFFFU) == 0x00000000U)
2736 
2737 #define IS_HRTIM_TIM_DMA(TIM_DMA) (((TIM_DMA) & 0x8020FFFFU) == 0x00000000U)
2738 /**
2739   * @}
2740   */
2741 
2742 /* Exported macros -----------------------------------------------------------*/
2743 /** @defgroup HRTIM_Exported_Macros HRTIM Exported Macros
2744   * @{
2745   */
2746 
2747 /** @brief Reset HRTIM handle state
2748   * @param  __HANDLE__ HRTIM handle.
2749   * @retval None
2750   */
2751 #if (USE_HAL_HRTIM_REGISTER_CALLBACKS == 1)
2752 #define __HAL_HRTIM_RESET_HANDLE_STATE(__HANDLE__)                do{                                                       \
2753                                                                     (__HANDLE__)->State             = HAL_HRTIM_STATE_RESET; \
2754                                                                     (__HANDLE__)->MspInitCallback   = NULL;                  \
2755                                                                     (__HANDLE__)->MspDeInitCallback = NULL;                 \
2756                                                                   } while(0)
2757 #else
2758 #define __HAL_HRTIM_RESET_HANDLE_STATE(__HANDLE__)                ((__HANDLE__)->State = HAL_HRTIM_STATE_RESET)
2759 #endif
2760 
2761 /** @brief  Enables or disables the timer counter(s)
2762   * @param  __HANDLE__ specifies the HRTIM Handle.
2763   * @param  __TIMERS__ timers to enable/disable
2764   *        This parameter can be any combinations of the following values:
2765   *            @arg HRTIM_TIMERID_MASTER: Master timer identifier
2766   *            @arg HRTIM_TIMERID_TIMER_A: Timer A identifier
2767   *            @arg HRTIM_TIMERID_TIMER_B: Timer B identifier
2768   *            @arg HRTIM_TIMERID_TIMER_C: Timer C identifier
2769   *            @arg HRTIM_TIMERID_TIMER_D: Timer D identifier
2770   *            @arg HRTIM_TIMERID_TIMER_E: Timer E identifier
2771   * @retval None
2772   */
2773 #define __HAL_HRTIM_ENABLE(__HANDLE__, __TIMERS__)   ((__HANDLE__)->Instance->sMasterRegs.MCR |= (__TIMERS__))
2774 
2775 /* The counter of a timing unit is disabled only if all the timer outputs */
2776 /* are disabled and no capture is configured                              */
2777 #define HRTIM_TAOEN_MASK (HRTIM_OENR_TA2OEN | HRTIM_OENR_TA1OEN)
2778 #define HRTIM_TBOEN_MASK (HRTIM_OENR_TB2OEN | HRTIM_OENR_TB1OEN)
2779 #define HRTIM_TCOEN_MASK (HRTIM_OENR_TC2OEN | HRTIM_OENR_TC1OEN)
2780 #define HRTIM_TDOEN_MASK (HRTIM_OENR_TD2OEN | HRTIM_OENR_TD1OEN)
2781 #define HRTIM_TEOEN_MASK (HRTIM_OENR_TE2OEN | HRTIM_OENR_TE1OEN)
2782 #define __HAL_HRTIM_DISABLE(__HANDLE__, __TIMERS__)\
2783   do {\
2784     if (((__TIMERS__) & HRTIM_TIMERID_MASTER) == HRTIM_TIMERID_MASTER)\
2785       {\
2786         ((__HANDLE__)->Instance->sMasterRegs.MCR &= ~HRTIM_TIMERID_MASTER);\
2787       }\
2788     if (((__TIMERS__) & HRTIM_TIMERID_TIMER_A) == HRTIM_TIMERID_TIMER_A)\
2789       {\
2790         if (((__HANDLE__)->Instance->sCommonRegs.OENR & HRTIM_TAOEN_MASK) == (uint32_t)RESET)\
2791           {\
2792             ((__HANDLE__)->Instance->sMasterRegs.MCR &= ~HRTIM_TIMERID_TIMER_A);\
2793           }\
2794       }\
2795     if (((__TIMERS__) & HRTIM_TIMERID_TIMER_B) == HRTIM_TIMERID_TIMER_B)\
2796       {\
2797         if (((__HANDLE__)->Instance->sCommonRegs.OENR & HRTIM_TBOEN_MASK) == (uint32_t)RESET)\
2798           {\
2799             ((__HANDLE__)->Instance->sMasterRegs.MCR &= ~HRTIM_TIMERID_TIMER_B);\
2800           }\
2801       }\
2802     if (((__TIMERS__) & HRTIM_TIMERID_TIMER_C) == HRTIM_TIMERID_TIMER_C)\
2803       {\
2804         if (((__HANDLE__)->Instance->sCommonRegs.OENR & HRTIM_TCOEN_MASK) == (uint32_t)RESET)\
2805           {\
2806             ((__HANDLE__)->Instance->sMasterRegs.MCR &= ~HRTIM_TIMERID_TIMER_C);\
2807           }\
2808       }\
2809     if (((__TIMERS__) & HRTIM_TIMERID_TIMER_D) == HRTIM_TIMERID_TIMER_D)\
2810       {\
2811         if (((__HANDLE__)->Instance->sCommonRegs.OENR & HRTIM_TDOEN_MASK) == (uint32_t)RESET)\
2812           {\
2813             ((__HANDLE__)->Instance->sMasterRegs.MCR &= ~HRTIM_TIMERID_TIMER_D);\
2814           }\
2815       }\
2816     if (((__TIMERS__) & HRTIM_TIMERID_TIMER_E) == HRTIM_TIMERID_TIMER_E)\
2817       {\
2818         if (((__HANDLE__)->Instance->sCommonRegs.OENR & HRTIM_TEOEN_MASK) == (uint32_t)RESET)\
2819           {\
2820             ((__HANDLE__)->Instance->sMasterRegs.MCR &= ~HRTIM_TIMERID_TIMER_E);\
2821           }\
2822       }\
2823   } while(0U)
2824 
2825 
2826 /** @brief  Enables or disables the specified HRTIM common interrupts.
2827   * @param  __HANDLE__ specifies the HRTIM Handle.
2828   * @param  __INTERRUPT__ specifies the interrupt source to enable or disable.
2829   *        This parameter can be one of the following values:
2830   *            @arg HRTIM_IT_FLT1: Fault 1 interrupt enable
2831   *            @arg HRTIM_IT_FLT2: Fault 2 interrupt enable
2832   *            @arg HRTIM_IT_FLT3: Fault 3 interrupt enable
2833   *            @arg HRTIM_IT_FLT4: Fault 4 interrupt enable
2834   *            @arg HRTIM_IT_FLT5: Fault 5 interrupt enable
2835   *            @arg HRTIM_IT_SYSFLT: System Fault interrupt enable
2836   *            @arg HRTIM_IT_BMPER: Burst mode period interrupt enable
2837   * @retval None
2838   */
2839 #define __HAL_HRTIM_ENABLE_IT(__HANDLE__, __INTERRUPT__)   ((__HANDLE__)->Instance->sCommonRegs.IER |= (__INTERRUPT__))
2840 #define __HAL_HRTIM_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->sCommonRegs.IER &= ~(__INTERRUPT__))
2841 
2842 /** @brief  Enables or disables the specified HRTIM Master timer interrupts.
2843   * @param  __HANDLE__ specifies the HRTIM Handle.
2844   * @param  __INTERRUPT__ specifies the interrupt source to enable or disable.
2845   *        This parameter can be one of the following values:
2846   *            @arg HRTIM_MASTER_IT_MCMP1: Master compare 1 interrupt enable
2847   *            @arg HRTIM_MASTER_IT_MCMP2: Master compare 2 interrupt enable
2848   *            @arg HRTIM_MASTER_IT_MCMP3: Master compare 3 interrupt enable
2849   *            @arg HRTIM_MASTER_IT_MCMP4: Master compare 4 interrupt enable
2850   *            @arg HRTIM_MASTER_IT_MREP: Master Repetition interrupt enable
2851   *            @arg HRTIM_MASTER_IT_SYNC: Synchronization input interrupt enable
2852   *            @arg HRTIM_MASTER_IT_MUPD: Master update interrupt enable
2853   * @retval None
2854   */
2855 #define __HAL_HRTIM_MASTER_ENABLE_IT(__HANDLE__, __INTERRUPT__)   ((__HANDLE__)->Instance->sMasterRegs.MDIER |= (__INTERRUPT__))
2856 #define __HAL_HRTIM_MASTER_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->sMasterRegs.MDIER &= ~(__INTERRUPT__))
2857 
2858 /** @brief  Enables or disables the specified HRTIM Timerx interrupts.
2859   * @param  __HANDLE__ specifies the HRTIM Handle.
2860   * @param  __TIMER__ specified the timing unit (Timer A to E)
2861   * @param  __INTERRUPT__ specifies the interrupt source to enable or disable.
2862   *        This parameter can be one of the following values:
2863   *            @arg HRTIM_TIM_IT_CMP1: Timer compare 1 interrupt enable
2864   *            @arg HRTIM_TIM_IT_CMP2: Timer compare 2 interrupt enable
2865   *            @arg HRTIM_TIM_IT_CMP3: Timer compare 3 interrupt enable
2866   *            @arg HRTIM_TIM_IT_CMP4: Timer compare 4 interrupt enable
2867   *            @arg HRTIM_TIM_IT_REP: Timer repetition interrupt enable
2868   *            @arg HRTIM_TIM_IT_UPD: Timer update interrupt enable
2869   *            @arg HRTIM_TIM_IT_CPT1: Timer capture 1 interrupt enable
2870   *            @arg HRTIM_TIM_IT_CPT2: Timer capture 2 interrupt enable
2871   *            @arg HRTIM_TIM_IT_SET1: Timer output 1 set interrupt enable
2872   *            @arg HRTIM_TIM_IT_RST1: Timer output 1 reset interrupt enable
2873   *            @arg HRTIM_TIM_IT_SET2: Timer output 2 set interrupt enable
2874   *            @arg HRTIM_TIM_IT_RST2: Timer output 2 reset interrupt enable
2875   *            @arg HRTIM_TIM_IT_RST: Timer reset interrupt enable
2876   *            @arg HRTIM_TIM_IT_DLYPRT: Timer delay protection interrupt enable
2877   * @retval None
2878   */
2879 #define __HAL_HRTIM_TIMER_ENABLE_IT(__HANDLE__, __TIMER__, __INTERRUPT__)   ((__HANDLE__)->Instance->sTimerxRegs[(__TIMER__)].TIMxDIER |= (__INTERRUPT__))
2880 #define __HAL_HRTIM_TIMER_DISABLE_IT(__HANDLE__, __TIMER__, __INTERRUPT__) ((__HANDLE__)->Instance->sTimerxRegs[(__TIMER__)].TIMxDIER &= ~(__INTERRUPT__))
2881 
2882 /** @brief  Checks if the specified HRTIM common interrupt  source  is enabled or disabled.
2883   * @param  __HANDLE__ specifies the HRTIM Handle.
2884   * @param  __INTERRUPT__ specifies the interrupt source to check.
2885   *        This parameter can be one of the following values:
2886   *            @arg HRTIM_IT_FLT1: Fault 1 interrupt enable
2887   *            @arg HRTIM_IT_FLT2: Fault 2 interrupt enable
2888   *            @arg HRTIM_IT_FLT3: Fault 3 enable
2889   *            @arg HRTIM_IT_FLT4: Fault 4 enable
2890   *            @arg HRTIM_IT_FLT5: Fault 5 enable
2891   *            @arg HRTIM_IT_SYSFLT: System Fault interrupt enable
2892   *            @arg HRTIM_IT_BMPER: Burst mode period interrupt enable
2893   * @retval The new state of __INTERRUPT__ (TRUE or FALSE).
2894   */
2895 #define __HAL_HRTIM_GET_ITSTATUS(__HANDLE__, __INTERRUPT__)     ((((__HANDLE__)->Instance->sCommonRegs.IER & (__INTERRUPT__)) == (__INTERRUPT__)) ? SET : RESET)
2896 
2897 /** @brief  Checks if the specified HRTIM Master interrupt source  is enabled or disabled.
2898   * @param  __HANDLE__ specifies the HRTIM Handle.
2899   * @param  __INTERRUPT__ specifies the interrupt source to check.
2900   *        This parameter can be one of the following values:
2901   *            @arg HRTIM_MASTER_IT_MCMP1: Master compare 1 interrupt enable
2902   *            @arg HRTIM_MASTER_IT_MCMP2: Master compare 2 interrupt enable
2903   *            @arg HRTIM_MASTER_IT_MCMP3: Master compare 3 interrupt enable
2904   *            @arg HRTIM_MASTER_IT_MCMP4: Master compare 4 interrupt enable
2905   *            @arg HRTIM_MASTER_IT_MREP: Master Repetition interrupt enable
2906   *            @arg HRTIM_MASTER_IT_SYNC: Synchronization input interrupt enable
2907   *            @arg HRTIM_MASTER_IT_MUPD: Master update interrupt enable
2908   * @retval The new state of __INTERRUPT__ (TRUE or FALSE).
2909   */
2910 #define __HAL_HRTIM_MASTER_GET_ITSTATUS(__HANDLE__, __INTERRUPT__)     ((((__HANDLE__)->Instance->sMasterRegs.MDIER & (__INTERRUPT__)) == (__INTERRUPT__)) ? SET : RESET)
2911 
2912 /** @brief  Checks if the specified HRTIM Timerx interrupt source  is enabled or disabled.
2913   * @param  __HANDLE__ specifies the HRTIM Handle.
2914   * @param  __TIMER__ specified the timing unit (Timer A to E)
2915   * @param  __INTERRUPT__ specifies the interrupt source to check.
2916   *        This parameter can be one of the following values:
2917   *            @arg HRTIM_MASTER_IT_MCMP1: Master compare 1 interrupt enable
2918   *            @arg HRTIM_MASTER_IT_MCMP2: Master compare 2 interrupt enable
2919   *            @arg HRTIM_MASTER_IT_MCMP3: Master compare 3 interrupt enable
2920   *            @arg HRTIM_MASTER_IT_MCMP4: Master compare 4 interrupt enable
2921   *            @arg HRTIM_MASTER_IT_MREP: Master Repetition interrupt enable
2922   *            @arg HRTIM_MASTER_IT_SYNC: Synchronization input interrupt enable
2923   *            @arg HRTIM_MASTER_IT_MUPD: Master update interrupt enable
2924   *            @arg HRTIM_TIM_IT_CMP1: Timer compare 1 interrupt enable
2925   *            @arg HRTIM_TIM_IT_CMP2: Timer compare 2 interrupt enable
2926   *            @arg HRTIM_TIM_IT_CMP3: Timer compare 3 interrupt enable
2927   *            @arg HRTIM_TIM_IT_CMP4: Timer compare 4 interrupt enable
2928   *            @arg HRTIM_TIM_IT_REP: Timer repetition interrupt enable
2929   *            @arg HRTIM_TIM_IT_UPD: Timer update interrupt enable
2930   *            @arg HRTIM_TIM_IT_CPT1: Timer capture 1 interrupt enable
2931   *            @arg HRTIM_TIM_IT_CPT2: Timer capture 2 interrupt enable
2932   *            @arg HRTIM_TIM_IT_SET1: Timer output 1 set interrupt enable
2933   *            @arg HRTIM_TIM_IT_RST1: Timer output 1 reset interrupt enable
2934   *            @arg HRTIM_TIM_IT_SET2: Timer output 2 set interrupt enable
2935   *            @arg HRTIM_TIM_IT_RST2: Timer output 2 reset interrupt enable
2936   *            @arg HRTIM_TIM_IT_RST: Timer reset interrupt enable
2937   *            @arg HRTIM_TIM_IT_DLYPRT: Timer delay protection interrupt enable
2938   * @retval The new state of __INTERRUPT__ (TRUE or FALSE).
2939   */
2940 #define __HAL_HRTIM_TIMER_GET_ITSTATUS(__HANDLE__, __TIMER__, __INTERRUPT__)     ((((__HANDLE__)->Instance->sTimerxRegs[(__TIMER__)].TIMxDIER & (__INTERRUPT__)) == (__INTERRUPT__)) ? SET : RESET)
2941 
2942 /** @brief  Clears the specified HRTIM common pending flag.
2943   * @param  __HANDLE__ specifies the HRTIM Handle.
2944   * @param  __INTERRUPT__ specifies the interrupt pending bit to clear.
2945   *        This parameter can be one of the following values:
2946   *            @arg HRTIM_IT_FLT1: Fault 1 interrupt clear flag
2947   *            @arg HRTIM_IT_FLT2: Fault 2 interrupt clear flag
2948   *            @arg HRTIM_IT_FLT3: Fault 3 clear flag
2949   *            @arg HRTIM_IT_FLT4: Fault 4 clear flag
2950   *            @arg HRTIM_IT_FLT5: Fault 5 clear flag
2951   *            @arg HRTIM_IT_SYSFLT: System Fault interrupt clear flag
2952   *            @arg HRTIM_IT_BMPER: Burst mode period interrupt clear flag
2953   * @retval None
2954   */
2955 #define __HAL_HRTIM_CLEAR_IT(__HANDLE__, __INTERRUPT__)   ((__HANDLE__)->Instance->sCommonRegs.ICR = (__INTERRUPT__))
2956 
2957 /** @brief  Clears the specified HRTIM Master pending flag.
2958   * @param  __HANDLE__ specifies the HRTIM Handle.
2959   * @param  __INTERRUPT__ specifies the interrupt pending bit to clear.
2960   *        This parameter can be one of the following values:
2961   *            @arg HRTIM_MASTER_IT_MCMP1: Master compare 1 interrupt clear flag
2962   *            @arg HRTIM_MASTER_IT_MCMP2: Master compare 2 interrupt clear flag
2963   *            @arg HRTIM_MASTER_IT_MCMP3: Master compare 3 interrupt clear flag
2964   *            @arg HRTIM_MASTER_IT_MCMP4: Master compare 4 interrupt clear flag
2965   *            @arg HRTIM_MASTER_IT_MREP: Master Repetition interrupt clear flag
2966   *            @arg HRTIM_MASTER_IT_SYNC: Synchronization input interrupt clear flag
2967   *            @arg HRTIM_MASTER_IT_MUPD: Master update interrupt clear flag
2968   * @retval None
2969   */
2970 #define __HAL_HRTIM_MASTER_CLEAR_IT(__HANDLE__, __INTERRUPT__)   ((__HANDLE__)->Instance->sMasterRegs.MICR = (__INTERRUPT__))
2971 
2972 /** @brief  Clears the specified HRTIM Timerx pending flag.
2973   * @param  __HANDLE__ specifies the HRTIM Handle.
2974   * @param  __TIMER__ specified the timing unit (Timer A to E)
2975   * @param  __INTERRUPT__ specifies the interrupt pending bit to clear.
2976   *        This parameter can be one of the following values:
2977   *            @arg HRTIM_TIM_IT_CMP1: Timer compare 1 interrupt clear flag
2978   *            @arg HRTIM_TIM_IT_CMP2: Timer compare 2 interrupt clear flag
2979   *            @arg HRTIM_TIM_IT_CMP3: Timer compare 3 interrupt clear flag
2980   *            @arg HRTIM_TIM_IT_CMP4: Timer compare 4 interrupt clear flag
2981   *            @arg HRTIM_TIM_IT_REP: Timer repetition interrupt clear flag
2982   *            @arg HRTIM_TIM_IT_UPD: Timer update interrupt clear flag
2983   *            @arg HRTIM_TIM_IT_CPT1: Timer capture 1 interrupt clear flag
2984   *            @arg HRTIM_TIM_IT_CPT2: Timer capture 2 interrupt clear flag
2985   *            @arg HRTIM_TIM_IT_SET1: Timer output 1 set interrupt clear flag
2986   *            @arg HRTIM_TIM_IT_RST1: Timer output 1 reset interrupt clear flag
2987   *            @arg HRTIM_TIM_IT_SET2: Timer output 2 set interrupt clear flag
2988   *            @arg HRTIM_TIM_IT_RST2: Timer output 2 reset interrupt clear flag
2989   *            @arg HRTIM_TIM_IT_RST: Timer reset interrupt clear flag
2990   *            @arg HRTIM_TIM_IT_DLYPRT: Timer output 1 delay protection interrupt clear flag
2991   * @retval None
2992   */
2993 #define __HAL_HRTIM_TIMER_CLEAR_IT(__HANDLE__, __TIMER__, __INTERRUPT__)   ((__HANDLE__)->Instance->sTimerxRegs[(__TIMER__)].TIMxICR = (__INTERRUPT__))
2994 
2995 /* DMA HANDLING */
2996 /** @brief  Enables or disables the specified HRTIM Master timer DMA requests.
2997   * @param  __HANDLE__ specifies the HRTIM Handle.
2998   * @param  __DMA__ specifies the DMA request to enable or disable.
2999   *        This parameter can be one of the following values:
3000   *            @arg HRTIM_MASTER_DMA_MCMP1: Master compare 1 DMA request enable
3001   *            @arg HRTIM_MASTER_DMA_MCMP2: Master compare 2 DMA request enable
3002   *            @arg HRTIM_MASTER_DMA_MCMP3: Master compare 3 DMA request enable
3003   *            @arg HRTIM_MASTER_DMA_MCMP4: Master compare 4 DMA request enable
3004   *            @arg HRTIM_MASTER_DMA_MREP: Master Repetition DMA request enable
3005   *            @arg HRTIM_MASTER_DMA_SYNC: Synchronization input DMA request enable
3006   *            @arg HRTIM_MASTER_DMA_MUPD: Master update DMA request enable
3007   * @retval None
3008   */
3009 #define __HAL_HRTIM_MASTER_ENABLE_DMA(__HANDLE__, __DMA__)   ((__HANDLE__)->Instance->sMasterRegs.MDIER |= (__DMA__))
3010 #define __HAL_HRTIM_MASTER_DISABLE_DMA(__HANDLE__, __DMA__) ((__HANDLE__)->Instance->sMasterRegs.MDIER &= ~(__DMA__))
3011 
3012 /** @brief  Enables or disables the specified HRTIM Timerx DMA requests.
3013   * @param  __HANDLE__ specifies the HRTIM Handle.
3014   * @param  __TIMER__ specified the timing unit (Timer A to E)
3015   * @param  __DMA__ specifies the DMA request to enable or disable.
3016   *        This parameter can be one of the following values:
3017   *            @arg HRTIM_TIM_DMA_CMP1: Timer compare 1 DMA request enable
3018   *            @arg HRTIM_TIM_DMA_CMP2: Timer compare 2 DMA request enable
3019   *            @arg HRTIM_TIM_DMA_CMP3: Timer compare 3 DMA request enable
3020   *            @arg HRTIM_TIM_DMA_CMP4: Timer compare 4 DMA request enable
3021   *            @arg HRTIM_TIM_DMA_REP: Timer repetition DMA request enable
3022   *            @arg HRTIM_TIM_DMA_UPD: Timer update DMA request enable
3023   *            @arg HRTIM_TIM_DMA_CPT1: Timer capture 1 DMA request enable
3024   *            @arg HRTIM_TIM_DMA_CPT2: Timer capture 2 DMA request enable
3025   *            @arg HRTIM_TIM_DMA_SET1: Timer output 1 set DMA request enable
3026   *            @arg HRTIM_TIM_DMA_RST1: Timer output 1 reset DMA request enable
3027   *            @arg HRTIM_TIM_DMA_SET2: Timer output 2 set DMA request enable
3028   *            @arg HRTIM_TIM_DMA_RST2: Timer output 2 reset DMA request enable
3029   *            @arg HRTIM_TIM_DMA_RST: Timer reset DMA request enable
3030   *            @arg HRTIM_TIM_DMA_DLYPRT: Timer delay protection DMA request enable
3031   * @retval None
3032   */
3033 #define __HAL_HRTIM_TIMER_ENABLE_DMA(__HANDLE__, __TIMER__, __DMA__)   ((__HANDLE__)->Instance->sTimerxRegs[(__TIMER__)].TIMxDIER |= (__DMA__))
3034 #define __HAL_HRTIM_TIMER_DISABLE_DMA(__HANDLE__, __TIMER__, __DMA__) ((__HANDLE__)->Instance->sTimerxRegs[(__TIMER__)].TIMxDIER &= ~(__DMA__))
3035 
3036 #define __HAL_HRTIM_GET_FLAG(__HANDLE__, __FLAG__)        (((__HANDLE__)->Instance->sCommonRegs.ISR & (__FLAG__)) == (__FLAG__))
3037 #define __HAL_HRTIM_CLEAR_FLAG(__HANDLE__, __FLAG__)      ((__HANDLE__)->Instance->sCommonRegs.ICR = (__FLAG__))
3038 
3039 #define __HAL_HRTIM_MASTER_GET_FLAG(__HANDLE__, __FLAG__)        (((__HANDLE__)->Instance->sMasterRegs.MISR & (__FLAG__)) == (__FLAG__))
3040 #define __HAL_HRTIM_MASTER_CLEAR_FLAG(__HANDLE__, __FLAG__)      ((__HANDLE__)->Instance->sMasterRegs.MICR = (__FLAG__))
3041 
3042 #define __HAL_HRTIM_TIMER_GET_FLAG(__HANDLE__,  __TIMER__, __FLAG__)        (((__HANDLE__)->Instance->sTimerxRegs[(__TIMER__)].TIMxISR & (__FLAG__)) == (__FLAG__))
3043 #define __HAL_HRTIM_TIMER_CLEAR_FLAG(__HANDLE__,  __TIMER__, __FLAG__)      ((__HANDLE__)->Instance->sTimerxRegs[(__TIMER__)].TIMxICR = (__FLAG__))
3044 
3045 /** @brief  Sets the HRTIM timer Counter Register value on runtime
3046   * @param  __HANDLE__ HRTIM Handle.
3047   * @param  __TIMER__ HRTIM timer
3048   *                   This parameter can be one of the following values:
3049   *                   @arg 0x5 for master timer
3050   *                   @arg 0x0 to 0x4 for timers A to E
3051   * @param  __COUNTER__ specifies the Counter Register new value.
3052   * @retval None
3053   */
3054 #define __HAL_HRTIM_SETCOUNTER(__HANDLE__, __TIMER__, __COUNTER__) \
3055   (((__TIMER__) == HRTIM_TIMERINDEX_MASTER) ? ((__HANDLE__)->Instance->sMasterRegs.MCNTR = (__COUNTER__)) :\
3056    ((__HANDLE__)->Instance->sTimerxRegs[(__TIMER__)].CNTxR = (__COUNTER__)))
3057 
3058 /** @brief  Gets the HRTIM timer Counter Register value on runtime
3059   * @param  __HANDLE__ HRTIM Handle.
3060   * @param  __TIMER__ HRTIM timer
3061   *                   This parameter can be one of the following values:
3062   *                   @arg 0x5 for master timer
3063   *                   @arg 0x0 to 0x4 for timers A to E
3064   * @retval HRTIM timer Counter Register value
3065   */
3066 #define __HAL_HRTIM_GETCOUNTER(__HANDLE__, __TIMER__) \
3067   (((__TIMER__) == HRTIM_TIMERINDEX_MASTER) ? ((__HANDLE__)->Instance->sMasterRegs.MCNTR) :\
3068    ((__HANDLE__)->Instance->sTimerxRegs[(__TIMER__)].CNTxR))
3069 
3070 /** @brief  Sets the HRTIM timer Period value on runtime
3071   * @param  __HANDLE__ HRTIM Handle.
3072   * @param  __TIMER__ HRTIM timer
3073   *                   This parameter can be one of the following values:
3074   *                   @arg 0x5 for master timer
3075   *                   @arg 0x0 to 0x4 for timers A to E
3076   * @param  __PERIOD__ specifies the Period Register new value.
3077   * @retval None
3078   */
3079 #define __HAL_HRTIM_SETPERIOD(__HANDLE__, __TIMER__, __PERIOD__) \
3080   (((__TIMER__) == HRTIM_TIMERINDEX_MASTER) ? ((__HANDLE__)->Instance->sMasterRegs.MPER = (__PERIOD__)) :\
3081    ((__HANDLE__)->Instance->sTimerxRegs[(__TIMER__)].PERxR = (__PERIOD__)))
3082 
3083 /** @brief  Gets the HRTIM timer Period Register value on runtime
3084   * @param  __HANDLE__ HRTIM Handle.
3085   * @param  __TIMER__ HRTIM timer
3086   *                   This parameter can be one of the following values:
3087   *                   @arg 0x5 for master timer
3088   *                   @arg 0x0 to 0x4 for timers A to E
3089   * @retval timer Period Register
3090   */
3091 #define __HAL_HRTIM_GETPERIOD(__HANDLE__, __TIMER__) \
3092   (((__TIMER__) == HRTIM_TIMERINDEX_MASTER) ? ((__HANDLE__)->Instance->sMasterRegs.MPER) :\
3093    ((__HANDLE__)->Instance->sTimerxRegs[(__TIMER__)].PERxR))
3094 
3095 /** @brief  Sets the HRTIM timer clock prescaler value on runtime
3096   * @param  __HANDLE__ HRTIM Handle.
3097   * @param  __TIMER__ HRTIM timer
3098   *                   This parameter can be one of the following values:
3099   *                   @arg 0x5 for master timer
3100   *                   @arg 0x0 to 0x4 for timers A to E
3101   * @param  __PRESCALER__ specifies the clock prescaler new value.
3102   *                   This parameter can be one of the following values:
3103   *                   @arg HRTIM_PRESCALERRATIO_DIV1: fHRCK: 144 MHz - Resolution: 6.95 ns - Min PWM frequency: 2.2 kHz (fHRTIM=144MHz)
3104   *                   @arg HRTIM_PRESCALERRATIO_DIV2: fHRCK: 72 MHz - Resolution: 13.88 ns- Min PWM frequency: 1.1 kHz (fHRTIM=144MHz)
3105   *                   @arg HRTIM_PRESCALERRATIO_DIV4: fHRCK: 36 MHz - Resolution: 27.7 ns- Min PWM frequency: 550Hz (fHRTIM=144MHz)
3106   * @retval None
3107   */
3108 #define __HAL_HRTIM_SETCLOCKPRESCALER(__HANDLE__, __TIMER__, __PRESCALER__) \
3109   (((__TIMER__) == HRTIM_TIMERINDEX_MASTER) ? (MODIFY_REG((__HANDLE__)->Instance->sMasterRegs.MCR, HRTIM_MCR_CK_PSC, (__PRESCALER__))) :\
3110    (MODIFY_REG((__HANDLE__)->Instance->sTimerxRegs[(__TIMER__)].TIMxCR, HRTIM_TIMCR_CK_PSC, (__PRESCALER__))))
3111 
3112 /** @brief  Gets the HRTIM timer clock prescaler value on runtime
3113   * @param  __HANDLE__ HRTIM Handle.
3114   * @param  __TIMER__ HRTIM timer
3115   *                   This parameter can be one of the following values:
3116   *                   @arg 0x5 for master timer
3117   *                   @arg 0x0 to 0x4 for timers A to E
3118   * @retval timer clock prescaler value
3119   */
3120 #define __HAL_HRTIM_GETCLOCKPRESCALER(__HANDLE__, __TIMER__) \
3121   (((__TIMER__) == HRTIM_TIMERINDEX_MASTER) ? ((__HANDLE__)->Instance->sMasterRegs.MCR & HRTIM_MCR_CK_PSC) :\
3122    ((__HANDLE__)->Instance->sTimerxRegs[(__TIMER__)].TIMxCR  & HRTIM_TIMCR_CK_PSC))
3123 
3124 /** @brief  Sets the HRTIM timer Compare Register value on runtime
3125   * @param  __HANDLE__ HRTIM Handle.
3126   * @param  __TIMER__ HRTIM timer
3127   *                   This parameter can be one of the following values:
3128   *                   @arg 0x0 to 0x4 for timers A to E
3129   * @param  __COMPAREUNIT__ timer compare unit
3130   *                   This parameter can be one of the following values:
3131   *                   @arg HRTIM_COMPAREUNIT_1: Compare unit 1
3132   *                   @arg HRTIM_COMPAREUNIT_2: Compare unit 2
3133   *                   @arg HRTIM_COMPAREUNIT_3: Compare unit 3
3134   *                   @arg HRTIM_COMPAREUNIT_4: Compare unit 4
3135   * @param  __COMPARE__ specifies the Compare new value.
3136   * @retval None
3137   */
3138 #define __HAL_HRTIM_SETCOMPARE(__HANDLE__, __TIMER__, __COMPAREUNIT__, __COMPARE__) \
3139       (((__TIMER__) == HRTIM_TIMERINDEX_MASTER) ? \
3140         (((__COMPAREUNIT__) == HRTIM_COMPAREUNIT_1) ? ((__HANDLE__)->Instance->sMasterRegs.MCMP1R = (__COMPARE__)) :\
3141          ((__COMPAREUNIT__) == HRTIM_COMPAREUNIT_2) ? ((__HANDLE__)->Instance->sMasterRegs.MCMP2R = (__COMPARE__)) :\
3142          ((__COMPAREUNIT__) == HRTIM_COMPAREUNIT_3) ? ((__HANDLE__)->Instance->sMasterRegs.MCMP3R = (__COMPARE__)) :\
3143          ((__HANDLE__)->Instance->sMasterRegs.MCMP4R = (__COMPARE__))) \
3144          : \
3145         (((__COMPAREUNIT__) == HRTIM_COMPAREUNIT_1) ? ((__HANDLE__)->Instance->sTimerxRegs[(__TIMER__)].CMP1xR = (__COMPARE__)) :\
3146          ((__COMPAREUNIT__) == HRTIM_COMPAREUNIT_2) ? ((__HANDLE__)->Instance->sTimerxRegs[(__TIMER__)].CMP2xR = (__COMPARE__)) :\
3147          ((__COMPAREUNIT__) == HRTIM_COMPAREUNIT_3) ? ((__HANDLE__)->Instance->sTimerxRegs[(__TIMER__)].CMP3xR = (__COMPARE__)) :\
3148          ((__HANDLE__)->Instance->sTimerxRegs[(__TIMER__)].CMP4xR = (__COMPARE__))))
3149 
3150 /** @brief  Gets the HRTIM timer Compare Register value on runtime
3151   * @param  __HANDLE__ HRTIM Handle.
3152   * @param  __TIMER__ HRTIM timer
3153   *                   This parameter can be one of the following values:
3154   *                   @arg 0x0 to 0x4 for timers A to E
3155   * @param  __COMPAREUNIT__ timer compare unit
3156   *                   This parameter can be one of the following values:
3157   *                   @arg HRTIM_COMPAREUNIT_1: Compare unit 1
3158   *                   @arg HRTIM_COMPAREUNIT_2: Compare unit 2
3159   *                   @arg HRTIM_COMPAREUNIT_3: Compare unit 3
3160   *                   @arg HRTIM_COMPAREUNIT_4: Compare unit 4
3161   * @retval Compare value
3162   */
3163 #define __HAL_HRTIM_GETCOMPARE(__HANDLE__, __TIMER__, __COMPAREUNIT__) \
3164       (((__TIMER__) == HRTIM_TIMERINDEX_MASTER) ? \
3165         (((__COMPAREUNIT__) == HRTIM_COMPAREUNIT_1) ? ((__HANDLE__)->Instance->sMasterRegs.MCMP1R) :\
3166          ((__COMPAREUNIT__) == HRTIM_COMPAREUNIT_2) ? ((__HANDLE__)->Instance->sMasterRegs.MCMP2R) :\
3167          ((__COMPAREUNIT__) == HRTIM_COMPAREUNIT_3) ? ((__HANDLE__)->Instance->sMasterRegs.MCMP3R) :\
3168          ((__HANDLE__)->Instance->sMasterRegs.MCMP4R)) \
3169          : \
3170         (((__COMPAREUNIT__) == HRTIM_COMPAREUNIT_1) ? ((__HANDLE__)->Instance->sTimerxRegs[(__TIMER__)].CMP1xR) :\
3171          ((__COMPAREUNIT__) == HRTIM_COMPAREUNIT_2) ? ((__HANDLE__)->Instance->sTimerxRegs[(__TIMER__)].CMP2xR) :\
3172          ((__COMPAREUNIT__) == HRTIM_COMPAREUNIT_3) ? ((__HANDLE__)->Instance->sTimerxRegs[(__TIMER__)].CMP3xR) :\
3173          ((__HANDLE__)->Instance->sTimerxRegs[(__TIMER__)].CMP4xR)))
3174 
3175 /**
3176   * @}
3177   */
3178 
3179 /* Exported functions --------------------------------------------------------*/
3180 /** @addtogroup HRTIM_Exported_Functions
3181 * @{
3182 */
3183 
3184 /** @addtogroup HRTIM_Exported_Functions_Group1
3185 * @{
3186 */
3187 
3188 /* Initialization and Configuration functions  ********************************/
3189 HAL_StatusTypeDef HAL_HRTIM_Init(HRTIM_HandleTypeDef *hhrtim);
3190 
3191 HAL_StatusTypeDef HAL_HRTIM_DeInit (HRTIM_HandleTypeDef *hhrtim);
3192 
3193 void HAL_HRTIM_MspInit(HRTIM_HandleTypeDef *hhrtim);
3194 
3195 void HAL_HRTIM_MspDeInit(HRTIM_HandleTypeDef *hhrtim);
3196 
3197 HAL_StatusTypeDef HAL_HRTIM_TimeBaseConfig(HRTIM_HandleTypeDef *hhrtim,
3198                                            uint32_t TimerIdx,
3199                                            const HRTIM_TimeBaseCfgTypeDef * pTimeBaseCfg);
3200 /**
3201   * @}
3202   */
3203 
3204 /** @addtogroup HRTIM_Exported_Functions_Group2
3205 * @{
3206 */
3207 
3208 /* Simple time base related functions  *****************************************/
3209 HAL_StatusTypeDef HAL_HRTIM_SimpleBaseStart(HRTIM_HandleTypeDef *hhrtim,
3210                                            uint32_t TimerIdx);
3211 
3212 HAL_StatusTypeDef HAL_HRTIM_SimpleBaseStop(HRTIM_HandleTypeDef *hhrtim,
3213                                           uint32_t TimerIdx);
3214 
3215 HAL_StatusTypeDef HAL_HRTIM_SimpleBaseStart_IT(HRTIM_HandleTypeDef *hhrtim,
3216                                               uint32_t TimerIdx);
3217 
3218 HAL_StatusTypeDef HAL_HRTIM_SimpleBaseStop_IT(HRTIM_HandleTypeDef *hhrtim,
3219                                              uint32_t TimerIdx);
3220 
3221 HAL_StatusTypeDef HAL_HRTIM_SimpleBaseStart_DMA(HRTIM_HandleTypeDef *hhrtim,
3222                                                uint32_t TimerIdx,
3223                                                uint32_t SrcAddr,
3224                                                uint32_t DestAddr,
3225                                                uint32_t Length);
3226 
3227 HAL_StatusTypeDef HAL_HRTIM_SimpleBaseStop_DMA(HRTIM_HandleTypeDef *hhrtim,
3228                                               uint32_t TimerIdx);
3229 
3230 /**
3231   * @}
3232   */
3233 
3234 /** @addtogroup HRTIM_Exported_Functions_Group3
3235 * @{
3236 */
3237 /* Simple output compare related functions  ************************************/
3238 HAL_StatusTypeDef HAL_HRTIM_SimpleOCChannelConfig(HRTIM_HandleTypeDef *hhrtim,
3239                                                  uint32_t TimerIdx,
3240                                                  uint32_t OCChannel,
3241                                                  const HRTIM_SimpleOCChannelCfgTypeDef* pSimpleOCChannelCfg);
3242 
3243 HAL_StatusTypeDef HAL_HRTIM_SimpleOCStart(HRTIM_HandleTypeDef *hhrtim,
3244                                          uint32_t TimerIdx,
3245                                          uint32_t OCChannel);
3246 
3247 HAL_StatusTypeDef HAL_HRTIM_SimpleOCStop(HRTIM_HandleTypeDef *hhrtim,
3248                                         uint32_t TimerIdx,
3249                                         uint32_t OCChannel);
3250 
3251 HAL_StatusTypeDef HAL_HRTIM_SimpleOCStart_IT(HRTIM_HandleTypeDef *hhrtim,
3252                                             uint32_t TimerIdx,
3253                                             uint32_t OCChannel);
3254 
3255 HAL_StatusTypeDef HAL_HRTIM_SimpleOCStop_IT(HRTIM_HandleTypeDef *hhrtim,
3256                                            uint32_t TimerIdx,
3257                                            uint32_t OCChannel);
3258 
3259 HAL_StatusTypeDef HAL_HRTIM_SimpleOCStart_DMA(HRTIM_HandleTypeDef *hhrtim,
3260                                              uint32_t TimerIdx,
3261                                              uint32_t OCChannel,
3262                                              uint32_t SrcAddr,
3263                                              uint32_t DestAddr,
3264                                              uint32_t Length);
3265 
3266 HAL_StatusTypeDef HAL_HRTIM_SimpleOCStop_DMA(HRTIM_HandleTypeDef *hhrtim,
3267                                             uint32_t TimerIdx,
3268                                             uint32_t OCChannel);
3269 
3270 /**
3271   * @}
3272   */
3273 
3274 /** @addtogroup HRTIM_Exported_Functions_Group4
3275 * @{
3276 */
3277 /* Simple PWM output related functions  ****************************************/
3278 HAL_StatusTypeDef HAL_HRTIM_SimplePWMChannelConfig(HRTIM_HandleTypeDef *hhrtim,
3279                                                   uint32_t TimerIdx,
3280                                                   uint32_t PWMChannel,
3281                                                   const HRTIM_SimplePWMChannelCfgTypeDef* pSimplePWMChannelCfg);
3282 
3283 HAL_StatusTypeDef HAL_HRTIM_SimplePWMStart(HRTIM_HandleTypeDef *hhrtim,
3284                                           uint32_t TimerIdx,
3285                                           uint32_t PWMChannel);
3286 
3287 HAL_StatusTypeDef HAL_HRTIM_SimplePWMStop(HRTIM_HandleTypeDef *hhrtim,
3288                                          uint32_t TimerIdx,
3289                                          uint32_t PWMChannel);
3290 
3291 HAL_StatusTypeDef HAL_HRTIM_SimplePWMStart_IT(HRTIM_HandleTypeDef *hhrtim,
3292                                              uint32_t TimerIdx,
3293                                              uint32_t PWMChannel);
3294 
3295 HAL_StatusTypeDef HAL_HRTIM_SimplePWMStop_IT(HRTIM_HandleTypeDef *hhrtim,
3296                                             uint32_t TimerIdx,
3297                                             uint32_t PWMChannel);
3298 
3299 HAL_StatusTypeDef HAL_HRTIM_SimplePWMStart_DMA(HRTIM_HandleTypeDef *hhrtim,
3300                                               uint32_t TimerIdx,
3301                                               uint32_t PWMChannel,
3302                                               uint32_t SrcAddr,
3303                                               uint32_t DestAddr,
3304                                               uint32_t Length);
3305 
3306 HAL_StatusTypeDef HAL_HRTIM_SimplePWMStop_DMA(HRTIM_HandleTypeDef *hhrtim,
3307                                              uint32_t TimerIdx,
3308                                              uint32_t PWMChannel);
3309 
3310 /**
3311   * @}
3312   */
3313 
3314 /** @addtogroup HRTIM_Exported_Functions_Group5
3315 * @{
3316 */
3317 /* Simple capture related functions  *******************************************/
3318 HAL_StatusTypeDef HAL_HRTIM_SimpleCaptureChannelConfig(HRTIM_HandleTypeDef *hhrtim,
3319                                                       uint32_t TimerIdx,
3320                                                       uint32_t CaptureChannel,
3321                                                       const HRTIM_SimpleCaptureChannelCfgTypeDef* pSimpleCaptureChannelCfg);
3322 
3323 HAL_StatusTypeDef HAL_HRTIM_SimpleCaptureStart(HRTIM_HandleTypeDef *hhrtim,
3324                                               uint32_t TimerIdx,
3325                                               uint32_t CaptureChannel);
3326 
3327 HAL_StatusTypeDef HAL_HRTIM_SimpleCaptureStop(HRTIM_HandleTypeDef *hhrtim,
3328                                              uint32_t TimerIdx,
3329                                              uint32_t CaptureChannel);
3330 
3331 HAL_StatusTypeDef HAL_HRTIM_SimpleCaptureStart_IT(HRTIM_HandleTypeDef *hhrtim,
3332                                                  uint32_t TimerIdx,
3333                                                  uint32_t CaptureChannel);
3334 
3335 HAL_StatusTypeDef HAL_HRTIM_SimpleCaptureStop_IT(HRTIM_HandleTypeDef *hhrtim,
3336                                                 uint32_t TimerIdx,
3337                                                 uint32_t CaptureChannel);
3338 
3339 HAL_StatusTypeDef HAL_HRTIM_SimpleCaptureStart_DMA(HRTIM_HandleTypeDef *hhrtim,
3340                                                   uint32_t TimerIdx,
3341                                                   uint32_t CaptureChannel,
3342                                                   uint32_t SrcAddr,
3343                                                   uint32_t DestAddr,
3344                                                   uint32_t Length);
3345 
3346 HAL_StatusTypeDef HAL_HRTIM_SimpleCaptureStop_DMA(HRTIM_HandleTypeDef *hhrtim,
3347                                                  uint32_t TimerIdx,
3348                                                  uint32_t CaptureChannel);
3349 
3350 /**
3351   * @}
3352   */
3353 
3354 /** @addtogroup HRTIM_Exported_Functions_Group6
3355 * @{
3356 */
3357 /* Simple one pulse related functions  *****************************************/
3358 HAL_StatusTypeDef HAL_HRTIM_SimpleOnePulseChannelConfig(HRTIM_HandleTypeDef *hhrtim,
3359                                                        uint32_t TimerIdx,
3360                                                        uint32_t OnePulseChannel,
3361                                                        const HRTIM_SimpleOnePulseChannelCfgTypeDef* pSimpleOnePulseChannelCfg);
3362 
3363 HAL_StatusTypeDef HAL_HRTIM_SimpleOnePulseStart(HRTIM_HandleTypeDef *hhrtim,
3364                                                uint32_t TimerIdx,
3365                                                uint32_t OnePulseChannel);
3366 
3367 HAL_StatusTypeDef HAL_HRTIM_SimpleOnePulseStop(HRTIM_HandleTypeDef *hhrtim,
3368                                               uint32_t TimerIdx,
3369                                              uint32_t OnePulseChannel);
3370 
3371 HAL_StatusTypeDef HAL_HRTIM_SimpleOnePulseStart_IT(HRTIM_HandleTypeDef *hhrtim,
3372                                                   uint32_t TimerIdx,
3373                                                   uint32_t OnePulseChannel);
3374 
3375 HAL_StatusTypeDef HAL_HRTIM_SimpleOnePulseStop_IT(HRTIM_HandleTypeDef *hhrtim,
3376                                                  uint32_t TimerIdx,
3377                                                  uint32_t OnePulseChannel);
3378 
3379 /**
3380   * @}
3381   */
3382 
3383 /** @addtogroup HRTIM_Exported_Functions_Group7
3384 * @{
3385 */
3386 HAL_StatusTypeDef HAL_HRTIM_BurstModeConfig(HRTIM_HandleTypeDef *hhrtim,
3387                                             const HRTIM_BurstModeCfgTypeDef* pBurstModeCfg);
3388 
3389 HAL_StatusTypeDef HAL_HRTIM_EventConfig(HRTIM_HandleTypeDef *hhrtim,
3390                                         uint32_t Event,
3391                                         const HRTIM_EventCfgTypeDef* pEventCfg);
3392 
3393 HAL_StatusTypeDef HAL_HRTIM_EventPrescalerConfig(HRTIM_HandleTypeDef *hhrtim,
3394                                                  uint32_t Prescaler);
3395 
3396 HAL_StatusTypeDef HAL_HRTIM_FaultConfig(HRTIM_HandleTypeDef *hhrtim,
3397                                         uint32_t Fault,
3398                                         const HRTIM_FaultCfgTypeDef* pFaultCfg);
3399 
3400 HAL_StatusTypeDef HAL_HRTIM_FaultPrescalerConfig(HRTIM_HandleTypeDef *hhrtim,
3401                                                  uint32_t Prescaler);
3402 
3403 void HAL_HRTIM_FaultModeCtl(HRTIM_HandleTypeDef * hhrtim,
3404                             uint32_t Faults,
3405                             uint32_t Enable);
3406 
3407 HAL_StatusTypeDef HAL_HRTIM_ADCTriggerConfig(HRTIM_HandleTypeDef *hhrtim,
3408                                              uint32_t ADCTrigger,
3409                                              const HRTIM_ADCTriggerCfgTypeDef* pADCTriggerCfg);
3410 
3411 /**
3412   * @}
3413   */
3414 
3415 /** @addtogroup HRTIM_Exported_Functions_Group8
3416 * @{
3417 */
3418 /* Waveform related functions *************************************************/
3419 HAL_StatusTypeDef HAL_HRTIM_WaveformTimerConfig(HRTIM_HandleTypeDef *hhrtim,
3420                                                 uint32_t TimerIdx,
3421                                                 const HRTIM_TimerCfgTypeDef * pTimerCfg);
3422 
3423 HAL_StatusTypeDef HAL_HRTIM_WaveformCompareConfig(HRTIM_HandleTypeDef *hhrtim,
3424                                                   uint32_t TimerIdx,
3425                                                   uint32_t CompareUnit,
3426                                                   const HRTIM_CompareCfgTypeDef* pCompareCfg);
3427 
3428 HAL_StatusTypeDef HAL_HRTIM_WaveformCaptureConfig(HRTIM_HandleTypeDef *hhrtim,
3429                                                   uint32_t TimerIdx,
3430                                                   uint32_t CaptureUnit,
3431                                                   const HRTIM_CaptureCfgTypeDef* pCaptureCfg);
3432 
3433 HAL_StatusTypeDef HAL_HRTIM_WaveformOutputConfig(HRTIM_HandleTypeDef *hhrtim,
3434                                                  uint32_t TimerIdx,
3435                                                  uint32_t Output,
3436                                                  const HRTIM_OutputCfgTypeDef * pOutputCfg);
3437 
3438 HAL_StatusTypeDef HAL_HRTIM_WaveformSetOutputLevel(HRTIM_HandleTypeDef *hhrtim,
3439                                                    uint32_t TimerIdx,
3440                                                    uint32_t Output,
3441                                                    uint32_t OutputLevel);
3442 
3443 HAL_StatusTypeDef HAL_HRTIM_TimerEventFilteringConfig(HRTIM_HandleTypeDef *hhrtim,
3444                                                       uint32_t TimerIdx,
3445                                                       uint32_t Event,
3446                                                       const HRTIM_TimerEventFilteringCfgTypeDef * pTimerEventFilteringCfg);
3447 
3448 HAL_StatusTypeDef HAL_HRTIM_DeadTimeConfig(HRTIM_HandleTypeDef *hhrtim,
3449                                            uint32_t TimerIdx,
3450                                            const HRTIM_DeadTimeCfgTypeDef* pDeadTimeCfg);
3451 
3452 HAL_StatusTypeDef HAL_HRTIM_ChopperModeConfig(HRTIM_HandleTypeDef *hhrtim,
3453                                               uint32_t TimerIdx,
3454                                               const HRTIM_ChopperModeCfgTypeDef* pChopperModeCfg);
3455 
3456 HAL_StatusTypeDef HAL_HRTIM_BurstDMAConfig(HRTIM_HandleTypeDef *hhrtim,
3457                                            uint32_t TimerIdx,
3458                                            uint32_t RegistersToUpdate);
3459 
3460 
3461 HAL_StatusTypeDef HAL_HRTIM_WaveformCountStart(HRTIM_HandleTypeDef *hhrtim,
3462                                                  uint32_t Timers);
3463 
3464 HAL_StatusTypeDef HAL_HRTIM_WaveformCountStop(HRTIM_HandleTypeDef *hhrtim,
3465                                                  uint32_t Timers);
3466 
3467 HAL_StatusTypeDef HAL_HRTIM_WaveformCountStart_IT(HRTIM_HandleTypeDef *hhrtim,
3468                                                  uint32_t Timers);
3469 
3470 HAL_StatusTypeDef HAL_HRTIM_WaveformCountStop_IT(HRTIM_HandleTypeDef *hhrtim,
3471                                                  uint32_t Timers);
3472 
3473 HAL_StatusTypeDef HAL_HRTIM_WaveformCountStart_DMA(HRTIM_HandleTypeDef *hhrtim,
3474                                                      uint32_t Timers);
3475 
3476 HAL_StatusTypeDef HAL_HRTIM_WaveformCountStop_DMA(HRTIM_HandleTypeDef *hhrtim,
3477                                                     uint32_t Timers);
3478 
3479 HAL_StatusTypeDef HAL_HRTIM_WaveformOutputStart(HRTIM_HandleTypeDef *hhrtim,
3480                                                 uint32_t OutputsToStart);
3481 
3482 HAL_StatusTypeDef HAL_HRTIM_WaveformOutputStop(HRTIM_HandleTypeDef *hhrtim,
3483                                                uint32_t OutputsToStop);
3484 
3485 HAL_StatusTypeDef HAL_HRTIM_BurstModeCtl(HRTIM_HandleTypeDef *hhrtim,
3486                                          uint32_t Enable);
3487 
3488 HAL_StatusTypeDef HAL_HRTIM_BurstModeSoftwareTrigger(HRTIM_HandleTypeDef *hhrtim);
3489 
3490 HAL_StatusTypeDef HAL_HRTIM_SoftwareCapture(HRTIM_HandleTypeDef *hhrtim,
3491                                             uint32_t TimerIdx,
3492                                             uint32_t CaptureUnit);
3493 
3494 HAL_StatusTypeDef HAL_HRTIM_SoftwareUpdate(HRTIM_HandleTypeDef *hhrtim,
3495                                            uint32_t Timers);
3496 
3497 HAL_StatusTypeDef HAL_HRTIM_SoftwareReset(HRTIM_HandleTypeDef *hhrtim,
3498                                           uint32_t Timers);
3499 
3500 HAL_StatusTypeDef HAL_HRTIM_BurstDMATransfer(HRTIM_HandleTypeDef *hhrtim,
3501                                              uint32_t TimerIdx,
3502                                              uint32_t BurstBufferAddress,
3503                                              uint32_t BurstBufferLength);
3504 
3505 HAL_StatusTypeDef HAL_HRTIM_UpdateEnable(HRTIM_HandleTypeDef *hhrtim,
3506                                           uint32_t Timers);
3507 
3508 HAL_StatusTypeDef HAL_HRTIM_UpdateDisable(HRTIM_HandleTypeDef *hhrtim,
3509                                           uint32_t Timers);
3510 
3511 /**
3512   * @}
3513   */
3514 
3515 /** @addtogroup HRTIM_Exported_Functions_Group9
3516 * @{
3517 */
3518 /* HRTIM peripheral state functions */
3519 HAL_HRTIM_StateTypeDef HAL_HRTIM_GetState(const HRTIM_HandleTypeDef* hhrtim);
3520 
3521 uint32_t HAL_HRTIM_GetCapturedValue(const HRTIM_HandleTypeDef * hhrtim,
3522                                     uint32_t TimerIdx,
3523                                     uint32_t CaptureUnit);
3524 
3525 uint32_t HAL_HRTIM_WaveformGetOutputLevel(const HRTIM_HandleTypeDef *hhrtim,
3526                                           uint32_t TimerIdx,
3527                                           uint32_t Output);
3528 
3529 uint32_t HAL_HRTIM_WaveformGetOutputState(const HRTIM_HandleTypeDef * hhrtim,
3530                                           uint32_t TimerIdx,
3531                                           uint32_t Output);
3532 
3533 uint32_t HAL_HRTIM_GetDelayedProtectionStatus(const HRTIM_HandleTypeDef *hhrtim,
3534                                               uint32_t TimerIdx,
3535                                               uint32_t Output);
3536 
3537 uint32_t HAL_HRTIM_GetBurstStatus(const HRTIM_HandleTypeDef *hhrtim);
3538 
3539 uint32_t HAL_HRTIM_GetCurrentPushPullStatus(const HRTIM_HandleTypeDef *hhrtim,
3540                                             uint32_t TimerIdx);
3541 
3542 uint32_t HAL_HRTIM_GetIdlePushPullStatus(const HRTIM_HandleTypeDef *hhrtim,
3543                                          uint32_t TimerIdx);
3544 
3545 /**
3546   * @}
3547   */
3548 
3549 /** @addtogroup HRTIM_Exported_Functions_Group10
3550 * @{
3551 */
3552 /* IRQ handler */
3553 void HAL_HRTIM_IRQHandler(HRTIM_HandleTypeDef *hhrtim,
3554                           uint32_t TimerIdx);
3555 
3556 /* HRTIM events related callback functions */
3557 void HAL_HRTIM_Fault1Callback(HRTIM_HandleTypeDef *hhrtim);
3558 void HAL_HRTIM_Fault2Callback(HRTIM_HandleTypeDef *hhrtim);
3559 void HAL_HRTIM_Fault3Callback(HRTIM_HandleTypeDef *hhrtim);
3560 void HAL_HRTIM_Fault4Callback(HRTIM_HandleTypeDef *hhrtim);
3561 void HAL_HRTIM_Fault5Callback(HRTIM_HandleTypeDef *hhrtim);
3562 void HAL_HRTIM_SystemFaultCallback(HRTIM_HandleTypeDef *hhrtim);
3563 void HAL_HRTIM_BurstModePeriodCallback(HRTIM_HandleTypeDef *hhrtim);
3564 void HAL_HRTIM_SynchronizationEventCallback(HRTIM_HandleTypeDef *hhrtim);
3565 
3566 /* Timer events related callback functions */
3567 void HAL_HRTIM_RegistersUpdateCallback(HRTIM_HandleTypeDef *hhrtim,
3568                                               uint32_t TimerIdx);
3569 void HAL_HRTIM_RepetitionEventCallback(HRTIM_HandleTypeDef *hhrtim,
3570                                               uint32_t TimerIdx);
3571 void HAL_HRTIM_Compare1EventCallback(HRTIM_HandleTypeDef *hhrtim,
3572                                             uint32_t TimerIdx);
3573 void HAL_HRTIM_Compare2EventCallback(HRTIM_HandleTypeDef *hhrtim,
3574                                             uint32_t TimerIdx);
3575 void HAL_HRTIM_Compare3EventCallback(HRTIM_HandleTypeDef *hhrtim,
3576                                             uint32_t TimerIdx);
3577 void HAL_HRTIM_Compare4EventCallback(HRTIM_HandleTypeDef *hhrtim,
3578                                             uint32_t TimerIdx);
3579 void HAL_HRTIM_Capture1EventCallback(HRTIM_HandleTypeDef *hhrtim,
3580                                             uint32_t TimerIdx);
3581 void HAL_HRTIM_Capture2EventCallback(HRTIM_HandleTypeDef *hhrtim,
3582                                             uint32_t TimerIdx);
3583 void HAL_HRTIM_DelayedProtectionCallback(HRTIM_HandleTypeDef *hhrtim,
3584                                                 uint32_t TimerIdx);
3585 void HAL_HRTIM_CounterResetCallback(HRTIM_HandleTypeDef *hhrtim,
3586                                            uint32_t TimerIdx);
3587 void HAL_HRTIM_Output1SetCallback(HRTIM_HandleTypeDef *hhrtim,
3588                                          uint32_t TimerIdx);
3589 void HAL_HRTIM_Output1ResetCallback(HRTIM_HandleTypeDef *hhrtim,
3590                                            uint32_t TimerIdx);
3591 void HAL_HRTIM_Output2SetCallback(HRTIM_HandleTypeDef *hhrtim,
3592                                          uint32_t TimerIdx);
3593 void HAL_HRTIM_Output2ResetCallback(HRTIM_HandleTypeDef *hhrtim,
3594                                            uint32_t TimerIdx);
3595 void HAL_HRTIM_BurstDMATransferCallback(HRTIM_HandleTypeDef *hhrtim,
3596                                                uint32_t TimerIdx);
3597 void HAL_HRTIM_ErrorCallback(HRTIM_HandleTypeDef *hhrtim);
3598 
3599 #if (USE_HAL_HRTIM_REGISTER_CALLBACKS == 1)
3600 HAL_StatusTypeDef HAL_HRTIM_RegisterCallback(HRTIM_HandleTypeDef *       hhrtim,
3601                                              HAL_HRTIM_CallbackIDTypeDef CallbackID,
3602                                              pHRTIM_CallbackTypeDef      pCallback);
3603 
3604 HAL_StatusTypeDef HAL_HRTIM_UnRegisterCallback(HRTIM_HandleTypeDef *       hhrtim,
3605                                                HAL_HRTIM_CallbackIDTypeDef CallbackID);
3606 
3607 HAL_StatusTypeDef HAL_HRTIM_TIMxRegisterCallback(HRTIM_HandleTypeDef *        hhrtim,
3608                                                  HAL_HRTIM_CallbackIDTypeDef  CallbackID,
3609                                                  pHRTIM_TIMxCallbackTypeDef   pCallback);
3610 
3611 HAL_StatusTypeDef HAL_HRTIM_TIMxUnRegisterCallback(HRTIM_HandleTypeDef *       hhrtim,
3612                                                    HAL_HRTIM_CallbackIDTypeDef CallbackID);
3613 #endif /* USE_HAL_HRTIM_REGISTER_CALLBACKS */
3614 
3615 /**
3616   * @}
3617   */
3618 
3619 /**
3620   * @}
3621   */
3622 
3623 /**
3624   * @}
3625   */
3626 
3627 /**
3628   * @}
3629   */
3630 
3631 #endif /* HRTIM1 */
3632 
3633 #ifdef __cplusplus
3634 }
3635 #endif
3636 
3637 #endif /* STM32H7xx_HAL_HRTIM_H */
3638