2 ******************************************************************************
3 * @file stm32h7xx_hal_hrtim.h
4 * @author MCD Application Team
5 * @brief Header file of HRTIM HAL module.
6 ******************************************************************************
9 * <h2><center>© Copyright (c) 2017 STMicroelectronics.
10 * All rights reserved.</center></h2>
12 * This software component is licensed by ST under BSD 3-Clause license,
13 * the "License"; You may not use this file except in compliance with the
14 * License. You may obtain a copy of the License at:
15 * opensource.org/licenses/BSD-3-Clause
17 ******************************************************************************
20 /* Define to prevent recursive inclusion -------------------------------------*/
21 #ifndef STM32H7xx_HAL_HRTIM_H
22 #define STM32H7xx_HAL_HRTIM_H
28 /* Includes ------------------------------------------------------------------*/
29 #include "stm32h7xx_hal_def.h"
32 /** @addtogroup STM32H7xx_HAL_Driver
36 /** @addtogroup HRTIM HRTIM
40 /* Exported types ------------------------------------------------------------*/
41 /** @addtogroup HRTIM_Exported_Constants HRTIM Exported Constants
44 /** @defgroup HRTIM_Max_Timer HRTIM Max Timer
47 #define MAX_HRTIM_TIMER 6U
55 /** @defgroup HRTIM_Exported_Types HRTIM Exported Types
60 * @brief HRTIM Configuration Structure definition - Time base related parameters
64 uint32_t HRTIMInterruptResquests
; /*!< Specifies which interrupts requests must enabled for the HRTIM instance.
65 This parameter can be any combination of @ref HRTIM_Common_Interrupt_Enable */
66 uint32_t SyncOptions
; /*!< Specifies how the HRTIM instance handles the external synchronization signals.
67 The HRTIM instance can be configured to act as a slave (waiting for a trigger
68 to be synchronized) or a master (generating a synchronization signal) or both.
69 This parameter can be a combination of @ref HRTIM_Synchronization_Options.*/
70 uint32_t SyncInputSource
; /*!< Specifies the external synchronization input source (significant only when
71 the HRTIM instance is configured as a slave).
72 This parameter can be a value of @ref HRTIM_Synchronization_Input_Source. */
73 uint32_t SyncOutputSource
; /*!< Specifies the source and event to be sent on the external synchronization outputs
74 (significant only when the HRTIM instance is configured as a master).
75 This parameter can be a value of @ref HRTIM_Synchronization_Output_Source */
76 uint32_t SyncOutputPolarity
; /*!< Specifies the conditioning of the event to be sent on the external synchronization
77 outputs (significant only when the HRTIM instance is configured as a master).
78 This parameter can be a value of @ref HRTIM_Synchronization_Output_Polarity */
82 * @brief HAL State structures definition
86 HAL_HRTIM_STATE_RESET
= 0x00U
, /*!< Peripheral is not yet Initialized */
87 HAL_HRTIM_STATE_READY
= 0x01U
, /*!< Peripheral Initialized and ready for use */
88 HAL_HRTIM_STATE_BUSY
= 0x02U
, /*!< an internal process is ongoing */
89 HAL_HRTIM_STATE_TIMEOUT
= 0x06U
, /*!< Timeout state */
90 HAL_HRTIM_STATE_ERROR
= 0x07U
, /*!< Error state */
91 #if (USE_HAL_HRTIM_REGISTER_CALLBACKS == 1)
92 HAL_HRTIM_STATE_INVALID_CALLBACK
= 0x08U
/*!< Invalid Callback error */
93 #endif /* USE_HAL_HRTIM_REGISTER_CALLBACKS */
94 } HAL_HRTIM_StateTypeDef
;
97 * @brief HRTIM Timer Structure definition
101 uint32_t CaptureTrigger1
; /*!< Event(s) triggering capture unit 1.
102 When the timer operates in Simple mode, this parameter can be a value of @ref HRTIM_External_Event_Channels.
103 When the timer operates in Waveform mode, this parameter can be a combination of @ref HRTIM_Capture_Unit_Trigger. */
104 uint32_t CaptureTrigger2
; /*!< Event(s) triggering capture unit 2.
105 When the timer operates in Simple mode, this parameter can be a value of @ref HRTIM_External_Event_Channels.
106 When the timer operates in Waveform mode, this parameter can be a combination of @ref HRTIM_Capture_Unit_Trigger. */
107 uint32_t InterruptRequests
; /*!< Interrupts requests enabled for the timer. */
108 uint32_t DMARequests
; /*!< DMA requests enabled for the timer. */
109 uint32_t DMASrcAddress
; /*!< Address of the source address of the DMA transfer. */
110 uint32_t DMADstAddress
; /*!< Address of the destination address of the DMA transfer. */
111 uint32_t DMASize
; /*!< Size of the DMA transfer */
112 } HRTIM_TimerParamTypeDef
;
115 * @brief HRTIM Handle Structure definition
117 #if (USE_HAL_HRTIM_REGISTER_CALLBACKS == 1)
118 typedef struct __HRTIM_HandleTypeDef
121 #endif /* USE_HAL_HRTIM_REGISTER_CALLBACKS */
123 HRTIM_TypeDef
* Instance
; /*!< Register base address */
125 HRTIM_InitTypeDef Init
; /*!< HRTIM required parameters */
127 HRTIM_TimerParamTypeDef TimerParam
[MAX_HRTIM_TIMER
]; /*!< HRTIM timers - including the master - parameters */
129 HAL_LockTypeDef Lock
; /*!< Locking object */
131 __IO HAL_HRTIM_StateTypeDef State
; /*!< HRTIM communication state */
133 DMA_HandleTypeDef
* hdmaMaster
; /*!< Master timer DMA handle parameters */
134 DMA_HandleTypeDef
* hdmaTimerA
; /*!< Timer A DMA handle parameters */
135 DMA_HandleTypeDef
* hdmaTimerB
; /*!< Timer B DMA handle parameters */
136 DMA_HandleTypeDef
* hdmaTimerC
; /*!< Timer C DMA handle parameters */
137 DMA_HandleTypeDef
* hdmaTimerD
; /*!< Timer D DMA handle parameters */
138 DMA_HandleTypeDef
* hdmaTimerE
; /*!< Timer E DMA handle parameters */
140 #if (USE_HAL_HRTIM_REGISTER_CALLBACKS == 1)
141 void (* Fault1Callback
)(struct __HRTIM_HandleTypeDef
*hhrtim
); /*!< Fault 1 interrupt callback function pointer */
142 void (* Fault2Callback
)(struct __HRTIM_HandleTypeDef
*hhrtim
); /*!< Fault 2 interrupt callback function pointer */
143 void (* Fault3Callback
)(struct __HRTIM_HandleTypeDef
*hhrtim
); /*!< Fault 3 interrupt callback function pointer */
144 void (* Fault4Callback
)(struct __HRTIM_HandleTypeDef
*hhrtim
); /*!< Fault 4 interrupt callback function pointer */
145 void (* Fault5Callback
)(struct __HRTIM_HandleTypeDef
*hhrtim
); /*!< Fault 5 interrupt callback function pointer */
146 void (* SystemFaultCallback
)(struct __HRTIM_HandleTypeDef
*hhrtim
); /*!< System fault interrupt callback function pointer */
147 void (* BurstModePeriodCallback
)(struct __HRTIM_HandleTypeDef
*hhrtim
); /*!< Burst mode period interrupt callback function pointer */
148 void (* SynchronizationEventCallback
)(struct __HRTIM_HandleTypeDef
*hhrtim
); /*!< Sync Input interrupt callback function pointer */
149 void (* ErrorCallback
)(struct __HRTIM_HandleTypeDef
*hhrtim
); /*!< DMA error callback function pointer */
151 void (* RegistersUpdateCallback
)(struct __HRTIM_HandleTypeDef
*hhrtim
, uint32_t TimerIdx
); /*!< Timer x Update interrupt callback function pointer */
152 void (* RepetitionEventCallback
)(struct __HRTIM_HandleTypeDef
*hhrtim
, uint32_t TimerIdx
); /*!< Timer x Repetition interrupt callback function pointer */
153 void (* Compare1EventCallback
)(struct __HRTIM_HandleTypeDef
*hhrtim
, uint32_t TimerIdx
); /*!< Timer x Compare 1 match interrupt callback function pointer */
154 void (* Compare2EventCallback
)(struct __HRTIM_HandleTypeDef
*hhrtim
, uint32_t TimerIdx
); /*!< Timer x Compare 2 match interrupt callback function pointer */
155 void (* Compare3EventCallback
)(struct __HRTIM_HandleTypeDef
*hhrtim
, uint32_t TimerIdx
); /*!< Timer x Compare 3 match interrupt callback function pointer */
156 void (* Compare4EventCallback
)(struct __HRTIM_HandleTypeDef
*hhrtim
, uint32_t TimerIdx
); /*!< Timer x Compare 4 match interrupt callback function pointer */
157 void (* Capture1EventCallback
)(struct __HRTIM_HandleTypeDef
*hhrtim
, uint32_t TimerIdx
); /*!< Timer x Capture 1 interrupts callback function pointer */
158 void (* Capture2EventCallback
)(struct __HRTIM_HandleTypeDef
*hhrtim
, uint32_t TimerIdx
); /*!< Timer x Capture 2 interrupts callback function pointer */
159 void (* DelayedProtectionCallback
)(struct __HRTIM_HandleTypeDef
*hhrtim
, uint32_t TimerIdx
); /*!< Timer x Delayed protection interrupt callback function pointer */
160 void (* CounterResetCallback
)(struct __HRTIM_HandleTypeDef
*hhrtim
, uint32_t TimerIdx
); /*!< Timer x counter reset/roll-over interrupt callback function pointer */
161 void (* Output1SetCallback
)(struct __HRTIM_HandleTypeDef
*hhrtim
, uint32_t TimerIdx
); /*!< Timer x output 1 set interrupt callback function pointer */
162 void (* Output1ResetCallback
)(struct __HRTIM_HandleTypeDef
*hhrtim
, uint32_t TimerIdx
); /*!< Timer x output 1 reset interrupt callback function pointer */
163 void (* Output2SetCallback
)(struct __HRTIM_HandleTypeDef
*hhrtim
, uint32_t TimerIdx
); /*!< Timer x output 2 set interrupt callback function pointer */
164 void (* Output2ResetCallback
)(struct __HRTIM_HandleTypeDef
*hhrtim
, uint32_t TimerIdx
); /*!< Timer x output 2 reset interrupt callback function pointer */
165 void (* BurstDMATransferCallback
)(struct __HRTIM_HandleTypeDef
*hhrtim
, uint32_t TimerIdx
); /*!< Timer x Burst DMA completed interrupt callback function pointer */
167 void (* MspInitCallback
)(struct __HRTIM_HandleTypeDef
*hhrtim
); /*!< HRTIM MspInit callback function pointer */
168 void (* MspDeInitCallback
)(struct __HRTIM_HandleTypeDef
*hhrtim
); /*!< HRTIM MspInit callback function pointer */
169 #endif /* USE_HAL_HRTIM_REGISTER_CALLBACKS */
170 } HRTIM_HandleTypeDef
;
173 * @brief Simple output compare mode configuration definition
177 uint32_t Period
; /*!< Specifies the timer period.
178 The period value must be above 3 periods of the fHRTIM clock.
179 Maximum value is = 0xFFDFU */
180 uint32_t RepetitionCounter
; /*!< Specifies the timer repetition period.
181 This parameter must be a number between Min_Data = 0x00 and Max_Data = 0xFF. */
182 uint32_t PrescalerRatio
; /*!< Specifies the timer clock prescaler ratio.
183 This parameter can be any value of @ref HRTIM_Prescaler_Ratio */
184 uint32_t Mode
; /*!< Specifies the counter operating mode.
185 This parameter can be any value of @ref HRTIM_Counter_Operating_Mode */
186 } HRTIM_TimeBaseCfgTypeDef
;
189 * @brief Simple output compare mode configuration definition
193 uint32_t Mode
; /*!< Specifies the output compare mode (toggle, active, inactive).
194 This parameter can be any value of of @ref HRTIM_Simple_OC_Mode */
195 uint32_t Pulse
; /*!< Specifies the compare value to be loaded into the Compare Register.
196 The compare value must be above or equal to 3 periods of the fHRTIM clock */
197 uint32_t Polarity
; /*!< Specifies the output polarity.
198 This parameter can be any value of @ref HRTIM_Output_Polarity */
199 uint32_t IdleLevel
; /*!< Specifies whether the output level is active or inactive when in IDLE state.
200 This parameter can be any value of @ref HRTIM_Output_IDLE_Level */
201 } HRTIM_SimpleOCChannelCfgTypeDef
;
204 * @brief Simple PWM output mode configuration definition
208 uint32_t Pulse
; /*!< Specifies the compare value to be loaded into the Compare Register.
209 The compare value must be above or equal to 3 periods of the fHRTIM clock */
210 uint32_t Polarity
; /*!< Specifies the output polarity.
211 This parameter can be any value of @ref HRTIM_Output_Polarity */
212 uint32_t IdleLevel
; /*!< Specifies whether the output level is active or inactive when in IDLE state.
213 This parameter can be any value of @ref HRTIM_Output_IDLE_Level */
214 } HRTIM_SimplePWMChannelCfgTypeDef
;
217 * @brief Simple capture mode configuration definition
221 uint32_t Event
; /*!< Specifies the external event triggering the capture.
222 This parameter can be any 'EEVx' value of @ref HRTIM_External_Event_Channels */
223 uint32_t EventPolarity
; /*!< Specifies the polarity of the external event (in case of level sensitivity).
224 This parameter can be a value of @ref HRTIM_External_Event_Polarity */
225 uint32_t EventSensitivity
; /*!< Specifies the sensitivity of the external event.
226 This parameter can be a value of @ref HRTIM_External_Event_Sensitivity */
227 uint32_t EventFilter
; /*!< Defines the frequency used to sample the External Event and the length of the digital filter.
228 This parameter can be a value of @ref HRTIM_External_Event_Filter */
229 } HRTIM_SimpleCaptureChannelCfgTypeDef
;
232 * @brief Simple One Pulse mode configuration definition
236 uint32_t Pulse
; /*!< Specifies the compare value to be loaded into the Compare Register.
237 The compare value must be above or equal to 3 periods of the fHRTIM clock */
238 uint32_t OutputPolarity
; /*!< Specifies the output polarity.
239 This parameter can be any value of @ref HRTIM_Output_Polarity */
240 uint32_t OutputIdleLevel
; /*!< Specifies whether the output level is active or inactive when in IDLE state.
241 This parameter can be any value of @ref HRTIM_Output_IDLE_Level */
242 uint32_t Event
; /*!< Specifies the external event triggering the pulse generation.
243 This parameter can be any 'EEVx' value of @ref HRTIM_External_Event_Channels */
244 uint32_t EventPolarity
; /*!< Specifies the polarity of the external event (in case of level sensitivity).
245 This parameter can be a value of @ref HRTIM_External_Event_Polarity */
246 uint32_t EventSensitivity
; /*!< Specifies the sensitivity of the external event.
247 This parameter can be a value of @ref HRTIM_External_Event_Sensitivity. */
248 uint32_t EventFilter
; /*!< Defines the frequency used to sample the External Event and the length of the digital filter.
249 This parameter can be a value of @ref HRTIM_External_Event_Filter */
250 } HRTIM_SimpleOnePulseChannelCfgTypeDef
;
253 * @brief Timer configuration definition
257 uint32_t InterruptRequests
; /*!< Relevant for all HRTIM timers, including the master.
258 Specifies which interrupts requests must enabled for the timer.
259 This parameter can be any combination of @ref HRTIM_Master_Interrupt_Enable
260 or @ref HRTIM_Timing_Unit_Interrupt_Enable */
261 uint32_t DMARequests
; /*!< Relevant for all HRTIM timers, including the master.
262 Specifies which DMA requests must be enabled for the timer.
263 This parameter can be any combination of @ref HRTIM_Master_DMA_Request_Enable
264 or @ref HRTIM_Timing_Unit_DMA_Request_Enable */
265 uint32_t DMASrcAddress
; /*!< Relevant for all HRTIM timers, including the master.
266 Specifies the address of the source address of the DMA transfer */
267 uint32_t DMADstAddress
; /*!< Relevant for all HRTIM timers, including the master.
268 Specifies the address of the destination address of the DMA transfer */
269 uint32_t DMASize
; /*!< Relevant for all HRTIM timers, including the master.
270 Specifies the size of the DMA transfer */
271 uint32_t HalfModeEnable
; /*!< Relevant for all HRTIM timers, including the master.
272 Specifies whether or not half mode is enabled
273 This parameter can be any value of @ref HRTIM_Half_Mode_Enable */
274 uint32_t StartOnSync
; /*!< Relevant for all HRTIM timers, including the master.
275 Specifies whether or not timer is reset by a rising edge on the synchronization input (when enabled).
276 This parameter can be any value of @ref HRTIM_Start_On_Sync_Input_Event */
277 uint32_t ResetOnSync
; /*!< Relevant for all HRTIM timers, including the master.
278 Specifies whether or not timer is reset by a rising edge on the synchronization input (when enabled).
279 This parameter can be any value of @ref HRTIM_Reset_On_Sync_Input_Event */
280 uint32_t DACSynchro
; /*!< Relevant for all HRTIM timers, including the master.
281 Indicates whether or not the a DAC synchronization event is generated.
282 This parameter can be any value of @ref HRTIM_DAC_Synchronization */
283 uint32_t PreloadEnable
; /*!< Relevant for all HRTIM timers, including the master.
284 Specifies whether or not register preload is enabled.
285 This parameter can be any value of @ref HRTIM_Register_Preload_Enable */
286 uint32_t UpdateGating
; /*!< Relevant for all HRTIM timers, including the master.
287 Specifies how the update occurs with respect to a burst DMA transaction or
288 update enable inputs (Slave timers only).
289 This parameter can be any value of @ref HRTIM_Update_Gating */
290 uint32_t BurstMode
; /*!< Relevant for all HRTIM timers, including the master.
291 Specifies how the timer behaves during a burst mode operation.
292 This parameter can be any value of @ref HRTIM_Timer_Burst_Mode */
293 uint32_t RepetitionUpdate
; /*!< Relevant for all HRTIM timers, including the master.
294 Specifies whether or not registers update is triggered by the repetition event.
295 This parameter can be any value of @ref HRTIM_Timer_Repetition_Update */
296 uint32_t PushPull
; /*!< Relevant for Timer A to Timer E.
297 Specifies whether or not the push-pull mode is enabled.
298 This parameter can be any value of @ref HRTIM_Timer_Push_Pull_Mode */
299 uint32_t FaultEnable
; /*!< Relevant for Timer A to Timer E.
300 Specifies which fault channels are enabled for the timer.
301 This parameter can be a combination of @ref HRTIM_Timer_Fault_Enabling */
302 uint32_t FaultLock
; /*!< Relevant for Timer A to Timer E.
303 Specifies whether or not fault enabling status is write protected.
304 This parameter can be a value of @ref HRTIM_Timer_Fault_Lock */
305 uint32_t DeadTimeInsertion
; /*!< Relevant for Timer A to Timer E.
306 Specifies whether or not dead-time insertion is enabled for the timer.
307 This parameter can be a value of @ref HRTIM_Timer_Deadtime_Insertion */
308 uint32_t DelayedProtectionMode
; /*!< Relevant for Timer A to Timer E.
309 Specifies the delayed protection mode.
310 This parameter can be a value of @ref HRTIM_Timer_Delayed_Protection_Mode */
311 uint32_t UpdateTrigger
; /*!< Relevant for Timer A to Timer E.
312 Specifies source(s) triggering the timer registers update.
313 This parameter can be a combination of @ref HRTIM_Timer_Update_Trigger */
314 uint32_t ResetTrigger
; /*!< Relevant for Timer A to Timer E.
315 Specifies source(s) triggering the timer counter reset.
316 This parameter can be a combination of @ref HRTIM_Timer_Reset_Trigger */
317 uint32_t ResetUpdate
; /*!< Relevant for Timer A to Timer E.
318 Specifies whether or not registers update is triggered when the timer counter is reset.
319 This parameter can be a value of @ref HRTIM_Timer_Reset_Update */
320 } HRTIM_TimerCfgTypeDef
;
323 * @brief Compare unit configuration definition
327 uint32_t CompareValue
; /*!< Specifies the compare value of the timer compare unit.
328 The minimum value must be greater than or equal to 3 periods of the fHRTIM clock.
329 The maximum value must be less than or equal to 0xFFFFU - 1 periods of the fHRTIM clock */
330 uint32_t AutoDelayedMode
; /*!< Specifies the auto delayed mode for compare unit 2 or 4.
331 This parameter can be a value of @ref HRTIM_Compare_Unit_Auto_Delayed_Mode */
332 uint32_t AutoDelayedTimeout
; /*!< Specifies compare value for timing unit 1 or 3 when auto delayed mode with time out is selected.
333 CompareValue + AutoDelayedTimeout must be less than 0xFFFFU */
334 } HRTIM_CompareCfgTypeDef
;
337 * @brief Capture unit configuration definition
341 uint32_t Trigger
; /*!< Specifies source(s) triggering the capture.
342 This parameter can be a combination of @ref HRTIM_Capture_Unit_Trigger */
343 } HRTIM_CaptureCfgTypeDef
;
346 * @brief Output configuration definition
350 uint32_t Polarity
; /*!< Specifies the output polarity.
351 This parameter can be any value of @ref HRTIM_Output_Polarity */
352 uint32_t SetSource
; /*!< Specifies the event(s) transitioning the output from its inactive level to its active level.
353 This parameter can be a combination of @ref HRTIM_Output_Set_Source */
354 uint32_t ResetSource
; /*!< Specifies the event(s) transitioning the output from its active level to its inactive level.
355 This parameter can be a combination of @ref HRTIM_Output_Reset_Source */
356 uint32_t IdleMode
; /*!< Specifies whether or not the output is affected by a burst mode operation.
357 This parameter can be any value of @ref HRTIM_Output_Idle_Mode */
358 uint32_t IdleLevel
; /*!< Specifies whether the output level is active or inactive when in IDLE state.
359 This parameter can be any value of @ref HRTIM_Output_IDLE_Level */
360 uint32_t FaultLevel
; /*!< Specifies whether the output level is active or inactive when in FAULT state.
361 This parameter can be any value of @ref HRTIM_Output_FAULT_Level */
362 uint32_t ChopperModeEnable
; /*!< Indicates whether or not the chopper mode is enabled
363 This parameter can be any value of @ref HRTIM_Output_Chopper_Mode_Enable */
364 uint32_t BurstModeEntryDelayed
; /*!< Indicates whether or not dead-time is inserted when entering the IDLE state during a burst mode operation.
365 This parameters can be any value of @ref HRTIM_Output_Burst_Mode_Entry_Delayed */
366 } HRTIM_OutputCfgTypeDef
;
369 * @brief External event filtering in timing units configuration definition
373 uint32_t Filter
; /*!< Specifies the type of event filtering within the timing unit.
374 This parameter can be a value of @ref HRTIM_Timer_External_Event_Filter */
375 uint32_t Latch
; /*!< Specifies whether or not the signal is latched.
376 This parameter can be a value of @ref HRTIM_Timer_External_Event_Latch */
377 } HRTIM_TimerEventFilteringCfgTypeDef
;
380 * @brief Dead time feature configuration definition
384 uint32_t Prescaler
; /*!< Specifies the dead-time prescaler.
385 This parameter can be a value of @ref HRTIM_Deadtime_Prescaler_Ratio */
386 uint32_t RisingValue
; /*!< Specifies the dead-time following a rising edge.
387 This parameter can be a number between 0x0 and 0x1FFU */
388 uint32_t RisingSign
; /*!< Specifies whether the dead-time is positive or negative on rising edge.
389 This parameter can be a value of @ref HRTIM_Deadtime_Rising_Sign */
390 uint32_t RisingLock
; /*!< Specifies whether or not dead-time rising settings (value and sign) are write protected.
391 This parameter can be a value of @ref HRTIM_Deadtime_Rising_Lock */
392 uint32_t RisingSignLock
; /*!< Specifies whether or not dead-time rising sign is write protected.
393 This parameter can be a value of @ref HRTIM_Deadtime_Rising_Sign_Lock */
394 uint32_t FallingValue
; /*!< Specifies the dead-time following a falling edge.
395 This parameter can be a number between 0x0 and 0x1FFU */
396 uint32_t FallingSign
; /*!< Specifies whether the dead-time is positive or negative on falling edge.
397 This parameter can be a value of @ref HRTIM_Deadtime_Falling_Sign */
398 uint32_t FallingLock
; /*!< Specifies whether or not dead-time falling settings (value and sign) are write protected.
399 This parameter can be a value of @ref HRTIM_Deadtime_Falling_Lock */
400 uint32_t FallingSignLock
; /*!< Specifies whether or not dead-time falling sign is write protected.
401 This parameter can be a value of @ref HRTIM_Deadtime_Falling_Sign_Lock */
402 } HRTIM_DeadTimeCfgTypeDef
;
405 * @brief Chopper mode configuration definition
409 uint32_t CarrierFreq
; /*!< Specifies the Timer carrier frequency value.
410 This parameter can be a value of @ref HRTIM_Chopper_Frequency */
411 uint32_t DutyCycle
; /*!< Specifies the Timer chopper duty cycle value.
412 This parameter can be a value of @ref HRTIM_Chopper_Duty_Cycle */
413 uint32_t StartPulse
; /*!< Specifies the Timer pulse width value.
414 This parameter can be a value of @ref HRTIM_Chopper_Start_Pulse_Width */
415 } HRTIM_ChopperModeCfgTypeDef
;
418 * @brief External event channel configuration definition
422 uint32_t Source
; /*!< Identifies the source of the external event.
423 This parameter can be a value of @ref HRTIM_External_Event_Sources */
424 uint32_t Polarity
; /*!< Specifies the polarity of the external event (in case of level sensitivity).
425 This parameter can be a value of @ref HRTIM_External_Event_Polarity */
426 uint32_t Sensitivity
; /*!< Specifies the sensitivity of the external event.
427 This parameter can be a value of @ref HRTIM_External_Event_Sensitivity */
428 uint32_t Filter
; /*!< Defines the frequency used to sample the External Event and the length of the digital filter.
429 This parameter can be a value of @ref HRTIM_External_Event_Filter */
430 uint32_t FastMode
; /*!< Indicates whether or not low latency mode is enabled for the external event.
431 This parameter can be a value of @ref HRTIM_External_Event_Fast_Mode */
432 } HRTIM_EventCfgTypeDef
;
435 * @brief Fault channel configuration definition
439 uint32_t Source
; /*!< Identifies the source of the fault.
440 This parameter can be a value of @ref HRTIM_Fault_Sources */
441 uint32_t Polarity
; /*!< Specifies the polarity of the fault event.
442 This parameter can be a value of @ref HRTIM_Fault_Polarity */
443 uint32_t Filter
; /*!< Defines the frequency used to sample the Fault input and the length of the digital filter.
444 This parameter can be a value of @ref HRTIM_Fault_Filter */
445 uint32_t Lock
; /*!< Indicates whether or not fault programming bits are write protected.
446 This parameter can be a value of @ref HRTIM_Fault_Lock */
447 } HRTIM_FaultCfgTypeDef
;
450 * @brief Burst mode configuration definition
454 uint32_t Mode
; /*!< Specifies the burst mode operating mode.
455 This parameter can be a value of @ref HRTIM_Burst_Mode_Operating_Mode */
456 uint32_t ClockSource
; /*!< Specifies the burst mode clock source.
457 This parameter can be a value of @ref HRTIM_Burst_Mode_Clock_Source */
458 uint32_t Prescaler
; /*!< Specifies the burst mode prescaler.
459 This parameter can be a value of @ref HRTIM_Burst_Mode_Prescaler */
460 uint32_t PreloadEnable
; /*!< Specifies whether or not preload is enabled for burst mode related registers (HRTIM_BMCMPR and HRTIM_BMPER).
461 This parameter can be a combination of @ref HRTIM_Burst_Mode_Register_Preload_Enable */
462 uint32_t Trigger
; /*!< Specifies the event(s) triggering the burst operation.
463 This parameter can be a combination of @ref HRTIM_Burst_Mode_Trigger */
464 uint32_t IdleDuration
; /*!< Specifies number of periods during which the selected timers are in idle state.
465 This parameter can be a number between 0x0 and 0xFFFF */
466 uint32_t Period
; /*!< Specifies burst mode repetition period.
467 This parameter can be a number between 0x1 and 0xFFFF */
468 } HRTIM_BurstModeCfgTypeDef
;
471 * @brief ADC trigger configuration definition
475 uint32_t UpdateSource
; /*!< Specifies the ADC trigger update source.
476 This parameter can be a value of @ref HRTIM_ADC_Trigger_Update_Source */
477 uint32_t Trigger
; /*!< Specifies the event(s) triggering the ADC conversion.
478 This parameter can be a combination of @ref HRTIM_ADC_Trigger_Event */
479 } HRTIM_ADCTriggerCfgTypeDef
;
481 #if (USE_HAL_HRTIM_REGISTER_CALLBACKS == 1)
483 * @brief HAL HRTIM Callback ID enumeration definition
486 HAL_HRTIM_FAULT1CALLBACK_CB_ID
= 0x00U
, /*!< Fault 1 interrupt callback ID */
487 HAL_HRTIM_FAULT2CALLBACK_CB_ID
= 0x01U
, /*!< Fault 2 interrupt callback ID */
488 HAL_HRTIM_FAULT3CALLBACK_CB_ID
= 0x02U
, /*!< Fault 3 interrupt callback ID */
489 HAL_HRTIM_FAULT4CALLBACK_CB_ID
= 0x03U
, /*!< Fault 4 interrupt callback ID */
490 HAL_HRTIM_FAULT5CALLBACK_CB_ID
= 0x04U
, /*!< Fault 5 interrupt callback ID */
491 HAL_HRTIM_SYSTEMFAULTCALLBACK_CB_ID
= 0x05U
, /*!< System fault interrupt callback ID */
492 HAL_HRTIM_BURSTMODEPERIODCALLBACK_CB_ID
= 0x07U
, /*!< Burst mode period interrupt callback ID */
493 HAL_HRTIM_SYNCHRONIZATIONEVENTCALLBACK_CB_ID
= 0x08U
, /*!< Sync Input interrupt callback ID */
494 HAL_HRTIM_ERRORCALLBACK_CB_ID
= 0x09U
, /*!< DMA error callback ID */
496 HAL_HRTIM_REGISTERSUPDATECALLBACK_CB_ID
= 0x10U
, /*!< Timer x Update interrupt callback ID */
497 HAL_HRTIM_REPETITIONEVENTCALLBACK_CB_ID
= 0x11U
, /*!< Timer x Repetition interrupt callback ID */
498 HAL_HRTIM_COMPARE1EVENTCALLBACK_CB_ID
= 0x12U
, /*!< Timer x Compare 1 match interrupt callback ID */
499 HAL_HRTIM_COMPARE2EVENTCALLBACK_CB_ID
= 0x13U
, /*!< Timer x Compare 2 match interrupt callback ID */
500 HAL_HRTIM_COMPARE3EVENTCALLBACK_CB_ID
= 0x14U
, /*!< Timer x Compare 3 match interrupt callback ID */
501 HAL_HRTIM_COMPARE4EVENTCALLBACK_CB_ID
= 0x15U
, /*!< Timer x Compare 4 match interrupt callback ID */
502 HAL_HRTIM_CAPTURE1EVENTCALLBACK_CB_ID
= 0x16U
, /*!< Timer x Capture 1 interrupts callback ID */
503 HAL_HRTIM_CAPTURE2EVENTCALLBACK_CB_ID
= 0x17U
, /*!< Timer x Capture 2 interrupts callback ID */
504 HAL_HRTIM_DELAYEDPROTECTIONCALLBACK_CB_ID
= 0x18U
, /*!< Timer x Delayed protection interrupt callback ID */
505 HAL_HRTIM_COUNTERRESETCALLBACK_CB_ID
= 0x19U
, /*!< Timer x counter reset/roll-over interrupt callback ID */
506 HAL_HRTIM_OUTPUT1SETCALLBACK_CB_ID
= 0x1AU
, /*!< Timer x output 1 set interrupt callback ID */
507 HAL_HRTIM_OUTPUT1RESETCALLBACK_CB_ID
= 0x1BU
, /*!< Timer x output 1 reset interrupt callback ID */
508 HAL_HRTIM_OUTPUT2SETCALLBACK_CB_ID
= 0x1CU
, /*!< Timer x output 2 set interrupt callback ID */
509 HAL_HRTIM_OUTPUT2RESETCALLBACK_CB_ID
= 0x1DU
, /*!< Timer x output 2 reset interrupt callback ID */
510 HAL_HRTIM_BURSTDMATRANSFERCALLBACK_CB_ID
= 0x1EU
, /*!< Timer x Burst DMA completed interrupt callback ID */
512 HAL_HRTIM_MSPINIT_CB_ID
= 0x20U
, /*!< HRTIM MspInit callback ID */
513 HAL_HRTIM_MSPDEINIT_CB_ID
= 0x21U
, /*!< HRTIM MspInit callback ID */
514 }HAL_HRTIM_CallbackIDTypeDef
;
517 * @brief HAL HRTIM Callback function pointer definitions
519 typedef void (* pHRTIM_CallbackTypeDef
)(HRTIM_HandleTypeDef
*hhrtim
); /*!< HRTIM related callback function pointer */
521 typedef void (* pHRTIM_TIMxCallbackTypeDef
)(HRTIM_HandleTypeDef
*hhrtim
, /*!< HRTIM Timer x related callback function pointer */
523 #endif /* USE_HAL_HRTIM_REGISTER_CALLBACKS */
529 /* Exported constants --------------------------------------------------------*/
530 /** @defgroup HRTIM_Exported_Constants HRTIM Exported Constants
534 /** @defgroup HRTIM_Timer_Index HRTIM Timer Index
536 * @brief Constants defining the timer indexes
538 #define HRTIM_TIMERINDEX_TIMER_A 0x0U /*!< Index used to access timer A registers */
539 #define HRTIM_TIMERINDEX_TIMER_B 0x1U /*!< Index used to access timer B registers */
540 #define HRTIM_TIMERINDEX_TIMER_C 0x2U /*!< Index used to access timer C registers */
541 #define HRTIM_TIMERINDEX_TIMER_D 0x3U /*!< Index used to access timer D registers */
542 #define HRTIM_TIMERINDEX_TIMER_E 0x4U /*!< Index used to access timer E registers */
543 #define HRTIM_TIMERINDEX_MASTER 0x5U /*!< Index used to access master registers */
544 #define HRTIM_TIMERINDEX_COMMON 0xFFU /*!< Index used to access HRTIM common registers */
549 /** @defgroup HRTIM_Timer_identifier HRTIM Timer identifier
551 * @brief Constants defining timer identifiers
553 #define HRTIM_TIMERID_MASTER (HRTIM_MCR_MCEN) /*!< Master identifier */
554 #define HRTIM_TIMERID_TIMER_A (HRTIM_MCR_TACEN) /*!< Timer A identifier */
555 #define HRTIM_TIMERID_TIMER_B (HRTIM_MCR_TBCEN) /*!< Timer B identifier */
556 #define HRTIM_TIMERID_TIMER_C (HRTIM_MCR_TCCEN) /*!< Timer C identifier */
557 #define HRTIM_TIMERID_TIMER_D (HRTIM_MCR_TDCEN) /*!< Timer D identifier */
558 #define HRTIM_TIMERID_TIMER_E (HRTIM_MCR_TECEN) /*!< Timer E identifier */
563 /** @defgroup HRTIM_Compare_Unit HRTIM Compare Unit
565 * @brief Constants defining compare unit identifiers
567 #define HRTIM_COMPAREUNIT_1 0x00000001U /*!< Compare unit 1 identifier */
568 #define HRTIM_COMPAREUNIT_2 0x00000002U /*!< Compare unit 2 identifier */
569 #define HRTIM_COMPAREUNIT_3 0x00000004U /*!< Compare unit 3 identifier */
570 #define HRTIM_COMPAREUNIT_4 0x00000008U /*!< Compare unit 4 identifier */
575 /** @defgroup HRTIM_Capture_Unit HRTIM Capture Unit
577 * @brief Constants defining capture unit identifiers
579 #define HRTIM_CAPTUREUNIT_1 0x00000001U /*!< Capture unit 1 identifier */
580 #define HRTIM_CAPTUREUNIT_2 0x00000002U /*!< Capture unit 2 identifier */
585 /** @defgroup HRTIM_Timer_Output HRTIM Timer Output
587 * @brief Constants defining timer output identifiers
589 #define HRTIM_OUTPUT_TA1 0x00000001U /*!< Timer A - Output 1 identifier */
590 #define HRTIM_OUTPUT_TA2 0x00000002U /*!< Timer A - Output 2 identifier */
591 #define HRTIM_OUTPUT_TB1 0x00000004U /*!< Timer B - Output 1 identifier */
592 #define HRTIM_OUTPUT_TB2 0x00000008U /*!< Timer B - Output 2 identifier */
593 #define HRTIM_OUTPUT_TC1 0x00000010U /*!< Timer C - Output 1 identifier */
594 #define HRTIM_OUTPUT_TC2 0x00000020U /*!< Timer C - Output 2 identifier */
595 #define HRTIM_OUTPUT_TD1 0x00000040U /*!< Timer D - Output 1 identifier */
596 #define HRTIM_OUTPUT_TD2 0x00000080U /*!< Timer D - Output 2 identifier */
597 #define HRTIM_OUTPUT_TE1 0x00000100U /*!< Timer E - Output 1 identifier */
598 #define HRTIM_OUTPUT_TE2 0x00000200U /*!< Timer E - Output 2 identifier */
603 /** @defgroup HRTIM_ADC_Trigger HRTIM ADC Trigger
605 * @brief Constants defining ADC triggers identifiers
607 #define HRTIM_ADCTRIGGER_1 0x00000001U /*!< ADC trigger 1 identifier */
608 #define HRTIM_ADCTRIGGER_2 0x00000002U /*!< ADC trigger 2 identifier */
609 #define HRTIM_ADCTRIGGER_3 0x00000004U /*!< ADC trigger 3 identifier */
610 #define HRTIM_ADCTRIGGER_4 0x00000008U /*!< ADC trigger 4 identifier */
612 #define IS_HRTIM_ADCTRIGGER(ADCTRIGGER)\
613 (((ADCTRIGGER) == HRTIM_ADCTRIGGER_1) || \
614 ((ADCTRIGGER) == HRTIM_ADCTRIGGER_2) || \
615 ((ADCTRIGGER) == HRTIM_ADCTRIGGER_3) || \
616 ((ADCTRIGGER) == HRTIM_ADCTRIGGER_4))
620 /** @defgroup HRTIM_External_Event_Channels HRTIM External Event Channels
622 * @brief Constants defining external event channel identifiers
624 #define HRTIM_EVENT_NONE (0x00000000U) /*!< Undefined event channel */
625 #define HRTIM_EVENT_1 (0x00000001U) /*!< External event channel 1 identifier */
626 #define HRTIM_EVENT_2 (0x00000002U) /*!< External event channel 2 identifier */
627 #define HRTIM_EVENT_3 (0x00000003U) /*!< External event channel 3 identifier */
628 #define HRTIM_EVENT_4 (0x00000004U) /*!< External event channel 4 identifier */
629 #define HRTIM_EVENT_5 (0x00000005U) /*!< External event channel 5 identifier */
630 #define HRTIM_EVENT_6 (0x00000006U) /*!< External event channel 6 identifier */
631 #define HRTIM_EVENT_7 (0x00000007U) /*!< External event channel 7 identifier */
632 #define HRTIM_EVENT_8 (0x00000008U) /*!< External event channel 8 identifier */
633 #define HRTIM_EVENT_9 (0x00000009U) /*!< External event channel 9 identifier */
634 #define HRTIM_EVENT_10 (0x0000000AU) /*!< External event channel 10 identifier */
639 /** @defgroup HRTIM_Fault_Channel HRTIM Fault Channel
641 * @brief Constants defining fault channel identifiers
643 #define HRTIM_FAULT_1 (0x01U) /*!< Fault channel 1 identifier */
644 #define HRTIM_FAULT_2 (0x02U) /*!< Fault channel 2 identifier */
645 #define HRTIM_FAULT_3 (0x04U) /*!< Fault channel 3 identifier */
646 #define HRTIM_FAULT_4 (0x08U) /*!< Fault channel 4 identifier */
647 #define HRTIM_FAULT_5 (0x10U) /*!< Fault channel 5 identifier */
653 /** @defgroup HRTIM_Prescaler_Ratio HRTIM Prescaler Ratio
655 * @brief Constants defining timer high-resolution clock prescaler ratio.
657 #define HRTIM_PRESCALERRATIO_DIV1 (0x00000005U) /*!< fHRCK: fHRTIM = 144 MHz - Resolution: 6.95 ns - Min PWM frequency: 2.2 kHz (fHRTIM=144MHz) */
658 #define HRTIM_PRESCALERRATIO_DIV2 (0x00000006U) /*!< fHRCK: fHRTIM / 2U = 72 MHz - Resolution: 13.88 ns- Min PWM frequency: 1.1 kHz (fHRTIM=144MHz) */
659 #define HRTIM_PRESCALERRATIO_DIV4 (0x00000007U) /*!< fHRCK: fHRTIM / 4U = 36 MHz - Resolution: 27.7 ns- Min PWM frequency: 550Hz (fHRTIM=144MHz) */
664 /** @defgroup HRTIM_Counter_Operating_Mode HRTIM Counter Operating Mode
666 * @brief Constants defining timer counter operating mode.
668 #define HRTIM_MODE_CONTINUOUS (0x00000008U) /*!< The timer operates in continuous (free-running) mode */
669 #define HRTIM_MODE_SINGLESHOT (0x00000000U) /*!< The timer operates in non retriggerable single-shot mode */
670 #define HRTIM_MODE_SINGLESHOT_RETRIGGERABLE (0x00000010U) /*!< The timer operates in retriggerable single-shot mode */
675 /** @defgroup HRTIM_Half_Mode_Enable HRTIM Half Mode Enable
677 * @brief Constants defining half mode enabling status.
679 #define HRTIM_HALFMODE_DISABLED (0x00000000U) /*!< Half mode is disabled */
680 #define HRTIM_HALFMODE_ENABLED (0x00000020U) /*!< Half mode is enabled */
685 /** @defgroup HRTIM_Start_On_Sync_Input_Event HRTIM Start On Sync Input Event
687 * @brief Constants defining the timer behavior following the synchronization event
689 #define HRTIM_SYNCSTART_DISABLED (0x00000000U) /*!< Synchronization input event has effect on the timer */
690 #define HRTIM_SYNCSTART_ENABLED (HRTIM_MCR_SYNCSTRTM) /*!< Synchronization input event starts the timer */
695 /** @defgroup HRTIM_Reset_On_Sync_Input_Event HRTIM Reset On Sync Input Event
697 * @brief Constants defining the timer behavior following the synchronization event
699 #define HRTIM_SYNCRESET_DISABLED (0x00000000U) /*!< Synchronization input event has effect on the timer */
700 #define HRTIM_SYNCRESET_ENABLED (HRTIM_MCR_SYNCRSTM) /*!< Synchronization input event resets the timer */
705 /** @defgroup HRTIM_DAC_Synchronization HRTIM DAC Synchronization
707 * @brief Constants defining on which output the DAC synchronization event is sent
709 #define HRTIM_DACSYNC_NONE 0x00000000U /*!< No DAC synchronization event generated */
710 #define HRTIM_DACSYNC_DACTRIGOUT_1 (HRTIM_MCR_DACSYNC_0) /*!< DAC synchronization event generated on DACTrigOut1 output upon timer update */
711 #define HRTIM_DACSYNC_DACTRIGOUT_2 (HRTIM_MCR_DACSYNC_1) /*!< DAC synchronization event generated on DACTrigOut2 output upon timer update */
712 #define HRTIM_DACSYNC_DACTRIGOUT_3 (HRTIM_MCR_DACSYNC_1 | HRTIM_MCR_DACSYNC_0) /*!< DAC update generated on DACTrigOut3 output upon timer update */
717 /** @defgroup HRTIM_Register_Preload_Enable HRTIM Register Preload Enable
719 * @brief Constants defining whether a write access into a preloadable
720 * register is done into the active or the preload register.
722 #define HRTIM_PRELOAD_DISABLED (0x00000000U) /*!< Preload disabled: the write access is directly done into the active register */
723 #define HRTIM_PRELOAD_ENABLED (HRTIM_MCR_PREEN) /*!< Preload enabled: the write access is done into the preload register */
728 /** @defgroup HRTIM_Update_Gating HRTIM Update Gating
730 * @brief Constants defining how the update occurs relatively to the burst DMA
731 * transaction and the external update request on update enable inputs 1 to 3.
733 #define HRTIM_UPDATEGATING_INDEPENDENT 0x00000000U /*!< Update done independently from the DMA burst transfer completion */
734 #define HRTIM_UPDATEGATING_DMABURST (HRTIM_TIMCR_UPDGAT_0) /*!< Update done when the DMA burst transfer is completed */
735 #define HRTIM_UPDATEGATING_DMABURST_UPDATE (HRTIM_TIMCR_UPDGAT_1) /*!< Update done on timer roll-over following a DMA burst transfer completion*/
736 #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 */
737 #define HRTIM_UPDATEGATING_UPDEN2 (HRTIM_TIMCR_UPDGAT_2) /*!< Slave timer only - Update done on a rising edge of HRTIM update enable input 2U */
738 #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 */
739 #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 */
740 #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 */
741 #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 */
746 /** @defgroup HRTIM_Timer_Burst_Mode HRTIM Timer Burst Mode
748 * @brief Constants defining how the timer behaves during a burst
751 #define HRTIM_TIMERBURSTMODE_MAINTAINCLOCK 0x00000000U /*!< Timer counter clock is maintained and the timer operates normally */
752 #define HRTIM_TIMERBURSTMODE_RESETCOUNTER (HRTIM_BMCR_MTBM) /*!< Timer counter clock is stopped and the counter is reset */
757 /** @defgroup HRTIM_Timer_Repetition_Update HRTIM Timer Repetition Update
759 * @brief Constants defining whether registers are updated when the timer
760 * repetition period is completed (either due to roll-over or
763 #define HRTIM_UPDATEONREPETITION_DISABLED 0x00000000U /*!< Update on repetition disabled */
764 #define HRTIM_UPDATEONREPETITION_ENABLED (HRTIM_MCR_MREPU) /*!< Update on repetition enabled */
770 /** @defgroup HRTIM_Timer_Push_Pull_Mode HRTIM Timer Push Pull Mode
772 * @brief Constants defining whether or not the push-pull mode is enabled for
775 #define HRTIM_TIMPUSHPULLMODE_DISABLED 0x00000000U /*!< Push-Pull mode disabled */
776 #define HRTIM_TIMPUSHPULLMODE_ENABLED (HRTIM_TIMCR_PSHPLL) /*!< Push-Pull mode enabled */
781 /** @defgroup HRTIM_Timer_Fault_Enabling HRTIM Timer Fault Enabling
783 * @brief Constants defining whether a fault channel is enabled for a timer
785 #define HRTIM_TIMFAULTENABLE_NONE 0x00000000U /*!< No fault enabled */
786 #define HRTIM_TIMFAULTENABLE_FAULT1 (HRTIM_FLTR_FLT1EN) /*!< Fault 1 enabled */
787 #define HRTIM_TIMFAULTENABLE_FAULT2 (HRTIM_FLTR_FLT2EN) /*!< Fault 2 enabled */
788 #define HRTIM_TIMFAULTENABLE_FAULT3 (HRTIM_FLTR_FLT3EN) /*!< Fault 3 enabled */
789 #define HRTIM_TIMFAULTENABLE_FAULT4 (HRTIM_FLTR_FLT4EN) /*!< Fault 4 enabled */
790 #define HRTIM_TIMFAULTENABLE_FAULT5 (HRTIM_FLTR_FLT5EN) /*!< Fault 5 enabled */
795 /** @defgroup HRTIM_Timer_Fault_Lock HRTIM Timer Fault Lock
797 * @brief Constants defining whether or not fault enabling bits are write
798 * protected for a timer
800 #define HRTIM_TIMFAULTLOCK_READWRITE (0x00000000U) /*!< Timer fault enabling bits are read/write */
801 #define HRTIM_TIMFAULTLOCK_READONLY (HRTIM_FLTR_FLTLCK) /*!< Timer fault enabling bits are read only */
806 /** @defgroup HRTIM_Timer_Deadtime_Insertion HRTIM Timer Dead-time Insertion
808 * @brief Constants defining whether or not fault the dead time insertion
809 * feature is enabled for a timer
811 #define HRTIM_TIMDEADTIMEINSERTION_DISABLED (0x00000000U) /*!< Output 1 and output 2 signals are independent */
812 #define HRTIM_TIMDEADTIMEINSERTION_ENABLED HRTIM_OUTR_DTEN /*!< Dead-time is inserted between output 1 and output 2U */
817 /** @defgroup HRTIM_Timer_Delayed_Protection_Mode HRTIM Timer Delayed Protection Mode
819 * @brief Constants defining all possible delayed protection modes
820 * for a timer. Also define the source and outputs on which the delayed
821 * protection schemes are applied
823 #define HRTIM_TIMER_A_B_C_DELAYEDPROTECTION_DISABLED (0x00000000U) /*!< No action */
824 #define HRTIM_TIMER_A_B_C_DELAYEDPROTECTION_DELAYEDOUT1_EEV6 (HRTIM_OUTR_DLYPRTEN) /*!< Timers A, B, C: Output 1 delayed Idle on external Event 6U */
825 #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 */
826 #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 */
827 #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 */
828 #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 */
829 #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 */
830 #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 */
831 #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 */
833 #define HRTIM_TIMER_D_E_DELAYEDPROTECTION_DISABLED (0x00000000U) /*!< No action */
834 #define HRTIM_TIMER_D_E_DELAYEDPROTECTION_DELAYEDOUT1_EEV8 (HRTIM_OUTR_DLYPRTEN) /*!< Timers D, E: Output 1 delayed Idle on external Event 6U */
835 #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 */
836 #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 */
837 #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 */
838 #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 */
839 #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 */
840 #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 */
841 #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 */
846 /** @defgroup HRTIM_Timer_Update_Trigger HRTIM Timer Update Trigger
848 * @brief Constants defining whether the registers update is done synchronously
849 * with any other timer or master update
851 #define HRTIM_TIMUPDATETRIGGER_NONE 0x00000000U /*!< Register update is disabled */
852 #define HRTIM_TIMUPDATETRIGGER_MASTER (HRTIM_TIMCR_MSTU) /*!< Register update is triggered by the master timer update */
853 #define HRTIM_TIMUPDATETRIGGER_TIMER_A (HRTIM_TIMCR_TAU) /*!< Register update is triggered by the timer A update */
854 #define HRTIM_TIMUPDATETRIGGER_TIMER_B (HRTIM_TIMCR_TBU) /*!< Register update is triggered by the timer B update */
855 #define HRTIM_TIMUPDATETRIGGER_TIMER_C (HRTIM_TIMCR_TCU) /*!< Register update is triggered by the timer C update*/
856 #define HRTIM_TIMUPDATETRIGGER_TIMER_D (HRTIM_TIMCR_TDU) /*!< Register update is triggered by the timer D update */
857 #define HRTIM_TIMUPDATETRIGGER_TIMER_E (HRTIM_TIMCR_TEU) /*!< Register update is triggered by the timer E update */
862 /** @defgroup HRTIM_Timer_Reset_Trigger HRTIM Timer Reset Trigger
864 * @brief Constants defining the events that can be selected to trigger the reset
865 * of the timer counter
867 #define HRTIM_TIMRESETTRIGGER_NONE 0x00000000U /*!< No counter reset trigger */
868 #define HRTIM_TIMRESETTRIGGER_UPDATE (HRTIM_RSTR_UPDATE) /*!< The timer counter is reset upon update event */
869 #define HRTIM_TIMRESETTRIGGER_CMP2 (HRTIM_RSTR_CMP2) /*!< The timer counter is reset upon Timer Compare 2 event */
870 #define HRTIM_TIMRESETTRIGGER_CMP4 (HRTIM_RSTR_CMP4) /*!< The timer counter is reset upon Timer Compare 4 event */
871 #define HRTIM_TIMRESETTRIGGER_MASTER_PER (HRTIM_RSTR_MSTPER) /*!< The timer counter is reset upon master timer period event */
872 #define HRTIM_TIMRESETTRIGGER_MASTER_CMP1 (HRTIM_RSTR_MSTCMP1) /*!< The timer counter is reset upon master timer Compare 1 event */
873 #define HRTIM_TIMRESETTRIGGER_MASTER_CMP2 (HRTIM_RSTR_MSTCMP2) /*!< The timer counter is reset upon master timer Compare 2 event */
874 #define HRTIM_TIMRESETTRIGGER_MASTER_CMP3 (HRTIM_RSTR_MSTCMP3) /*!< The timer counter is reset upon master timer Compare 3 event */
875 #define HRTIM_TIMRESETTRIGGER_MASTER_CMP4 (HRTIM_RSTR_MSTCMP4) /*!< The timer counter is reset upon master timer Compare 4 event */
876 #define HRTIM_TIMRESETTRIGGER_EEV_1 (HRTIM_RSTR_EXTEVNT1) /*!< The timer counter is reset upon external event 1U */
877 #define HRTIM_TIMRESETTRIGGER_EEV_2 (HRTIM_RSTR_EXTEVNT2) /*!< The timer counter is reset upon external event 2U */
878 #define HRTIM_TIMRESETTRIGGER_EEV_3 (HRTIM_RSTR_EXTEVNT3) /*!< The timer counter is reset upon external event 3U */
879 #define HRTIM_TIMRESETTRIGGER_EEV_4 (HRTIM_RSTR_EXTEVNT4) /*!< The timer counter is reset upon external event 4U */
880 #define HRTIM_TIMRESETTRIGGER_EEV_5 (HRTIM_RSTR_EXTEVNT5) /*!< The timer counter is reset upon external event 5U */
881 #define HRTIM_TIMRESETTRIGGER_EEV_6 (HRTIM_RSTR_EXTEVNT6) /*!< The timer counter is reset upon external event 6U */
882 #define HRTIM_TIMRESETTRIGGER_EEV_7 (HRTIM_RSTR_EXTEVNT7) /*!< The timer counter is reset upon external event 7U */
883 #define HRTIM_TIMRESETTRIGGER_EEV_8 (HRTIM_RSTR_EXTEVNT8) /*!< The timer counter is reset upon external event 8U */
884 #define HRTIM_TIMRESETTRIGGER_EEV_9 (HRTIM_RSTR_EXTEVNT9) /*!< The timer counter is reset upon external event 9U */
885 #define HRTIM_TIMRESETTRIGGER_EEV_10 (HRTIM_RSTR_EXTEVNT10) /*!< The timer counter is reset upon external event 10U */
886 #define HRTIM_TIMRESETTRIGGER_OTHER1_CMP1 (HRTIM_RSTR_TIMBCMP1) /*!< The timer counter is reset upon other timer Compare 1 event */
887 #define HRTIM_TIMRESETTRIGGER_OTHER1_CMP2 (HRTIM_RSTR_TIMBCMP2) /*!< The timer counter is reset upon other timer Compare 2 event */
888 #define HRTIM_TIMRESETTRIGGER_OTHER1_CMP4 (HRTIM_RSTR_TIMBCMP4) /*!< The timer counter is reset upon other timer Compare 4 event */
889 #define HRTIM_TIMRESETTRIGGER_OTHER2_CMP1 (HRTIM_RSTR_TIMCCMP1) /*!< The timer counter is reset upon other timer Compare 1 event */
890 #define HRTIM_TIMRESETTRIGGER_OTHER2_CMP2 (HRTIM_RSTR_TIMCCMP2) /*!< The timer counter is reset upon other timer Compare 2 event */
891 #define HRTIM_TIMRESETTRIGGER_OTHER2_CMP4 (HRTIM_RSTR_TIMCCMP4) /*!< The timer counter is reset upon other timer Compare 4 event */
892 #define HRTIM_TIMRESETTRIGGER_OTHER3_CMP1 (HRTIM_RSTR_TIMDCMP1) /*!< The timer counter is reset upon other timer Compare 1 event */
893 #define HRTIM_TIMRESETTRIGGER_OTHER3_CMP2 (HRTIM_RSTR_TIMDCMP2) /*!< The timer counter is reset upon other timer Compare 2 event */
894 #define HRTIM_TIMRESETTRIGGER_OTHER3_CMP4 (HRTIM_RSTR_TIMDCMP4) /*!< The timer counter is reset upon other timer Compare 4 event */
895 #define HRTIM_TIMRESETTRIGGER_OTHER4_CMP1 (HRTIM_RSTR_TIMECMP1) /*!< The timer counter is reset upon other timer Compare 1 event */
896 #define HRTIM_TIMRESETTRIGGER_OTHER4_CMP2 (HRTIM_RSTR_TIMECMP2) /*!< The timer counter is reset upon other timer Compare 2 event */
897 #define HRTIM_TIMRESETTRIGGER_OTHER4_CMP4 (HRTIM_RSTR_TIMECMP4) /*!< The timer counter is reset upon other timer Compare 4 event */
902 /** @defgroup HRTIM_Timer_Reset_Update HRTIM Timer Reset Update
904 * @brief Constants defining whether the register are updated upon Timerx
905 * counter reset or roll-over to 0 after reaching the period value
908 #define HRTIM_TIMUPDATEONRESET_DISABLED 0x00000000U /*!< Update by timer x reset / roll-over disabled */
909 #define HRTIM_TIMUPDATEONRESET_ENABLED (HRTIM_TIMCR_TRSTU) /*!< Update by timer x reset / roll-over enabled */
914 /** @defgroup HRTIM_Compare_Unit_Auto_Delayed_Mode HRTIM Compare Unit Auto Delayed Mode
916 * @brief Constants defining whether the compare register is behaving in
917 * regular mode (compare match issued as soon as counter equal compare),
918 * or in auto-delayed mode
920 #define HRTIM_AUTODELAYEDMODE_REGULAR (0x00000000U) /*!< standard compare mode */
921 #define HRTIM_AUTODELAYEDMODE_AUTODELAYED_NOTIMEOUT (HRTIM_TIMCR_DELCMP2_0) /*!< Compare event generated only if a capture has occurred */
922 #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) */
923 #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) */
928 /** @defgroup HRTIM_Simple_OC_Mode HRTIM Simple OC Mode
930 * @brief Constants defining the behavior of the output signal when the timer
931 operates in basic output compare mode
933 #define HRTIM_BASICOCMODE_TOGGLE (0x00000001U) /*!< Output toggles when the timer counter reaches the compare value */
934 #define HRTIM_BASICOCMODE_INACTIVE (0x00000002U) /*!< Output forced to active level when the timer counter reaches the compare value */
935 #define HRTIM_BASICOCMODE_ACTIVE (0x00000003U) /*!< Output forced to inactive level when the timer counter reaches the compare value */
937 #define IS_HRTIM_BASICOCMODE(BASICOCMODE)\
938 (((BASICOCMODE) == HRTIM_BASICOCMODE_TOGGLE) || \
939 ((BASICOCMODE) == HRTIM_BASICOCMODE_INACTIVE) || \
940 ((BASICOCMODE) == HRTIM_BASICOCMODE_ACTIVE))
945 /** @defgroup HRTIM_Output_Polarity HRTIM Output Polarity
947 * @brief Constants defining the polarity of a timer output
949 #define HRTIM_OUTPUTPOLARITY_HIGH (0x00000000U) /*!< Output is acitve HIGH */
950 #define HRTIM_OUTPUTPOLARITY_LOW (HRTIM_OUTR_POL1) /*!< Output is active LOW */
955 /** @defgroup HRTIM_Output_Set_Source HRTIM Output Set Source
957 * @brief Constants defining the events that can be selected to configure the
958 * set crossbar of a timer output
960 #define HRTIM_OUTPUTSET_NONE 0x00000000U /*!< Reset the output set crossbar */
961 #define HRTIM_OUTPUTSET_RESYNC (HRTIM_SET1R_RESYNC) /*!< Timer reset event coming solely from software or SYNC input forces the output to its active state */
962 #define HRTIM_OUTPUTSET_TIMPER (HRTIM_SET1R_PER) /*!< Timer period event forces the output to its active state */
963 #define HRTIM_OUTPUTSET_TIMCMP1 (HRTIM_SET1R_CMP1) /*!< Timer compare 1 event forces the output to its active state */
964 #define HRTIM_OUTPUTSET_TIMCMP2 (HRTIM_SET1R_CMP2) /*!< Timer compare 2 event forces the output to its active state */
965 #define HRTIM_OUTPUTSET_TIMCMP3 (HRTIM_SET1R_CMP3) /*!< Timer compare 3 event forces the output to its active state */
966 #define HRTIM_OUTPUTSET_TIMCMP4 (HRTIM_SET1R_CMP4) /*!< Timer compare 4 event forces the output to its active state */
967 #define HRTIM_OUTPUTSET_MASTERPER (HRTIM_SET1R_MSTPER) /*!< The master timer period event forces the output to its active state */
968 #define HRTIM_OUTPUTSET_MASTERCMP1 (HRTIM_SET1R_MSTCMP1) /*!< Master Timer compare 1 event forces the output to its active state */
969 #define HRTIM_OUTPUTSET_MASTERCMP2 (HRTIM_SET1R_MSTCMP2) /*!< Master Timer compare 2 event forces the output to its active state */
970 #define HRTIM_OUTPUTSET_MASTERCMP3 (HRTIM_SET1R_MSTCMP3) /*!< Master Timer compare 3 event forces the output to its active state */
971 #define HRTIM_OUTPUTSET_MASTERCMP4 (HRTIM_SET1R_MSTCMP4) /*!< Master Timer compare 4 event forces the output to its active state */
972 #define HRTIM_OUTPUTSET_TIMEV_1 (HRTIM_SET1R_TIMEVNT1) /*!< Timer event 1 forces the output to its active state */
973 #define HRTIM_OUTPUTSET_TIMEV_2 (HRTIM_SET1R_TIMEVNT2) /*!< Timer event 2 forces the output to its active state */
974 #define HRTIM_OUTPUTSET_TIMEV_3 (HRTIM_SET1R_TIMEVNT3) /*!< Timer event 3 forces the output to its active state */
975 #define HRTIM_OUTPUTSET_TIMEV_4 (HRTIM_SET1R_TIMEVNT4) /*!< Timer event 4 forces the output to its active state */
976 #define HRTIM_OUTPUTSET_TIMEV_5 (HRTIM_SET1R_TIMEVNT5) /*!< Timer event 5 forces the output to its active state */
977 #define HRTIM_OUTPUTSET_TIMEV_6 (HRTIM_SET1R_TIMEVNT6) /*!< Timer event 6 forces the output to its active state */
978 #define HRTIM_OUTPUTSET_TIMEV_7 (HRTIM_SET1R_TIMEVNT7) /*!< Timer event 7 forces the output to its active state */
979 #define HRTIM_OUTPUTSET_TIMEV_8 (HRTIM_SET1R_TIMEVNT8) /*!< Timer event 8 forces the output to its active state */
980 #define HRTIM_OUTPUTSET_TIMEV_9 (HRTIM_SET1R_TIMEVNT9) /*!< Timer event 9 forces the output to its active state */
981 #define HRTIM_OUTPUTSET_EEV_1 (HRTIM_SET1R_EXTVNT1) /*!< External event 1 forces the output to its active state */
982 #define HRTIM_OUTPUTSET_EEV_2 (HRTIM_SET1R_EXTVNT2) /*!< External event 2 forces the output to its active state */
983 #define HRTIM_OUTPUTSET_EEV_3 (HRTIM_SET1R_EXTVNT3) /*!< External event 3 forces the output to its active state */
984 #define HRTIM_OUTPUTSET_EEV_4 (HRTIM_SET1R_EXTVNT4) /*!< External event 4 forces the output to its active state */
985 #define HRTIM_OUTPUTSET_EEV_5 (HRTIM_SET1R_EXTVNT5) /*!< External event 5 forces the output to its active state */
986 #define HRTIM_OUTPUTSET_EEV_6 (HRTIM_SET1R_EXTVNT6) /*!< External event 6 forces the output to its active state */
987 #define HRTIM_OUTPUTSET_EEV_7 (HRTIM_SET1R_EXTVNT7) /*!< External event 7 forces the output to its active state */
988 #define HRTIM_OUTPUTSET_EEV_8 (HRTIM_SET1R_EXTVNT8) /*!< External event 8 forces the output to its active state */
989 #define HRTIM_OUTPUTSET_EEV_9 (HRTIM_SET1R_EXTVNT9) /*!< External event 9 forces the output to its active state */
990 #define HRTIM_OUTPUTSET_EEV_10 (HRTIM_SET1R_EXTVNT10) /*!< External event 10 forces the output to its active state */
991 #define HRTIM_OUTPUTSET_UPDATE (HRTIM_SET1R_UPDATE) /*!< Timer register update event forces the output to its active state */
996 /** @defgroup HRTIM_Output_Reset_Source HRTIM Output Reset Source
998 * @brief Constants defining the events that can be selected to configure the
999 * set crossbar of a timer output
1001 #define HRTIM_OUTPUTRESET_NONE 0x00000000U /*!< Reset the output reset crossbar */
1002 #define HRTIM_OUTPUTRESET_RESYNC (HRTIM_RST1R_RESYNC) /*!< Timer reset event coming solely from software or SYNC input forces the output to its inactive state */
1003 #define HRTIM_OUTPUTRESET_TIMPER (HRTIM_RST1R_PER) /*!< Timer period event forces the output to its inactive state */
1004 #define HRTIM_OUTPUTRESET_TIMCMP1 (HRTIM_RST1R_CMP1) /*!< Timer compare 1 event forces the output to its inactive state */
1005 #define HRTIM_OUTPUTRESET_TIMCMP2 (HRTIM_RST1R_CMP2) /*!< Timer compare 2 event forces the output to its inactive state */
1006 #define HRTIM_OUTPUTRESET_TIMCMP3 (HRTIM_RST1R_CMP3) /*!< Timer compare 3 event forces the output to its inactive state */
1007 #define HRTIM_OUTPUTRESET_TIMCMP4 (HRTIM_RST1R_CMP4) /*!< Timer compare 4 event forces the output to its inactive state */
1008 #define HRTIM_OUTPUTRESET_MASTERPER (HRTIM_RST1R_MSTPER) /*!< The master timer period event forces the output to its inactive state */
1009 #define HRTIM_OUTPUTRESET_MASTERCMP1 (HRTIM_RST1R_MSTCMP1) /*!< Master Timer compare 1 event forces the output to its inactive state */
1010 #define HRTIM_OUTPUTRESET_MASTERCMP2 (HRTIM_RST1R_MSTCMP2) /*!< Master Timer compare 2 event forces the output to its inactive state */
1011 #define HRTIM_OUTPUTRESET_MASTERCMP3 (HRTIM_RST1R_MSTCMP3) /*!< Master Timer compare 3 event forces the output to its inactive state */
1012 #define HRTIM_OUTPUTRESET_MASTERCMP4 (HRTIM_RST1R_MSTCMP4) /*!< Master Timer compare 4 event forces the output to its inactive state */
1013 #define HRTIM_OUTPUTRESET_TIMEV_1 (HRTIM_SET1R_TIMEVNT1) /*!< Timer event 1 forces the output to its active state */
1014 #define HRTIM_OUTPUTRESET_TIMEV_2 (HRTIM_SET1R_TIMEVNT2) /*!< Timer event 2 forces the output to its active state */
1015 #define HRTIM_OUTPUTRESET_TIMEV_3 (HRTIM_SET1R_TIMEVNT3) /*!< Timer event 3 forces the output to its active state */
1016 #define HRTIM_OUTPUTRESET_TIMEV_4 (HRTIM_SET1R_TIMEVNT4) /*!< Timer event 4 forces the output to its active state */
1017 #define HRTIM_OUTPUTRESET_TIMEV_5 (HRTIM_SET1R_TIMEVNT5) /*!< Timer event 5 forces the output to its active state */
1018 #define HRTIM_OUTPUTRESET_TIMEV_6 (HRTIM_SET1R_TIMEVNT6) /*!< Timer event 6 forces the output to its active state */
1019 #define HRTIM_OUTPUTRESET_TIMEV_7 (HRTIM_SET1R_TIMEVNT7) /*!< Timer event 7 forces the output to its active state */
1020 #define HRTIM_OUTPUTRESET_TIMEV_8 (HRTIM_SET1R_TIMEVNT8) /*!< Timer event 8 forces the output to its active state */
1021 #define HRTIM_OUTPUTRESET_TIMEV_9 (HRTIM_SET1R_TIMEVNT9) /*!< Timer event 9 forces the output to its active state */
1022 #define HRTIM_OUTPUTRESET_EEV_1 (HRTIM_RST1R_EXTVNT1) /*!< External event 1 forces the output to its inactive state */
1023 #define HRTIM_OUTPUTRESET_EEV_2 (HRTIM_RST1R_EXTVNT2) /*!< External event 2 forces the output to its inactive state */
1024 #define HRTIM_OUTPUTRESET_EEV_3 (HRTIM_RST1R_EXTVNT3) /*!< External event 3 forces the output to its inactive state */
1025 #define HRTIM_OUTPUTRESET_EEV_4 (HRTIM_RST1R_EXTVNT4) /*!< External event 4 forces the output to its inactive state */
1026 #define HRTIM_OUTPUTRESET_EEV_5 (HRTIM_RST1R_EXTVNT5) /*!< External event 5 forces the output to its inactive state */
1027 #define HRTIM_OUTPUTRESET_EEV_6 (HRTIM_RST1R_EXTVNT6) /*!< External event 6 forces the output to its inactive state */
1028 #define HRTIM_OUTPUTRESET_EEV_7 (HRTIM_RST1R_EXTVNT7) /*!< External event 7 forces the output to its inactive state */
1029 #define HRTIM_OUTPUTRESET_EEV_8 (HRTIM_RST1R_EXTVNT8) /*!< External event 8 forces the output to its inactive state */
1030 #define HRTIM_OUTPUTRESET_EEV_9 (HRTIM_RST1R_EXTVNT9) /*!< External event 9 forces the output to its inactive state */
1031 #define HRTIM_OUTPUTRESET_EEV_10 (HRTIM_RST1R_EXTVNT10) /*!< External event 10 forces the output to its inactive state */
1032 #define HRTIM_OUTPUTRESET_UPDATE (HRTIM_RST1R_UPDATE) /*!< Timer register update event forces the output to its inactive state */
1037 /** @defgroup HRTIM_Output_Idle_Mode HRTIM Output Idle Mode
1039 * @brief Constants defining whether or not the timer output transition to its
1040 IDLE state when burst mode is entered
1042 #define HRTIM_OUTPUTIDLEMODE_NONE 0x00000000U /*!< The output is not affected by the burst mode operation */
1043 #define HRTIM_OUTPUTIDLEMODE_IDLE (HRTIM_OUTR_IDLM1) /*!< The output is in idle state when requested by the burst mode controller */
1048 /** @defgroup HRTIM_Output_IDLE_Level HRTIM Output IDLE Level
1050 * @brief Constants defining the output level when output is in IDLE state
1052 #define HRTIM_OUTPUTIDLELEVEL_INACTIVE 0x00000000U /*!< Output at inactive level when in IDLE state */
1053 #define HRTIM_OUTPUTIDLELEVEL_ACTIVE (HRTIM_OUTR_IDLES1) /*!< Output at active level when in IDLE state */
1058 /** @defgroup HRTIM_Output_FAULT_Level HRTIM Output FAULT Level
1060 * @brief Constants defining the output level when output is in FAULT state
1062 #define HRTIM_OUTPUTFAULTLEVEL_NONE 0x00000000U /*!< The output is not affected by the fault input */
1063 #define HRTIM_OUTPUTFAULTLEVEL_ACTIVE (HRTIM_OUTR_FAULT1_0) /*!< Output at active level when in FAULT state */
1064 #define HRTIM_OUTPUTFAULTLEVEL_INACTIVE (HRTIM_OUTR_FAULT1_1) /*!< Output at inactive level when in FAULT state */
1065 #define HRTIM_OUTPUTFAULTLEVEL_HIGHZ (HRTIM_OUTR_FAULT1_1 | HRTIM_OUTR_FAULT1_0) /*!< Output is tri-stated when in FAULT state */
1070 /** @defgroup HRTIM_Output_Chopper_Mode_Enable HRTIM Output Chopper Mode Enable
1072 * @brief Constants defining whether or not chopper mode is enabled for a timer
1075 #define HRTIM_OUTPUTCHOPPERMODE_DISABLED 0x00000000U /*!< Output signal is not altered */
1076 #define HRTIM_OUTPUTCHOPPERMODE_ENABLED (HRTIM_OUTR_CHP1) /*!< Output signal is chopped by a carrier signal */
1081 /** @defgroup HRTIM_Output_Burst_Mode_Entry_Delayed HRTIM Output Burst Mode Entry Delayed
1083 * @brief Constants defining the idle mode entry is delayed by forcing a
1084 dead-time insertion before switching the outputs to their idle state
1086 #define HRTIM_OUTPUTBURSTMODEENTRY_REGULAR 0x00000000U /*!< The programmed Idle state is applied immediately to the Output */
1087 #define HRTIM_OUTPUTBURSTMODEENTRY_DELAYED (HRTIM_OUTR_DIDL1) /*!< Dead-time is inserted on output before entering the idle mode */
1093 /** @defgroup HRTIM_Capture_Unit_Trigger HRTIM Capture Unit Trigger
1095 * @brief Constants defining the events that can be selected to trigger the
1096 * capture of the timing unit counter
1098 #define HRTIM_CAPTURETRIGGER_NONE 0x00000000U /*!< Capture trigger is disabled */
1099 #define HRTIM_CAPTURETRIGGER_UPDATE (HRTIM_CPT1CR_UPDCPT) /*!< The update event triggers the Capture */
1100 #define HRTIM_CAPTURETRIGGER_EEV_1 (HRTIM_CPT1CR_EXEV1CPT) /*!< The External event 1 triggers the Capture */
1101 #define HRTIM_CAPTURETRIGGER_EEV_2 (HRTIM_CPT1CR_EXEV2CPT) /*!< The External event 2 triggers the Capture */
1102 #define HRTIM_CAPTURETRIGGER_EEV_3 (HRTIM_CPT1CR_EXEV3CPT) /*!< The External event 3 triggers the Capture */
1103 #define HRTIM_CAPTURETRIGGER_EEV_4 (HRTIM_CPT1CR_EXEV4CPT) /*!< The External event 4 triggers the Capture */
1104 #define HRTIM_CAPTURETRIGGER_EEV_5 (HRTIM_CPT1CR_EXEV5CPT) /*!< The External event 5 triggers the Capture */
1105 #define HRTIM_CAPTURETRIGGER_EEV_6 (HRTIM_CPT1CR_EXEV6CPT) /*!< The External event 6 triggers the Capture */
1106 #define HRTIM_CAPTURETRIGGER_EEV_7 (HRTIM_CPT1CR_EXEV7CPT) /*!< The External event 7 triggers the Capture */
1107 #define HRTIM_CAPTURETRIGGER_EEV_8 (HRTIM_CPT1CR_EXEV8CPT) /*!< The External event 8 triggers the Capture */
1108 #define HRTIM_CAPTURETRIGGER_EEV_9 (HRTIM_CPT1CR_EXEV9CPT) /*!< The External event 9 triggers the Capture */
1109 #define HRTIM_CAPTURETRIGGER_EEV_10 (HRTIM_CPT1CR_EXEV10CPT) /*!< The External event 10 triggers the Capture */
1110 #define HRTIM_CAPTURETRIGGER_TA1_SET (HRTIM_CPT1CR_TA1SET) /*!< Capture is triggered by TA1 output inactive to active transition */
1111 #define HRTIM_CAPTURETRIGGER_TA1_RESET (HRTIM_CPT1CR_TA1RST) /*!< Capture is triggered by TA1 output active to inactive transition */
1112 #define HRTIM_CAPTURETRIGGER_TIMERA_CMP1 (HRTIM_CPT1CR_TIMACMP1) /*!< Timer A Compare 1 triggers Capture */
1113 #define HRTIM_CAPTURETRIGGER_TIMERA_CMP2 (HRTIM_CPT1CR_TIMACMP2) /*!< Timer A Compare 2 triggers Capture */
1114 #define HRTIM_CAPTURETRIGGER_TB1_SET (HRTIM_CPT1CR_TB1SET) /*!< Capture is triggered by TB1 output inactive to active transition */
1115 #define HRTIM_CAPTURETRIGGER_TB1_RESET (HRTIM_CPT1CR_TB1RST) /*!< Capture is triggered by TB1 output active to inactive transition */
1116 #define HRTIM_CAPTURETRIGGER_TIMERB_CMP1 (HRTIM_CPT1CR_TIMBCMP1) /*!< Timer B Compare 1 triggers Capture */
1117 #define HRTIM_CAPTURETRIGGER_TIMERB_CMP2 (HRTIM_CPT1CR_TIMBCMP2) /*!< Timer B Compare 2 triggers Capture */
1118 #define HRTIM_CAPTURETRIGGER_TC1_SET (HRTIM_CPT1CR_TC1SET) /*!< Capture is triggered by TC1 output inactive to active transition */
1119 #define HRTIM_CAPTURETRIGGER_TC1_RESET (HRTIM_CPT1CR_TC1RST) /*!< Capture is triggered by TC1 output active to inactive transition */
1120 #define HRTIM_CAPTURETRIGGER_TIMERC_CMP1 (HRTIM_CPT1CR_TIMCCMP1) /*!< Timer C Compare 1 triggers Capture */
1121 #define HRTIM_CAPTURETRIGGER_TIMERC_CMP2 (HRTIM_CPT1CR_TIMCCMP2) /*!< Timer C Compare 2 triggers Capture */
1122 #define HRTIM_CAPTURETRIGGER_TD1_SET (HRTIM_CPT1CR_TD1SET) /*!< Capture is triggered by TD1 output inactive to active transition */
1123 #define HRTIM_CAPTURETRIGGER_TD1_RESET (HRTIM_CPT1CR_TD1RST) /*!< Capture is triggered by TD1 output active to inactive transition */
1124 #define HRTIM_CAPTURETRIGGER_TIMERD_CMP1 (HRTIM_CPT1CR_TIMDCMP1) /*!< Timer D Compare 1 triggers Capture */
1125 #define HRTIM_CAPTURETRIGGER_TIMERD_CMP2 (HRTIM_CPT1CR_TIMDCMP2) /*!< Timer D Compare 2 triggers Capture */
1126 #define HRTIM_CAPTURETRIGGER_TE1_SET (HRTIM_CPT1CR_TE1SET) /*!< Capture is triggered by TE1 output inactive to active transition */
1127 #define HRTIM_CAPTURETRIGGER_TE1_RESET (HRTIM_CPT1CR_TE1RST) /*!< Capture is triggered by TE1 output active to inactive transition */
1128 #define HRTIM_CAPTURETRIGGER_TIMERE_CMP1 (HRTIM_CPT1CR_TIMECMP1) /*!< Timer E Compare 1 triggers Capture */
1129 #define HRTIM_CAPTURETRIGGER_TIMERE_CMP2 (HRTIM_CPT1CR_TIMECMP2) /*!< Timer E Compare 2 triggers Capture */
1134 /** @defgroup HRTIM_Timer_External_Event_Filter HRTIM Timer External Event Filter
1136 * @brief Constants defining the event filtering applied to external events
1139 #define HRTIM_TIMEVENTFILTER_NONE (0x00000000U)
1140 #define HRTIM_TIMEVENTFILTER_BLANKINGCMP1 (HRTIM_EEFR1_EE1FLTR_0) /*!< Blanking from counter reset/roll-over to Compare 1U */
1141 #define HRTIM_TIMEVENTFILTER_BLANKINGCMP2 (HRTIM_EEFR1_EE1FLTR_1) /*!< Blanking from counter reset/roll-over to Compare 2U */
1142 #define HRTIM_TIMEVENTFILTER_BLANKINGCMP3 (HRTIM_EEFR1_EE1FLTR_1 | HRTIM_EEFR1_EE1FLTR_0) /*!< Blanking from counter reset/roll-over to Compare 3U */
1143 #define HRTIM_TIMEVENTFILTER_BLANKINGCMP4 (HRTIM_EEFR1_EE1FLTR_2) /*!< Blanking from counter reset/roll-over to Compare 4U */
1144 #define HRTIM_TIMEVENTFILTER_BLANKINGFLTR1 (HRTIM_EEFR1_EE1FLTR_2 | HRTIM_EEFR1_EE1FLTR_0) /*!< Blanking from another timing unit: TIMFLTR1 source */
1145 #define HRTIM_TIMEVENTFILTER_BLANKINGFLTR2 (HRTIM_EEFR1_EE1FLTR_2 | HRTIM_EEFR1_EE1FLTR_1) /*!< Blanking from another timing unit: TIMFLTR2 source */
1146 #define HRTIM_TIMEVENTFILTER_BLANKINGFLTR3 (HRTIM_EEFR1_EE1FLTR_2 | HRTIM_EEFR1_EE1FLTR_1 | HRTIM_EEFR1_EE1FLTR_0) /*!< Blanking from another timing unit: TIMFLTR3 source */
1147 #define HRTIM_TIMEVENTFILTER_BLANKINGFLTR4 (HRTIM_EEFR1_EE1FLTR_3) /*!< Blanking from another timing unit: TIMFLTR4 source */
1148 #define HRTIM_TIMEVENTFILTER_BLANKINGFLTR5 (HRTIM_EEFR1_EE1FLTR_3 | HRTIM_EEFR1_EE1FLTR_0) /*!< Blanking from another timing unit: TIMFLTR5 source */
1149 #define HRTIM_TIMEVENTFILTER_BLANKINGFLTR6 (HRTIM_EEFR1_EE1FLTR_3 | HRTIM_EEFR1_EE1FLTR_1) /*!< Blanking from another timing unit: TIMFLTR6 source */
1150 #define HRTIM_TIMEVENTFILTER_BLANKINGFLTR7 (HRTIM_EEFR1_EE1FLTR_3 | HRTIM_EEFR1_EE1FLTR_1 | HRTIM_EEFR1_EE1FLTR_0) /*!< Blanking from another timing unit: TIMFLTR7 source */
1151 #define HRTIM_TIMEVENTFILTER_BLANKINGFLTR8 (HRTIM_EEFR1_EE1FLTR_3 | HRTIM_EEFR1_EE1FLTR_2) /*!< Blanking from another timing unit: TIMFLTR8 source */
1152 #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 */
1153 #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 */
1154 #define HRTIM_TIMEVENTFILTER_WINDOWINGTIM (HRTIM_EEFR1_EE1FLTR_3 | HRTIM_EEFR1_EE1FLTR_2 | HRTIM_EEFR1_EE1FLTR_1 | HRTIM_EEFR1_EE1FLTR_3 | HRTIM_EEFR1_EE1FLTR_2 | HRTIM_EEFR1_EE1FLTR_0) /*!< Windowing from another timing unit: TIMWIN source */
1159 /** @defgroup HRTIM_Timer_External_Event_Latch HRTIM Timer External Event Latch
1161 * @brief Constants defining whether or not the external event is
1162 * memorized (latched) and generated as soon as the blanking period
1163 * is completed or the window ends
1165 #define HRTIM_TIMEVENTLATCH_DISABLED (0x00000000U) /*!< Event is ignored if it happens during a blank, or passed through during a window */
1166 #define HRTIM_TIMEVENTLATCH_ENABLED HRTIM_EEFR1_EE1LTCH /*!< Event is latched and delayed till the end of the blanking or windowing period */
1171 /** @defgroup HRTIM_Deadtime_Prescaler_Ratio HRTIM Dead-time Prescaler Ratio
1173 * @brief Constants defining division ratio between the timer clock frequency
1174 * (fHRTIM) and the dead-time generator clock (fDTG)
1176 #define HRTIM_TIMDEADTIME_PRESCALERRATIO_MUL8 (0x00000000U) /*!< fDTG = fHRTIM * 8U */
1177 #define HRTIM_TIMDEADTIME_PRESCALERRATIO_MUL4 (HRTIM_DTR_DTPRSC_0) /*!< fDTG = fHRTIM * 4U */
1178 #define HRTIM_TIMDEADTIME_PRESCALERRATIO_MUL2 (HRTIM_DTR_DTPRSC_1) /*!< fDTG = fHRTIM * 2U */
1179 #define HRTIM_TIMDEADTIME_PRESCALERRATIO_DIV1 (HRTIM_DTR_DTPRSC_1 | HRTIM_DTR_DTPRSC_0) /*!< fDTG = fHRTIM */
1180 #define HRTIM_TIMDEADTIME_PRESCALERRATIO_DIV2 (HRTIM_DTR_DTPRSC_2) /*!< fDTG = fHRTIM / 2U */
1181 #define HRTIM_TIMDEADTIME_PRESCALERRATIO_DIV4 (HRTIM_DTR_DTPRSC_2 | HRTIM_DTR_DTPRSC_0) /*!< fDTG = fHRTIM / 4U */
1182 #define HRTIM_TIMDEADTIME_PRESCALERRATIO_DIV8 (HRTIM_DTR_DTPRSC_2 | HRTIM_DTR_DTPRSC_1) /*!< fDTG = fHRTIM / 8U */
1183 #define HRTIM_TIMDEADTIME_PRESCALERRATIO_DIV16 (HRTIM_DTR_DTPRSC_2 | HRTIM_DTR_DTPRSC_1 | HRTIM_DTR_DTPRSC_0) /*!< fDTG = fHRTIM / 16U */
1188 /** @defgroup HRTIM_Deadtime_Rising_Sign HRTIM Dead-time Rising Sign
1190 * @brief Constants defining whether the dead-time is positive or negative
1191 * (overlapping signal) on rising edge
1193 #define HRTIM_TIMDEADTIME_RISINGSIGN_POSITIVE (0x00000000U) /*!< Positive dead-time on rising edge */
1194 #define HRTIM_TIMDEADTIME_RISINGSIGN_NEGATIVE (HRTIM_DTR_SDTR) /*!< Negative dead-time on rising edge */
1199 /** @defgroup HRTIM_Deadtime_Rising_Lock HRTIM Dead-time Rising Lock
1201 * @brief Constants defining whether or not the dead-time (rising sign and
1202 * value) is write protected
1204 #define HRTIM_TIMDEADTIME_RISINGLOCK_WRITE (0x00000000U) /*!< Dead-time rising value and sign is writeable */
1205 #define HRTIM_TIMDEADTIME_RISINGLOCK_READONLY (HRTIM_DTR_DTRLK) /*!< Dead-time rising value and sign is read-only */
1210 /** @defgroup HRTIM_Deadtime_Rising_Sign_Lock HRTIM Dead-time Rising Sign Lock
1212 * @brief Constants defining whether or not the dead-time rising sign is write
1215 #define HRTIM_TIMDEADTIME_RISINGSIGNLOCK_WRITE (0x00000000U) /*!< Dead-time rising sign is writeable */
1216 #define HRTIM_TIMDEADTIME_RISINGSIGNLOCK_READONLY (HRTIM_DTR_DTRSLK) /*!< Dead-time rising sign is read-only */
1221 /** @defgroup HRTIM_Deadtime_Falling_Sign HRTIM Dead-time Falling Sign
1223 * @brief Constants defining whether the dead-time is positive or negative
1224 * (overlapping signal) on falling edge
1226 #define HRTIM_TIMDEADTIME_FALLINGSIGN_POSITIVE (0x00000000U) /*!< Positive dead-time on falling edge */
1227 #define HRTIM_TIMDEADTIME_FALLINGSIGN_NEGATIVE (HRTIM_DTR_SDTF) /*!< Negative dead-time on falling edge */
1232 /** @defgroup HRTIM_Deadtime_Falling_Lock HRTIM Dead-time Falling Lock
1234 * @brief Constants defining whether or not the dead-time (falling sign and
1235 * value) is write protected
1237 #define HRTIM_TIMDEADTIME_FALLINGLOCK_WRITE (0x00000000U) /*!< Dead-time falling value and sign is writeable */
1238 #define HRTIM_TIMDEADTIME_FALLINGLOCK_READONLY (HRTIM_DTR_DTFLK) /*!< Dead-time falling value and sign is read-only */
1243 /** @defgroup HRTIM_Deadtime_Falling_Sign_Lock HRTIM Dead-time Falling Sign Lock
1245 * @brief Constants defining whether or not the dead-time falling sign is write
1248 #define HRTIM_TIMDEADTIME_FALLINGSIGNLOCK_WRITE (0x00000000U) /*!< Dead-time falling sign is writeable */
1249 #define HRTIM_TIMDEADTIME_FALLINGSIGNLOCK_READONLY (HRTIM_DTR_DTFSLK) /*!< Dead-time falling sign is read-only */
1254 /** @defgroup HRTIM_Chopper_Frequency HRTIM Chopper Frequency
1256 * @brief Constants defining the frequency of the generated high frequency carrier
1258 #define HRTIM_CHOPPER_PRESCALERRATIO_DIV16 (0x000000U) /*!< fCHPFRQ = fHRTIM / 16 */
1259 #define HRTIM_CHOPPER_PRESCALERRATIO_DIV32 (HRTIM_CHPR_CARFRQ_0) /*!< fCHPFRQ = fHRTIM / 32 */
1260 #define HRTIM_CHOPPER_PRESCALERRATIO_DIV48 (HRTIM_CHPR_CARFRQ_1) /*!< fCHPFRQ = fHRTIM / 48 */
1261 #define HRTIM_CHOPPER_PRESCALERRATIO_DIV64 (HRTIM_CHPR_CARFRQ_1 | HRTIM_CHPR_CARFRQ_0) /*!< fCHPFRQ = fHRTIM / 64 */
1262 #define HRTIM_CHOPPER_PRESCALERRATIO_DIV80 (HRTIM_CHPR_CARFRQ_2) /*!< fCHPFRQ = fHRTIM / 80 */
1263 #define HRTIM_CHOPPER_PRESCALERRATIO_DIV96 (HRTIM_CHPR_CARFRQ_2 | HRTIM_CHPR_CARFRQ_0) /*!< fCHPFRQ = fHRTIM / 96 */
1264 #define HRTIM_CHOPPER_PRESCALERRATIO_DIV112 (HRTIM_CHPR_CARFRQ_2 | HRTIM_CHPR_CARFRQ_1) /*!< fCHPFRQ = fHRTIM / 112 */
1265 #define HRTIM_CHOPPER_PRESCALERRATIO_DIV128 (HRTIM_CHPR_CARFRQ_2 | HRTIM_CHPR_CARFRQ_1 | HRTIM_CHPR_CARFRQ_0) /*!< fCHPFRQ = fHRTIM / 128 */
1266 #define HRTIM_CHOPPER_PRESCALERRATIO_DIV144 (HRTIM_CHPR_CARFRQ_3) /*!< fCHPFRQ = fHRTIM / 144 */
1267 #define HRTIM_CHOPPER_PRESCALERRATIO_DIV160 (HRTIM_CHPR_CARFRQ_3 | HRTIM_CHPR_CARFRQ_0) /*!< fCHPFRQ = fHRTIM / 160 */
1268 #define HRTIM_CHOPPER_PRESCALERRATIO_DIV176 (HRTIM_CHPR_CARFRQ_3 | HRTIM_CHPR_CARFRQ_1) /*!< fCHPFRQ = fHRTIM / 176 */
1269 #define HRTIM_CHOPPER_PRESCALERRATIO_DIV192 (HRTIM_CHPR_CARFRQ_3 | HRTIM_CHPR_CARFRQ_1 | HRTIM_CHPR_CARFRQ_0) /*!< fCHPFRQ = fHRTIM / 192 */
1270 #define HRTIM_CHOPPER_PRESCALERRATIO_DIV208 (HRTIM_CHPR_CARFRQ_3 | HRTIM_CHPR_CARFRQ_2) /*!< fCHPFRQ = fHRTIM / 208 */
1271 #define HRTIM_CHOPPER_PRESCALERRATIO_DIV224 (HRTIM_CHPR_CARFRQ_3 | HRTIM_CHPR_CARFRQ_2 | HRTIM_CHPR_CARFRQ_0) /*!< fCHPFRQ = fHRTIM / 224 */
1272 #define HRTIM_CHOPPER_PRESCALERRATIO_DIV240 (HRTIM_CHPR_CARFRQ_3 | HRTIM_CHPR_CARFRQ_2 | HRTIM_CHPR_CARFRQ_1) /*!< fCHPFRQ = fHRTIM / 240 */
1273 #define HRTIM_CHOPPER_PRESCALERRATIO_DIV256 (HRTIM_CHPR_CARFRQ_3 | HRTIM_CHPR_CARFRQ_2 | HRTIM_CHPR_CARFRQ_1 | HRTIM_CHPR_CARFRQ_0) /*!< fCHPFRQ = fHRTIM / 256 */
1278 /** @defgroup HRTIM_Chopper_Duty_Cycle HRTIM Chopper Duty Cycle
1280 * @brief Constants defining the duty cycle of the generated high frequency carrier
1281 * Duty cycle can be adjusted by 1/8 step (from 0/8 up to 7/8)
1283 #define HRTIM_CHOPPER_DUTYCYCLE_0 (0x000000U) /*!< Only 1st pulse is present */
1284 #define HRTIM_CHOPPER_DUTYCYCLE_125 (HRTIM_CHPR_CARDTY_0) /*!< Duty cycle of the carrier signal is 12.5U % */
1285 #define HRTIM_CHOPPER_DUTYCYCLE_250 (HRTIM_CHPR_CARDTY_1) /*!< Duty cycle of the carrier signal is 25U % */
1286 #define HRTIM_CHOPPER_DUTYCYCLE_375 (HRTIM_CHPR_CARDTY_1 | HRTIM_CHPR_CARDTY_0) /*!< Duty cycle of the carrier signal is 37.5U % */
1287 #define HRTIM_CHOPPER_DUTYCYCLE_500 (HRTIM_CHPR_CARDTY_2) /*!< Duty cycle of the carrier signal is 50U % */
1288 #define HRTIM_CHOPPER_DUTYCYCLE_625 (HRTIM_CHPR_CARDTY_2 | HRTIM_CHPR_CARDTY_0) /*!< Duty cycle of the carrier signal is 62.5U % */
1289 #define HRTIM_CHOPPER_DUTYCYCLE_750 (HRTIM_CHPR_CARDTY_2 | HRTIM_CHPR_CARDTY_1) /*!< Duty cycle of the carrier signal is 75U % */
1290 #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 % */
1295 /** @defgroup HRTIM_Chopper_Start_Pulse_Width HRTIM Chopper Start Pulse Width
1297 * @brief Constants defining the pulse width of the first pulse of the generated
1298 * high frequency carrier
1300 #define HRTIM_CHOPPER_PULSEWIDTH_16 (0x000000U) /*!< tSTPW = tHRTIM x 16 */
1301 #define HRTIM_CHOPPER_PULSEWIDTH_32 (HRTIM_CHPR_STRPW_0) /*!< tSTPW = tHRTIM x 32 */
1302 #define HRTIM_CHOPPER_PULSEWIDTH_48 (HRTIM_CHPR_STRPW_1) /*!< tSTPW = tHRTIM x 48 */
1303 #define HRTIM_CHOPPER_PULSEWIDTH_64 (HRTIM_CHPR_STRPW_1 | HRTIM_CHPR_STRPW_0) /*!< tSTPW = tHRTIM x 64 */
1304 #define HRTIM_CHOPPER_PULSEWIDTH_80 (HRTIM_CHPR_STRPW_2) /*!< tSTPW = tHRTIM x 80 */
1305 #define HRTIM_CHOPPER_PULSEWIDTH_96 (HRTIM_CHPR_STRPW_2 | HRTIM_CHPR_STRPW_0) /*!< tSTPW = tHRTIM x 96 */
1306 #define HRTIM_CHOPPER_PULSEWIDTH_112 (HRTIM_CHPR_STRPW_2 | HRTIM_CHPR_STRPW_1) /*!< tSTPW = tHRTIM x 112 */
1307 #define HRTIM_CHOPPER_PULSEWIDTH_128 (HRTIM_CHPR_STRPW_2 | HRTIM_CHPR_STRPW_1 | HRTIM_CHPR_STRPW_0) /*!< tSTPW = tHRTIM x 128 */
1308 #define HRTIM_CHOPPER_PULSEWIDTH_144 (HRTIM_CHPR_STRPW_3) /*!< tSTPW = tHRTIM x 144 */
1309 #define HRTIM_CHOPPER_PULSEWIDTH_160 (HRTIM_CHPR_STRPW_3 | HRTIM_CHPR_STRPW_0) /*!< tSTPW = tHRTIM x 160 */
1310 #define HRTIM_CHOPPER_PULSEWIDTH_176 (HRTIM_CHPR_STRPW_3 | HRTIM_CHPR_STRPW_1) /*!< tSTPW = tHRTIM x 176 */
1311 #define HRTIM_CHOPPER_PULSEWIDTH_192 (HRTIM_CHPR_STRPW_3 | HRTIM_CHPR_STRPW_1 | HRTIM_CHPR_STRPW_0) /*!< tSTPW = tHRTIM x 192 */
1312 #define HRTIM_CHOPPER_PULSEWIDTH_208 (HRTIM_CHPR_STRPW_3 | HRTIM_CHPR_STRPW_2) /*!< tSTPW = tHRTIM x 208 */
1313 #define HRTIM_CHOPPER_PULSEWIDTH_224 (HRTIM_CHPR_STRPW_3 | HRTIM_CHPR_STRPW_2 | HRTIM_CHPR_STRPW_0) /*!< tSTPW = tHRTIM x 224 */
1314 #define HRTIM_CHOPPER_PULSEWIDTH_240 (HRTIM_CHPR_STRPW_3 | HRTIM_CHPR_STRPW_2 | HRTIM_CHPR_STRPW_1) /*!< tSTPW = tHRTIM x 240 */
1315 #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 */
1320 /** @defgroup HRTIM_Synchronization_Options HRTIM Synchronization Options
1322 * @brief Constants defining the options for synchronizing multiple HRTIM
1323 * instances, as a master unit (generating a synchronization signal)
1324 * or as a slave (waiting for a trigger to be synchronized)
1326 #define HRTIM_SYNCOPTION_NONE 0x00000000U /*!< HRTIM instance doesn't handle external synchronization signals (SYNCIN, SYNCOUT) */
1327 #define HRTIM_SYNCOPTION_MASTER 0x00000001U /*!< HRTIM instance acts as a MASTER, i.e. generates external synchronization output (SYNCOUT)*/
1328 #define HRTIM_SYNCOPTION_SLAVE 0x00000002U /*!< HRTIM instance acts as a SLAVE, i.e. it is synchronized by external sources (SYNCIN) */
1333 /** @defgroup HRTIM_Synchronization_Input_Source HRTIM Synchronization Input Source
1335 * @brief Constants defining defining the synchronization input source
1337 #define HRTIM_SYNCINPUTSOURCE_NONE 0x00000000U /*!< disabled. HRTIM is not synchronized and runs in standalone mode */
1338 #define HRTIM_SYNCINPUTSOURCE_INTERNALEVENT HRTIM_MCR_SYNC_IN_1 /*!< The HRTIM is synchronized with the on-chip timer */
1339 #define HRTIM_SYNCINPUTSOURCE_EXTERNALEVENT (HRTIM_MCR_SYNC_IN_1 | HRTIM_MCR_SYNC_IN_0) /*!< A positive pulse on SYNCIN input triggers the HRTIM */
1344 /** @defgroup HRTIM_Synchronization_Output_Source HRTIM Synchronization Output Source
1346 * @brief Constants defining the source and event to be sent on the
1347 * synchronization outputs
1349 #define HRTIM_SYNCOUTPUTSOURCE_MASTER_START 0x00000000U /*!< A pulse is sent on the SYNCOUT output upon master timer start event */
1350 #define HRTIM_SYNCOUTPUTSOURCE_MASTER_CMP1 (HRTIM_MCR_SYNC_SRC_0) /*!< A pulse is sent on the SYNCOUT output upon master timer compare 1 event*/
1351 #define HRTIM_SYNCOUTPUTSOURCE_TIMA_START (HRTIM_MCR_SYNC_SRC_1) /*!< A pulse is sent on the SYNCOUT output upon timer A start or reset events */
1352 #define HRTIM_SYNCOUTPUTSOURCE_TIMA_CMP1 (HRTIM_MCR_SYNC_SRC_1 | HRTIM_MCR_SYNC_SRC_0) /*!< A pulse is sent on the SYNCOUT output upon timer A compare 1 event */
1357 /** @defgroup HRTIM_Synchronization_Output_Polarity HRTIM Synchronization Output Polarity
1359 * @brief Constants defining the routing and conditioning of the synchronization output event
1361 #define HRTIM_SYNCOUTPUTPOLARITY_NONE 0x00000000U /*!< Synchronization output event is disabled */
1362 #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 */
1363 #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 */
1368 /** @defgroup HRTIM_External_Event_Sources HRTIM External Event Sources
1370 * @brief Constants defining available sources associated to external events
1372 #define HRTIM_EVENTSRC_1 (0x00000000U) /*!< External event source 1U */
1373 #define HRTIM_EVENTSRC_2 (HRTIM_EECR1_EE1SRC_0) /*!< External event source 2U */
1374 #define HRTIM_EVENTSRC_3 (HRTIM_EECR1_EE1SRC_1) /*!< External event source 3U */
1375 #define HRTIM_EVENTSRC_4 (HRTIM_EECR1_EE1SRC_1 | HRTIM_EECR1_EE1SRC_0) /*!< External event source 4U */
1380 /** @defgroup HRTIM_External_Event_Polarity HRTIM External Event Polarity
1382 * @brief Constants defining the polarity of an external event
1384 #define HRTIM_EVENTPOLARITY_HIGH (0x00000000U) /*!< External event is active high */
1385 #define HRTIM_EVENTPOLARITY_LOW (HRTIM_EECR1_EE1POL) /*!< External event is active low */
1390 /** @defgroup HRTIM_External_Event_Sensitivity HRTIM External Event Sensitivity
1392 * @brief Constants defining the sensitivity (level-sensitive or edge-sensitive)
1393 * of an external event
1395 #define HRTIM_EVENTSENSITIVITY_LEVEL (0x00000000U) /*!< External event is active on level */
1396 #define HRTIM_EVENTSENSITIVITY_RISINGEDGE (HRTIM_EECR1_EE1SNS_0) /*!< External event is active on Rising edge */
1397 #define HRTIM_EVENTSENSITIVITY_FALLINGEDGE (HRTIM_EECR1_EE1SNS_1) /*!< External event is active on Falling edge */
1398 #define HRTIM_EVENTSENSITIVITY_BOTHEDGES (HRTIM_EECR1_EE1SNS_1 | HRTIM_EECR1_EE1SNS_0) /*!< External event is active on Rising and Falling edges */
1403 /** @defgroup HRTIM_External_Event_Fast_Mode HRTIM External Event Fast Mode
1405 * @brief Constants defining whether or not an external event is programmed in
1408 #define HRTIM_EVENTFASTMODE_DISABLE (0x00000000U) /*!< External Event is re-synchronized by the HRTIM logic before acting on outputs */
1409 #define HRTIM_EVENTFASTMODE_ENABLE (HRTIM_EECR1_EE1FAST) /*!< External Event is acting asynchronously on outputs (low latency mode) */
1414 /** @defgroup HRTIM_External_Event_Filter HRTIM External Event Filter
1416 * @brief Constants defining the frequency used to sample an external event 6
1417 * input and the length (N) of the digital filter applied
1419 #define HRTIM_EVENTFILTER_NONE (0x00000000U) /*!< Filter disabled */
1420 #define HRTIM_EVENTFILTER_1 (HRTIM_EECR3_EE6F_0) /*!< fSAMPLING= fHRTIM, N=2U */
1421 #define HRTIM_EVENTFILTER_2 (HRTIM_EECR3_EE6F_1) /*!< fSAMPLING= fHRTIM, N=4U */
1422 #define HRTIM_EVENTFILTER_3 (HRTIM_EECR3_EE6F_1 | HRTIM_EECR3_EE6F_0) /*!< fSAMPLING= fHRTIM, N=8U */
1423 #define HRTIM_EVENTFILTER_4 (HRTIM_EECR3_EE6F_2) /*!< fSAMPLING= fEEVS/2U, N=6U */
1424 #define HRTIM_EVENTFILTER_5 (HRTIM_EECR3_EE6F_2 | HRTIM_EECR3_EE6F_0) /*!< fSAMPLING= fEEVS/2U, N=8U */
1425 #define HRTIM_EVENTFILTER_6 (HRTIM_EECR3_EE6F_2 | HRTIM_EECR3_EE6F_1) /*!< fSAMPLING= fEEVS/4U, N=6U */
1426 #define HRTIM_EVENTFILTER_7 (HRTIM_EECR3_EE6F_2 | HRTIM_EECR3_EE6F_1 | HRTIM_EECR3_EE6F_0) /*!< fSAMPLING= fEEVS/4U, N=8U */
1427 #define HRTIM_EVENTFILTER_8 (HRTIM_EECR3_EE6F_3) /*!< fSAMPLING= fEEVS/8U, N=6U */
1428 #define HRTIM_EVENTFILTER_9 (HRTIM_EECR3_EE6F_3 | HRTIM_EECR3_EE6F_0) /*!< fSAMPLING= fEEVS/8U, N=8U */
1429 #define HRTIM_EVENTFILTER_10 (HRTIM_EECR3_EE6F_3 | HRTIM_EECR3_EE6F_1) /*!< fSAMPLING= fEEVS/16U, N=5U */
1430 #define HRTIM_EVENTFILTER_11 (HRTIM_EECR3_EE6F_3 | HRTIM_EECR3_EE6F_1 | HRTIM_EECR3_EE6F_0) /*!< fSAMPLING= fEEVS/16U, N=6U */
1431 #define HRTIM_EVENTFILTER_12 (HRTIM_EECR3_EE6F_3 | HRTIM_EECR3_EE6F_2) /*!< fSAMPLING= fEEVS/16U, N=8U */
1432 #define HRTIM_EVENTFILTER_13 (HRTIM_EECR3_EE6F_3 | HRTIM_EECR3_EE6F_2 | HRTIM_EECR3_EE6F_0) /*!< fSAMPLING= fEEVS/32U, N=5U */
1433 #define HRTIM_EVENTFILTER_14 (HRTIM_EECR3_EE6F_3 | HRTIM_EECR3_EE6F_2 | HRTIM_EECR3_EE6F_1) /*!< fSAMPLING= fEEVS/32U, N=6U */
1434 #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 */
1439 /** @defgroup HRTIM_External_Event_Prescaler HRTIM External Event Prescaler
1441 * @brief Constants defining division ratio between the timer clock frequency
1442 * fHRTIM) and the external event signal sampling clock (fEEVS)
1443 * used by the digital filters
1445 #define HRTIM_EVENTPRESCALER_DIV1 (0x00000000U) /*!< fEEVS=fHRTIM */
1446 #define HRTIM_EVENTPRESCALER_DIV2 (HRTIM_EECR3_EEVSD_0) /*!< fEEVS=fHRTIM / 2U */
1447 #define HRTIM_EVENTPRESCALER_DIV4 (HRTIM_EECR3_EEVSD_1) /*!< fEEVS=fHRTIM / 4U */
1448 #define HRTIM_EVENTPRESCALER_DIV8 (HRTIM_EECR3_EEVSD_1 | HRTIM_EECR3_EEVSD_0) /*!< fEEVS=fHRTIM / 8U */
1453 /** @defgroup HRTIM_Fault_Sources HRTIM Fault Sources
1455 * @brief Constants defining whether a fault is triggered by any external
1456 * or internal fault source
1458 #define HRTIM_FAULTSOURCE_DIGITALINPUT (0x00000000U) /*!< Fault input is FLT input pin */
1459 #define HRTIM_FAULTSOURCE_INTERNAL (HRTIM_FLTINR1_FLT1SRC) /*!< Fault input is FLT_Int signal (e.g. internal comparator) */
1464 /** @defgroup HRTIM_Fault_Polarity HRTIM Fault Polarity
1466 * @brief Constants defining the polarity of a fault event
1468 #define HRTIM_FAULTPOLARITY_LOW (0x00000000U) /*!< Fault input is active low */
1469 #define HRTIM_FAULTPOLARITY_HIGH (HRTIM_FLTINR1_FLT1P) /*!< Fault input is active high */
1474 /** @defgroup HRTIM_Fault_Filter HRTIM Fault Filter
1476 * @ brief Constants defining the frequency used to sample the fault input and
1477 * the length (N) of the digital filter applied
1479 #define HRTIM_FAULTFILTER_NONE (0x00000000U) /*!< Filter disabled */
1480 #define HRTIM_FAULTFILTER_1 (HRTIM_FLTINR1_FLT1F_0) /*!< fSAMPLING= fHRTIM, N=2U */
1481 #define HRTIM_FAULTFILTER_2 (HRTIM_FLTINR1_FLT1F_1) /*!< fSAMPLING= fHRTIM, N=4U */
1482 #define HRTIM_FAULTFILTER_3 (HRTIM_FLTINR1_FLT1F_1 | HRTIM_FLTINR1_FLT1F_0) /*!< fSAMPLING= fHRTIM, N=8U */
1483 #define HRTIM_FAULTFILTER_4 (HRTIM_FLTINR1_FLT1F_2) /*!< fSAMPLING= fFLTS/2U, N=6U */
1484 #define HRTIM_FAULTFILTER_5 (HRTIM_FLTINR1_FLT1F_2 | HRTIM_FLTINR1_FLT1F_0) /*!< fSAMPLING= fFLTS/2U, N=8U */
1485 #define HRTIM_FAULTFILTER_6 (HRTIM_FLTINR1_FLT1F_2 | HRTIM_FLTINR1_FLT1F_1) /*!< fSAMPLING= fFLTS/4U, N=6U */
1486 #define HRTIM_FAULTFILTER_7 (HRTIM_FLTINR1_FLT1F_2 | HRTIM_FLTINR1_FLT1F_1 | HRTIM_FLTINR1_FLT1F_0) /*!< fSAMPLING= fFLTS/4U, N=8U */
1487 #define HRTIM_FAULTFILTER_8 (HRTIM_FLTINR1_FLT1F_3) /*!< fSAMPLING= fFLTS/8U, N=6U */
1488 #define HRTIM_FAULTFILTER_9 (HRTIM_FLTINR1_FLT1F_3 | HRTIM_FLTINR1_FLT1F_0) /*!< fSAMPLING= fFLTS/8U, N=8U */
1489 #define HRTIM_FAULTFILTER_10 (HRTIM_FLTINR1_FLT1F_3 | HRTIM_FLTINR1_FLT1F_1) /*!< fSAMPLING= fFLTS/16U, N=5U */
1490 #define HRTIM_FAULTFILTER_11 (HRTIM_FLTINR1_FLT1F_3 | HRTIM_FLTINR1_FLT1F_1 | HRTIM_FLTINR1_FLT1F_0) /*!< fSAMPLING= fFLTS/16U, N=6U */
1491 #define HRTIM_FAULTFILTER_12 (HRTIM_FLTINR1_FLT1F_3 | HRTIM_FLTINR1_FLT1F_2) /*!< fSAMPLING= fFLTS/16U, N=8U */
1492 #define HRTIM_FAULTFILTER_13 (HRTIM_FLTINR1_FLT1F_3 | HRTIM_FLTINR1_FLT1F_2 | HRTIM_FLTINR1_FLT1F_0) /*!< fSAMPLING= fFLTS/32U, N=5U */
1493 #define HRTIM_FAULTFILTER_14 (HRTIM_FLTINR1_FLT1F_3 | HRTIM_FLTINR1_FLT1F_2 | HRTIM_FLTINR1_FLT1F_1) /*!< fSAMPLING= fFLTS/32U, N=6U */
1494 #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 */
1499 /** @defgroup HRTIM_Fault_Lock HRTIM Fault Lock
1501 * @brief Constants defining whether or not the fault programming bits are
1504 #define HRTIM_FAULTLOCK_READWRITE (0x00000000U) /*!< Fault settings bits are read/write */
1505 #define HRTIM_FAULTLOCK_READONLY (HRTIM_FLTINR1_FLT1LCK) /*!< Fault settings bits are read only */
1510 /** @defgroup HRTIM_External_Fault_Prescaler HRTIM External Fault Prescaler
1512 * @brief Constants defining the division ratio between the timer clock
1513 * frequency (fHRTIM) and the fault signal sampling clock (fFLTS) used
1514 * by the digital filters.
1516 #define HRTIM_FAULTPRESCALER_DIV1 (0x00000000U) /*!< fFLTS=fHRTIM */
1517 #define HRTIM_FAULTPRESCALER_DIV2 (HRTIM_FLTINR2_FLTSD_0) /*!< fFLTS=fHRTIM / 2U */
1518 #define HRTIM_FAULTPRESCALER_DIV4 (HRTIM_FLTINR2_FLTSD_1) /*!< fFLTS=fHRTIM / 4U */
1519 #define HRTIM_FAULTPRESCALER_DIV8 (HRTIM_FLTINR2_FLTSD_1 | HRTIM_FLTINR2_FLTSD_0) /*!< fFLTS=fHRTIM / 8U */
1524 /** @defgroup HRTIM_Burst_Mode_Operating_Mode HRTIM Burst Mode Operating Mode
1526 * @brief Constants defining if the burst mode is entered once or if it is
1527 * continuously operating
1529 #define HRTIM_BURSTMODE_SINGLESHOT (0x00000000U) /*!< Burst mode operates in single shot mode */
1530 #define HRTIM_BURSTMODE_CONTINOUS (HRTIM_BMCR_BMOM) /*!< Burst mode operates in continuous mode */
1535 /** @defgroup HRTIM_Burst_Mode_Clock_Source HRTIM Burst Mode Clock Source
1537 * @brief Constants defining the clock source for the burst mode counter
1539 #define HRTIM_BURSTMODECLOCKSOURCE_MASTER (0x00000000U) /*!< Master timer counter reset/roll-over is used as clock source for the burst mode counter */
1540 #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 */
1541 #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 */
1542 #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 */
1543 #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 */
1544 #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 */
1545 #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 */
1546 #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 */
1547 #define HRTIM_BURSTMODECLOCKSOURCE_TIM7_TRGO (HRTIM_BMCR_BMCLK_3) /*!< On-chip Event 3 (BMClk[3]), acting as a burst mode counter clock */
1548 #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 */
1553 /** @defgroup HRTIM_Burst_Mode_Prescaler HRTIM Burst Mode Prescaler
1555 * @brief Constants defining the prescaling ratio of the fHRTIM clock
1556 * for the burst mode controller
1558 #define HRTIM_BURSTMODEPRESCALER_DIV1 (0x00000000U) /*!< fBRST = fHRTIM */
1559 #define HRTIM_BURSTMODEPRESCALER_DIV2 (HRTIM_BMCR_BMPRSC_0) /*!< fBRST = fHRTIM/2U */
1560 #define HRTIM_BURSTMODEPRESCALER_DIV4 (HRTIM_BMCR_BMPRSC_1) /*!< fBRST = fHRTIM/4U */
1561 #define HRTIM_BURSTMODEPRESCALER_DIV8 (HRTIM_BMCR_BMPRSC_1 | HRTIM_BMCR_BMPRSC_0) /*!< fBRST = fHRTIM/8U */
1562 #define HRTIM_BURSTMODEPRESCALER_DIV16 (HRTIM_BMCR_BMPRSC_2) /*!< fBRST = fHRTIM/16U */
1563 #define HRTIM_BURSTMODEPRESCALER_DIV32 (HRTIM_BMCR_BMPRSC_2 | HRTIM_BMCR_BMPRSC_0) /*!< fBRST = fHRTIM/32U */
1564 #define HRTIM_BURSTMODEPRESCALER_DIV64 (HRTIM_BMCR_BMPRSC_2 | HRTIM_BMCR_BMPRSC_1) /*!< fBRST = fHRTIM/64U */
1565 #define HRTIM_BURSTMODEPRESCALER_DIV128 (HRTIM_BMCR_BMPRSC_2 | HRTIM_BMCR_BMPRSC_1 | HRTIM_BMCR_BMPRSC_0) /*!< fBRST = fHRTIM/128U */
1566 #define HRTIM_BURSTMODEPRESCALER_DIV256 (HRTIM_BMCR_BMPRSC_3) /*!< fBRST = fHRTIM/256U */
1567 #define HRTIM_BURSTMODEPRESCALER_DIV512 (HRTIM_BMCR_BMPRSC_3 | HRTIM_BMCR_BMPRSC_0) /*!< fBRST = fHRTIM/512U */
1568 #define HRTIM_BURSTMODEPRESCALER_DIV1024 (HRTIM_BMCR_BMPRSC_3 | HRTIM_BMCR_BMPRSC_1) /*!< fBRST = fHRTIM/1024U */
1569 #define HRTIM_BURSTMODEPRESCALER_DIV2048 (HRTIM_BMCR_BMPRSC_3 | HRTIM_BMCR_BMPRSC_1 | HRTIM_BMCR_BMPRSC_0) /*!< fBRST = fHRTIM/2048U*/
1570 #define HRTIM_BURSTMODEPRESCALER_DIV4096 (HRTIM_BMCR_BMPRSC_3 | HRTIM_BMCR_BMPRSC_2) /*!< fBRST = fHRTIM/4096U */
1571 #define HRTIM_BURSTMODEPRESCALER_DIV8192 (HRTIM_BMCR_BMPRSC_3 | HRTIM_BMCR_BMPRSC_2 | HRTIM_BMCR_BMPRSC_0) /*!< fBRST = fHRTIM/8192U */
1572 #define HRTIM_BURSTMODEPRESCALER_DIV16384 (HRTIM_BMCR_BMPRSC_3 | HRTIM_BMCR_BMPRSC_2 | HRTIM_BMCR_BMPRSC_1) /*!< fBRST = fHRTIM/16384U */
1573 #define HRTIM_BURSTMODEPRESCALER_DIV32768 (HRTIM_BMCR_BMPRSC_3 | HRTIM_BMCR_BMPRSC_2 | HRTIM_BMCR_BMPRSC_1 | HRTIM_BMCR_BMPRSC_0) /*!< fBRST = fHRTIM/32768U */
1578 /** @defgroup HRTIM_Burst_Mode_Register_Preload_Enable HRTIM Burst Mode Register Preload Enable
1580 * @brief Constants defining whether or not burst mode registers preload
1581 mechanism is enabled, i.e. a write access into a preloadable register
1582 (HRTIM_BMCMPR, HRTIM_BMPER) is done into the active or the preload register
1584 #define HRIM_BURSTMODEPRELOAD_DISABLED (0x00000000U) /*!< Preload disabled: the write access is directly done into active registers */
1585 #define HRIM_BURSTMODEPRELOAD_ENABLED (HRTIM_BMCR_BMPREN) /*!< Preload enabled: the write access is done into preload registers */
1590 /** @defgroup HRTIM_Burst_Mode_Trigger HRTIM Burst Mode Trigger
1592 * @brief Constants defining the events that can be used to trig the burst
1595 #define HRTIM_BURSTMODETRIGGER_NONE 0x00000000U /*!< No trigger */
1596 #define HRTIM_BURSTMODETRIGGER_MASTER_RESET (HRTIM_BMTRGR_MSTRST) /*!< Master reset */
1597 #define HRTIM_BURSTMODETRIGGER_MASTER_REPETITION (HRTIM_BMTRGR_MSTREP) /*!< Master repetition */
1598 #define HRTIM_BURSTMODETRIGGER_MASTER_CMP1 (HRTIM_BMTRGR_MSTCMP1) /*!< Master compare 1U */
1599 #define HRTIM_BURSTMODETRIGGER_MASTER_CMP2 (HRTIM_BMTRGR_MSTCMP2) /*!< Master compare 2U */
1600 #define HRTIM_BURSTMODETRIGGER_MASTER_CMP3 (HRTIM_BMTRGR_MSTCMP3) /*!< Master compare 3U */
1601 #define HRTIM_BURSTMODETRIGGER_MASTER_CMP4 (HRTIM_BMTRGR_MSTCMP4) /*!< Master compare 4U */
1602 #define HRTIM_BURSTMODETRIGGER_TIMERA_RESET (HRTIM_BMTRGR_TARST) /*!< Timer A reset */
1603 #define HRTIM_BURSTMODETRIGGER_TIMERA_REPETITION (HRTIM_BMTRGR_TAREP) /*!< Timer A repetition */
1604 #define HRTIM_BURSTMODETRIGGER_TIMERA_CMP1 (HRTIM_BMTRGR_TACMP1) /*!< Timer A compare 1 */
1605 #define HRTIM_BURSTMODETRIGGER_TIMERA_CMP2 (HRTIM_BMTRGR_TACMP2) /*!< Timer A compare 2 */
1606 #define HRTIM_BURSTMODETRIGGER_TIMERB_RESET (HRTIM_BMTRGR_TBRST) /*!< Timer B reset */
1607 #define HRTIM_BURSTMODETRIGGER_TIMERB_REPETITION (HRTIM_BMTRGR_TBREP) /*!< Timer B repetition */
1608 #define HRTIM_BURSTMODETRIGGER_TIMERB_CMP1 (HRTIM_BMTRGR_TBCMP1) /*!< Timer B compare 1 */
1609 #define HRTIM_BURSTMODETRIGGER_TIMERB_CMP2 (HRTIM_BMTRGR_TBCMP2) /*!< Timer B compare 2 */
1610 #define HRTIM_BURSTMODETRIGGER_TIMERC_RESET (HRTIM_BMTRGR_TCRST) /*!< Timer C reset */
1611 #define HRTIM_BURSTMODETRIGGER_TIMERC_REPETITION (HRTIM_BMTRGR_TCREP) /*!< Timer C repetition */
1612 #define HRTIM_BURSTMODETRIGGER_TIMERC_CMP1 (HRTIM_BMTRGR_TCCMP1) /*!< Timer C compare 1 */
1613 #define HRTIM_BURSTMODETRIGGER_TIMERC_CMP2 (HRTIM_BMTRGR_TCCMP2) /*!< Timer C compare 2 */
1614 #define HRTIM_BURSTMODETRIGGER_TIMERD_RESET (HRTIM_BMTRGR_TDRST) /*!< Timer D reset */
1615 #define HRTIM_BURSTMODETRIGGER_TIMERD_REPETITION (HRTIM_BMTRGR_TDREP) /*!< Timer D repetition */
1616 #define HRTIM_BURSTMODETRIGGER_TIMERD_CMP1 (HRTIM_BMTRGR_TDCMP1) /*!< Timer D compare 1 */
1617 #define HRTIM_BURSTMODETRIGGER_TIMERD_CMP2 (HRTIM_BMTRGR_TDCMP2) /*!< Timer D compare 2 */
1618 #define HRTIM_BURSTMODETRIGGER_TIMERE_RESET (HRTIM_BMTRGR_TERST) /*!< Timer E reset */
1619 #define HRTIM_BURSTMODETRIGGER_TIMERE_REPETITION (HRTIM_BMTRGR_TEREP) /*!< Timer E repetition */
1620 #define HRTIM_BURSTMODETRIGGER_TIMERE_CMP1 (HRTIM_BMTRGR_TECMP1) /*!< Timer E compare 1 */
1621 #define HRTIM_BURSTMODETRIGGER_TIMERE_CMP2 (HRTIM_BMTRGR_TECMP2) /*!< Timer E compare 2 */
1622 #define HRTIM_BURSTMODETRIGGER_TIMERA_EVENT7 (HRTIM_BMTRGR_TAEEV7) /*!< Timer A period following External Event 7 */
1623 #define HRTIM_BURSTMODETRIGGER_TIMERD_EVENT8 (HRTIM_BMTRGR_TDEEV8) /*!< Timer D period following External Event 8 */
1624 #define HRTIM_BURSTMODETRIGGER_EVENT_7 (HRTIM_BMTRGR_EEV7) /*!< External Event 7 (timer A filters applied) */
1625 #define HRTIM_BURSTMODETRIGGER_EVENT_8 (HRTIM_BMTRGR_EEV8) /*!< External Event 8 (timer D filters applied)*/
1626 #define HRTIM_BURSTMODETRIGGER_EVENT_ONCHIP (HRTIM_BMTRGR_OCHPEV) /*!< On-chip Event */
1631 /** @defgroup HRTIM_ADC_Trigger_Update_Source HRTIM ADC Trigger Update Source
1633 * @brief constants defining the source triggering the update of the
1634 HRTIM_ADCxR register (transfer from preload to active register).
1636 #define HRTIM_ADCTRIGGERUPDATE_MASTER 0x00000000U /*!< Master timer */
1637 #define HRTIM_ADCTRIGGERUPDATE_TIMER_A (HRTIM_CR1_ADC1USRC_0) /*!< Timer A */
1638 #define HRTIM_ADCTRIGGERUPDATE_TIMER_B (HRTIM_CR1_ADC1USRC_1) /*!< Timer B */
1639 #define HRTIM_ADCTRIGGERUPDATE_TIMER_C (HRTIM_CR1_ADC1USRC_1 | HRTIM_CR1_ADC1USRC_0) /*!< Timer C */
1640 #define HRTIM_ADCTRIGGERUPDATE_TIMER_D (HRTIM_CR1_ADC1USRC_2) /*!< Timer D */
1641 #define HRTIM_ADCTRIGGERUPDATE_TIMER_E (HRTIM_CR1_ADC1USRC_2 | HRTIM_CR1_ADC1USRC_0) /*!< Timer E */
1646 /** @defgroup HRTIM_ADC_Trigger_Event HRTIM ADC Trigger Event
1648 * @brief constants defining the events triggering ADC conversion.
1649 * HRTIM_ADCTRIGGEREVENT13_*: ADC Triggers 1 and 3
1650 * HRTIM_ADCTRIGGEREVENT24_*: ADC Triggers 2 and 4
1652 #define HRTIM_ADCTRIGGEREVENT13_NONE 0x00000000U /*!< No ADC trigger event */
1653 #define HRTIM_ADCTRIGGEREVENT13_MASTER_CMP1 (HRTIM_ADC1R_AD1MC1) /*!< ADC Trigger on master compare 1U */
1654 #define HRTIM_ADCTRIGGEREVENT13_MASTER_CMP2 (HRTIM_ADC1R_AD1MC2) /*!< ADC Trigger on master compare 2U */
1655 #define HRTIM_ADCTRIGGEREVENT13_MASTER_CMP3 (HRTIM_ADC1R_AD1MC3) /*!< ADC Trigger on master compare 3U */
1656 #define HRTIM_ADCTRIGGEREVENT13_MASTER_CMP4 (HRTIM_ADC1R_AD1MC4) /*!< ADC Trigger on master compare 4U */
1657 #define HRTIM_ADCTRIGGEREVENT13_MASTER_PERIOD (HRTIM_ADC1R_AD1MPER) /*!< ADC Trigger on master period */
1658 #define HRTIM_ADCTRIGGEREVENT13_EVENT_1 (HRTIM_ADC1R_AD1EEV1) /*!< ADC Trigger on external event 1U */
1659 #define HRTIM_ADCTRIGGEREVENT13_EVENT_2 (HRTIM_ADC1R_AD1EEV2) /*!< ADC Trigger on external event 2U */
1660 #define HRTIM_ADCTRIGGEREVENT13_EVENT_3 (HRTIM_ADC1R_AD1EEV3) /*!< ADC Trigger on external event 3U */
1661 #define HRTIM_ADCTRIGGEREVENT13_EVENT_4 (HRTIM_ADC1R_AD1EEV4) /*!< ADC Trigger on external event 4U */
1662 #define HRTIM_ADCTRIGGEREVENT13_EVENT_5 (HRTIM_ADC1R_AD1EEV5) /*!< ADC Trigger on external event 5U */
1663 #define HRTIM_ADCTRIGGEREVENT13_TIMERA_CMP2 (HRTIM_ADC1R_AD1TAC2) /*!< ADC Trigger on Timer A compare 2U */
1664 #define HRTIM_ADCTRIGGEREVENT13_TIMERA_CMP3 (HRTIM_ADC1R_AD1TAC3) /*!< ADC Trigger on Timer A compare 3U */
1665 #define HRTIM_ADCTRIGGEREVENT13_TIMERA_CMP4 (HRTIM_ADC1R_AD1TAC4) /*!< ADC Trigger on Timer A compare 4U */
1666 #define HRTIM_ADCTRIGGEREVENT13_TIMERA_PERIOD (HRTIM_ADC1R_AD1TAPER) /*!< ADC Trigger on Timer A period */
1667 #define HRTIM_ADCTRIGGEREVENT13_TIMERA_RESET (HRTIM_ADC1R_AD1TARST) /*!< ADC Trigger on Timer A reset */
1668 #define HRTIM_ADCTRIGGEREVENT13_TIMERB_CMP2 (HRTIM_ADC1R_AD1TBC2) /*!< ADC Trigger on Timer B compare 2U */
1669 #define HRTIM_ADCTRIGGEREVENT13_TIMERB_CMP3 (HRTIM_ADC1R_AD1TBC3) /*!< ADC Trigger on Timer B compare 3U */
1670 #define HRTIM_ADCTRIGGEREVENT13_TIMERB_CMP4 (HRTIM_ADC1R_AD1TBC4) /*!< ADC Trigger on Timer B compare 4U */
1671 #define HRTIM_ADCTRIGGEREVENT13_TIMERB_PERIOD (HRTIM_ADC1R_AD1TBPER) /*!< ADC Trigger on Timer B period */
1672 #define HRTIM_ADCTRIGGEREVENT13_TIMERB_RESET (HRTIM_ADC1R_AD1TBRST) /*!< ADC Trigger on Timer B reset */
1673 #define HRTIM_ADCTRIGGEREVENT13_TIMERC_CMP2 (HRTIM_ADC1R_AD1TCC2) /*!< ADC Trigger on Timer C compare 2U */
1674 #define HRTIM_ADCTRIGGEREVENT13_TIMERC_CMP3 (HRTIM_ADC1R_AD1TCC3) /*!< ADC Trigger on Timer C compare 3U */
1675 #define HRTIM_ADCTRIGGEREVENT13_TIMERC_CMP4 (HRTIM_ADC1R_AD1TCC4) /*!< ADC Trigger on Timer C compare 4U */
1676 #define HRTIM_ADCTRIGGEREVENT13_TIMERC_PERIOD (HRTIM_ADC1R_AD1TCPER) /*!< ADC Trigger on Timer C period */
1677 #define HRTIM_ADCTRIGGEREVENT13_TIMERD_CMP2 (HRTIM_ADC1R_AD1TDC2) /*!< ADC Trigger on Timer D compare 2U */
1678 #define HRTIM_ADCTRIGGEREVENT13_TIMERD_CMP3 (HRTIM_ADC1R_AD1TDC3) /*!< ADC Trigger on Timer D compare 3U */
1679 #define HRTIM_ADCTRIGGEREVENT13_TIMERD_CMP4 (HRTIM_ADC1R_AD1TDC4) /*!< ADC Trigger on Timer D compare 4U */
1680 #define HRTIM_ADCTRIGGEREVENT13_TIMERD_PERIOD (HRTIM_ADC1R_AD1TDPER) /*!< ADC Trigger on Timer D period */
1681 #define HRTIM_ADCTRIGGEREVENT13_TIMERE_CMP2 (HRTIM_ADC1R_AD1TEC2) /*!< ADC Trigger on Timer E compare 2U */
1682 #define HRTIM_ADCTRIGGEREVENT13_TIMERE_CMP3 (HRTIM_ADC1R_AD1TEC3) /*!< ADC Trigger on Timer E compare 3U */
1683 #define HRTIM_ADCTRIGGEREVENT13_TIMERE_CMP4 (HRTIM_ADC1R_AD1TEC4) /*!< ADC Trigger on Timer E compare 4U */
1684 #define HRTIM_ADCTRIGGEREVENT13_TIMERE_PERIOD (HRTIM_ADC1R_AD1TEPER) /*!< ADC Trigger on Timer E period */
1686 #define HRTIM_ADCTRIGGEREVENT24_NONE 0x00000000U /*!< No ADC trigger event */
1687 #define HRTIM_ADCTRIGGEREVENT24_MASTER_CMP1 (HRTIM_ADC2R_AD2MC1) /*!< ADC Trigger on master compare 1U */
1688 #define HRTIM_ADCTRIGGEREVENT24_MASTER_CMP2 (HRTIM_ADC2R_AD2MC2) /*!< ADC Trigger on master compare 2U */
1689 #define HRTIM_ADCTRIGGEREVENT24_MASTER_CMP3 (HRTIM_ADC2R_AD2MC3) /*!< ADC Trigger on master compare 3U */
1690 #define HRTIM_ADCTRIGGEREVENT24_MASTER_CMP4 (HRTIM_ADC2R_AD2MC4) /*!< ADC Trigger on master compare 4U */
1691 #define HRTIM_ADCTRIGGEREVENT24_MASTER_PERIOD (HRTIM_ADC2R_AD2MPER) /*!< ADC Trigger on master period */
1692 #define HRTIM_ADCTRIGGEREVENT24_EVENT_6 (HRTIM_ADC2R_AD2EEV6) /*!< ADC Trigger on external event 6U */
1693 #define HRTIM_ADCTRIGGEREVENT24_EVENT_7 (HRTIM_ADC2R_AD2EEV7) /*!< ADC Trigger on external event 7U */
1694 #define HRTIM_ADCTRIGGEREVENT24_EVENT_8 (HRTIM_ADC2R_AD2EEV8) /*!< ADC Trigger on external event 8U */
1695 #define HRTIM_ADCTRIGGEREVENT24_EVENT_9 (HRTIM_ADC2R_AD2EEV9) /*!< ADC Trigger on external event 9U */
1696 #define HRTIM_ADCTRIGGEREVENT24_EVENT_10 (HRTIM_ADC2R_AD2EEV10) /*!< ADC Trigger on external event 10U */
1697 #define HRTIM_ADCTRIGGEREVENT24_TIMERA_CMP2 (HRTIM_ADC2R_AD2TAC2) /*!< ADC Trigger on Timer A compare 2U */
1698 #define HRTIM_ADCTRIGGEREVENT24_TIMERA_CMP3 (HRTIM_ADC2R_AD2TAC3) /*!< ADC Trigger on Timer A compare 3U */
1699 #define HRTIM_ADCTRIGGEREVENT24_TIMERA_CMP4 (HRTIM_ADC2R_AD2TAC4) /*!< ADC Trigger on Timer A compare 4U */
1700 #define HRTIM_ADCTRIGGEREVENT24_TIMERA_PERIOD (HRTIM_ADC2R_AD2TAPER) /*!< ADC Trigger on Timer A period */
1701 #define HRTIM_ADCTRIGGEREVENT24_TIMERB_CMP2 (HRTIM_ADC2R_AD2TBC2) /*!< ADC Trigger on Timer B compare 2U */
1702 #define HRTIM_ADCTRIGGEREVENT24_TIMERB_CMP3 (HRTIM_ADC2R_AD2TBC3) /*!< ADC Trigger on Timer B compare 3U */
1703 #define HRTIM_ADCTRIGGEREVENT24_TIMERB_CMP4 (HRTIM_ADC2R_AD2TBC4) /*!< ADC Trigger on Timer B compare 4U */
1704 #define HRTIM_ADCTRIGGEREVENT24_TIMERB_PERIOD (HRTIM_ADC2R_AD2TBPER) /*!< ADC Trigger on Timer B period */
1705 #define HRTIM_ADCTRIGGEREVENT24_TIMERC_CMP2 (HRTIM_ADC2R_AD2TCC2) /*!< ADC Trigger on Timer C compare 2U */
1706 #define HRTIM_ADCTRIGGEREVENT24_TIMERC_CMP3 (HRTIM_ADC2R_AD2TCC3) /*!< ADC Trigger on Timer C compare 3U */
1707 #define HRTIM_ADCTRIGGEREVENT24_TIMERC_CMP4 (HRTIM_ADC2R_AD2TCC4) /*!< ADC Trigger on Timer C compare 4U */
1708 #define HRTIM_ADCTRIGGEREVENT24_TIMERC_PERIOD (HRTIM_ADC2R_AD2TCPER) /*!< ADC Trigger on Timer C period */
1709 #define HRTIM_ADCTRIGGEREVENT24_TIMERC_RESET (HRTIM_ADC2R_AD2TCRST) /*!< ADC Trigger on Timer C reset */
1710 #define HRTIM_ADCTRIGGEREVENT24_TIMERD_CMP2 (HRTIM_ADC2R_AD2TDC2) /*!< ADC Trigger on Timer D compare 2U */
1711 #define HRTIM_ADCTRIGGEREVENT24_TIMERD_CMP3 (HRTIM_ADC2R_AD2TDC3) /*!< ADC Trigger on Timer D compare 3U */
1712 #define HRTIM_ADCTRIGGEREVENT24_TIMERD_CMP4 (HRTIM_ADC2R_AD2TDC4) /*!< ADC Trigger on Timer D compare 4U */
1713 #define HRTIM_ADCTRIGGEREVENT24_TIMERD_PERIOD (HRTIM_ADC2R_AD2TDPER) /*!< ADC Trigger on Timer D period */
1714 #define HRTIM_ADCTRIGGEREVENT24_TIMERD_RESET (HRTIM_ADC2R_AD2TDRST) /*!< ADC Trigger on Timer D reset */
1715 #define HRTIM_ADCTRIGGEREVENT24_TIMERE_CMP2 (HRTIM_ADC2R_AD2TEC2) /*!< ADC Trigger on Timer E compare 2U */
1716 #define HRTIM_ADCTRIGGEREVENT24_TIMERE_CMP3 (HRTIM_ADC2R_AD2TEC3) /*!< ADC Trigger on Timer E compare 3U */
1717 #define HRTIM_ADCTRIGGEREVENT24_TIMERE_CMP4 (HRTIM_ADC2R_AD2TEC4) /*!< ADC Trigger on Timer E compare 4U */
1718 #define HRTIM_ADCTRIGGEREVENT24_TIMERE_RESET (HRTIM_ADC2R_AD2TERST) /*!< ADC Trigger on Timer E reset */
1724 /** @defgroup HRTIM_Burst_DMA_Registers_Update HRTIM Burst DMA Registers Update
1726 * @brief Constants defining the registers that can be written during a burst
1729 #define HRTIM_BURSTDMA_NONE 0x00000000U /*!< No register is updated by Burst DMA accesses */
1730 #define HRTIM_BURSTDMA_CR (HRTIM_BDTUPR_TIMCR) /*!< MCR or TIMxCR register is updated by Burst DMA accesses */
1731 #define HRTIM_BURSTDMA_ICR (HRTIM_BDTUPR_TIMICR) /*!< MICR or TIMxICR register is updated by Burst DMA accesses */
1732 #define HRTIM_BURSTDMA_DIER (HRTIM_BDTUPR_TIMDIER) /*!< MDIER or TIMxDIER register is updated by Burst DMA accesses */
1733 #define HRTIM_BURSTDMA_CNT (HRTIM_BDTUPR_TIMCNT) /*!< MCNTR or CNTxCR register is updated by Burst DMA accesses */
1734 #define HRTIM_BURSTDMA_PER (HRTIM_BDTUPR_TIMPER) /*!< MPER or PERxR register is updated by Burst DMA accesses */
1735 #define HRTIM_BURSTDMA_REP (HRTIM_BDTUPR_TIMREP) /*!< MREPR or REPxR register is updated by Burst DMA accesses */
1736 #define HRTIM_BURSTDMA_CMP1 (HRTIM_BDTUPR_TIMCMP1) /*!< MCMP1R or CMP1xR register is updated by Burst DMA accesses */
1737 #define HRTIM_BURSTDMA_CMP2 (HRTIM_BDTUPR_TIMCMP2) /*!< MCMP2R or CMP2xR register is updated by Burst DMA accesses */
1738 #define HRTIM_BURSTDMA_CMP3 (HRTIM_BDTUPR_TIMCMP3) /*!< MCMP3R or CMP3xR register is updated by Burst DMA accesses */
1739 #define HRTIM_BURSTDMA_CMP4 (HRTIM_BDTUPR_TIMCMP4) /*!< MCMP4R or CMP4xR register is updated by Burst DMA accesses */
1740 #define HRTIM_BURSTDMA_DTR (HRTIM_BDTUPR_TIMDTR) /*!< TDxR register is updated by Burst DMA accesses */
1741 #define HRTIM_BURSTDMA_SET1R (HRTIM_BDTUPR_TIMSET1R) /*!< SET1R register is updated by Burst DMA accesses */
1742 #define HRTIM_BURSTDMA_RST1R (HRTIM_BDTUPR_TIMRST1R) /*!< RST1R register is updated by Burst DMA accesses */
1743 #define HRTIM_BURSTDMA_SET2R (HRTIM_BDTUPR_TIMSET2R) /*!< SET2R register is updated by Burst DMA accesses */
1744 #define HRTIM_BURSTDMA_RST2R (HRTIM_BDTUPR_TIMRST2R) /*!< RST1R register is updated by Burst DMA accesses */
1745 #define HRTIM_BURSTDMA_EEFR1 (HRTIM_BDTUPR_TIMEEFR1) /*!< EEFxR1 register is updated by Burst DMA accesses */
1746 #define HRTIM_BURSTDMA_EEFR2 (HRTIM_BDTUPR_TIMEEFR2) /*!< EEFxR2 register is updated by Burst DMA accesses */
1747 #define HRTIM_BURSTDMA_RSTR (HRTIM_BDTUPR_TIMRSTR) /*!< RSTxR register is updated by Burst DMA accesses */
1748 #define HRTIM_BURSTDMA_CHPR (HRTIM_BDTUPR_TIMCHPR) /*!< CHPxR register is updated by Burst DMA accesses */
1749 #define HRTIM_BURSTDMA_OUTR (HRTIM_BDTUPR_TIMOUTR) /*!< OUTxR register is updated by Burst DMA accesses */
1750 #define HRTIM_BURSTDMA_FLTR (HRTIM_BDTUPR_TIMFLTR) /*!< FLTxR register is updated by Burst DMA accesses */
1755 /** @defgroup HRTIM_Burst_Mode_Control HRTIM Burst Mode Control
1757 * @brief Constants used to enable or disable the burst mode controller
1759 #define HRTIM_BURSTMODECTL_DISABLED 0x00000000U /*!< Burst mode disabled */
1760 #define HRTIM_BURSTMODECTL_ENABLED (HRTIM_BMCR_BME) /*!< Burst mode enabled */
1765 /** @defgroup HRTIM_Fault_Mode_Control HRTIM Fault Mode Control
1767 * @brief Constants used to enable or disable a fault channel
1769 #define HRTIM_FAULTMODECTL_DISABLED 0x00000000U /*!< Fault channel is disabled */
1770 #define HRTIM_FAULTMODECTL_ENABLED 0x00000001U /*!< Fault channel is enabled */
1775 /** @defgroup HRTIM_Software_Timer_Update HRTIM Software Timer Update
1777 * @brief Constants used to force timer registers update
1779 #define HRTIM_TIMERUPDATE_MASTER (HRTIM_CR2_MSWU) /*!< Force an immediate transfer from the preload to the active register in the master timer */
1780 #define HRTIM_TIMERUPDATE_A (HRTIM_CR2_TASWU) /*!< Force an immediate transfer from the preload to the active register in the timer A */
1781 #define HRTIM_TIMERUPDATE_B (HRTIM_CR2_TBSWU) /*!< Force an immediate transfer from the preload to the active register in the timer B */
1782 #define HRTIM_TIMERUPDATE_C (HRTIM_CR2_TCSWU) /*!< Force an immediate transfer from the preload to the active register in the timer C */
1783 #define HRTIM_TIMERUPDATE_D (HRTIM_CR2_TDSWU) /*!< Force an immediate transfer from the preload to the active register in the timer D */
1784 #define HRTIM_TIMERUPDATE_E (HRTIM_CR2_TESWU) /*!< Force an immediate transfer from the preload to the active register in the timer E */
1789 /** @defgroup HRTIM_Software_Timer_Reset HRTIM Software Timer Reset
1791 * @brief Constants used to force timer counter reset
1793 #define HRTIM_TIMERRESET_MASTER (HRTIM_CR2_MRST) /*!< Reset the master timer counter */
1794 #define HRTIM_TIMERRESET_TIMER_A (HRTIM_CR2_TARST) /*!< Reset the timer A counter */
1795 #define HRTIM_TIMERRESET_TIMER_B (HRTIM_CR2_TBRST) /*!< Reset the timer B counter */
1796 #define HRTIM_TIMERRESET_TIMER_C (HRTIM_CR2_TCRST) /*!< Reset the timer C counter */
1797 #define HRTIM_TIMERRESET_TIMER_D (HRTIM_CR2_TDRST) /*!< Reset the timer D counter */
1798 #define HRTIM_TIMERRESET_TIMER_E (HRTIM_CR2_TERST) /*!< Reset the timer E counter */
1803 /** @defgroup HRTIM_Output_Level HRTIM Output Level
1805 * @brief Constants defining the level of a timer output
1807 #define HRTIM_OUTPUTLEVEL_ACTIVE (0x00000001U) /*!< Force the output to its active state */
1808 #define HRTIM_OUTPUTLEVEL_INACTIVE (0x00000002U) /*!< Force the output to its inactive state */
1810 #define IS_HRTIM_OUTPUTLEVEL(OUTPUTLEVEL)\
1811 (((OUTPUTLEVEL) == HRTIM_OUTPUTLEVEL_ACTIVE) || \
1812 ((OUTPUTLEVEL) == HRTIM_OUTPUTLEVEL_INACTIVE))
1817 /** @defgroup HRTIM_Output_State HRTIM Output State
1819 * @brief Constants defining the state of a timer output
1821 #define HRTIM_OUTPUTSTATE_IDLE (0x00000001U) /*!< Main operating mode, where the output can take the active or
1822 inactive level as programmed in the crossbar unit */
1823 #define HRTIM_OUTPUTSTATE_RUN (0x00000002U) /*!< Default operating state (e.g. after an HRTIM reset, when the
1824 outputs are disabled by software or during a burst mode operation */
1825 #define HRTIM_OUTPUTSTATE_FAULT (0x00000003U) /*!< Safety state, entered in case of a shut-down request on
1831 /** @defgroup HRTIM_Burst_Mode_Status HRTIM Burst Mode Status
1833 * @brief Constants defining the operating state of the burst mode controller
1835 #define HRTIM_BURSTMODESTATUS_NORMAL 0x00000000U /*!< Normal operation */
1836 #define HRTIM_BURSTMODESTATUS_ONGOING (HRTIM_BMCR_BMSTAT) /*!< Burst operation on-going */
1841 /** @defgroup HRTIM_Current_Push_Pull_Status HRTIM Current Push Pull Status
1843 * @brief Constants defining on which output the signal is currently applied
1846 #define HRTIM_PUSHPULL_CURRENTSTATUS_OUTPUT1 0x00000000U /*!< Signal applied on output 1 and output 2 forced inactive */
1847 #define HRTIM_PUSHPULL_CURRENTSTATUS_OUTPUT2 (HRTIM_TIMISR_CPPSTAT) /*!< Signal applied on output 2 and output 1 forced inactive */
1852 /** @defgroup HRTIM_Idle_Push_Pull_Status HRTIM Idle Push Pull Status
1854 * @brief Constants defining on which output the signal was applied, in
1855 * push-pull mode balanced fault mode or delayed idle mode, when the
1856 * protection was triggered
1858 #define HRTIM_PUSHPULL_IDLESTATUS_OUTPUT1 0x00000000U /*!< Protection occurred when the output 1 was active and output 2 forced inactive */
1859 #define HRTIM_PUSHPULL_IDLESTATUS_OUTPUT2 (HRTIM_TIMISR_IPPSTAT) /*!< Protection occurred when the output 2 was active and output 1 forced inactive */
1864 /** @defgroup HRTIM_Common_Interrupt_Enable HRTIM Common Interrupt Enable
1867 #define HRTIM_IT_NONE 0x00000000U /*!< No interrupt enabled */
1868 #define HRTIM_IT_FLT1 HRTIM_IER_FLT1 /*!< Fault 1 interrupt enable */
1869 #define HRTIM_IT_FLT2 HRTIM_IER_FLT2 /*!< Fault 2 interrupt enable */
1870 #define HRTIM_IT_FLT3 HRTIM_IER_FLT3 /*!< Fault 3 interrupt enable */
1871 #define HRTIM_IT_FLT4 HRTIM_IER_FLT4 /*!< Fault 4 interrupt enable */
1872 #define HRTIM_IT_FLT5 HRTIM_IER_FLT5 /*!< Fault 5 interrupt enable */
1873 #define HRTIM_IT_SYSFLT HRTIM_IER_SYSFLT /*!< System Fault interrupt enable */
1874 #define HRTIM_IT_BMPER HRTIM_IER_BMPER /*!< Burst mode period interrupt enable */
1879 /** @defgroup HRTIM_Master_Interrupt_Enable HRTIM Master Interrupt Enable
1882 #define HRTIM_MASTER_IT_NONE 0x00000000U /*!< No interrupt enabled */
1883 #define HRTIM_MASTER_IT_MCMP1 HRTIM_MDIER_MCMP1IE /*!< Master compare 1 interrupt enable */
1884 #define HRTIM_MASTER_IT_MCMP2 HRTIM_MDIER_MCMP2IE /*!< Master compare 2 interrupt enable */
1885 #define HRTIM_MASTER_IT_MCMP3 HRTIM_MDIER_MCMP3IE /*!< Master compare 3 interrupt enable */
1886 #define HRTIM_MASTER_IT_MCMP4 HRTIM_MDIER_MCMP4IE /*!< Master compare 4 interrupt enable */
1887 #define HRTIM_MASTER_IT_MREP HRTIM_MDIER_MREPIE /*!< Master Repetition interrupt enable */
1888 #define HRTIM_MASTER_IT_SYNC HRTIM_MDIER_SYNCIE /*!< Synchronization input interrupt enable */
1889 #define HRTIM_MASTER_IT_MUPD HRTIM_MDIER_MUPDIE /*!< Master update interrupt enable */
1894 /** @defgroup HRTIM_Timing_Unit_Interrupt_Enable HRTIM Timing Unit Interrupt Enable
1897 #define HRTIM_TIM_IT_NONE 0x00000000U /*!< No interrupt enabled */
1898 #define HRTIM_TIM_IT_CMP1 HRTIM_TIMDIER_CMP1IE /*!< Timer compare 1 interrupt enable */
1899 #define HRTIM_TIM_IT_CMP2 HRTIM_TIMDIER_CMP2IE /*!< Timer compare 2 interrupt enable */
1900 #define HRTIM_TIM_IT_CMP3 HRTIM_TIMDIER_CMP3IE /*!< Timer compare 3 interrupt enable */
1901 #define HRTIM_TIM_IT_CMP4 HRTIM_TIMDIER_CMP4IE /*!< Timer compare 4 interrupt enable */
1902 #define HRTIM_TIM_IT_REP HRTIM_TIMDIER_REPIE /*!< Timer repetition interrupt enable */
1903 #define HRTIM_TIM_IT_UPD HRTIM_TIMDIER_UPDIE /*!< Timer update interrupt enable */
1904 #define HRTIM_TIM_IT_CPT1 HRTIM_TIMDIER_CPT1IE /*!< Timer capture 1 interrupt enable */
1905 #define HRTIM_TIM_IT_CPT2 HRTIM_TIMDIER_CPT2IE /*!< Timer capture 2 interrupt enable */
1906 #define HRTIM_TIM_IT_SET1 HRTIM_TIMDIER_SET1IE /*!< Timer output 1 set interrupt enable */
1907 #define HRTIM_TIM_IT_RST1 HRTIM_TIMDIER_RST1IE /*!< Timer output 1 reset interrupt enable */
1908 #define HRTIM_TIM_IT_SET2 HRTIM_TIMDIER_SET2IE /*!< Timer output 2 set interrupt enable */
1909 #define HRTIM_TIM_IT_RST2 HRTIM_TIMDIER_RST2IE /*!< Timer output 2 reset interrupt enable */
1910 #define HRTIM_TIM_IT_RST HRTIM_TIMDIER_RSTIE /*!< Timer reset interrupt enable */
1911 #define HRTIM_TIM_IT_DLYPRT HRTIM_TIMDIER_DLYPRTIE /*!< Timer delay protection interrupt enable */
1916 /** @defgroup HRTIM_Common_Interrupt_Flag HRTIM Common Interrupt Flag
1919 #define HRTIM_FLAG_FLT1 HRTIM_ISR_FLT1 /*!< Fault 1 interrupt flag */
1920 #define HRTIM_FLAG_FLT2 HRTIM_ISR_FLT2 /*!< Fault 2 interrupt flag */
1921 #define HRTIM_FLAG_FLT3 HRTIM_ISR_FLT3 /*!< Fault 3 interrupt flag */
1922 #define HRTIM_FLAG_FLT4 HRTIM_ISR_FLT4 /*!< Fault 4 interrupt flag */
1923 #define HRTIM_FLAG_FLT5 HRTIM_ISR_FLT5 /*!< Fault 5 interrupt flag */
1924 #define HRTIM_FLAG_SYSFLT HRTIM_ISR_SYSFLT /*!< System Fault interrupt flag */
1925 #define HRTIM_FLAG_BMPER HRTIM_ISR_BMPER /*!< Burst mode period interrupt flag */
1930 /** @defgroup HRTIM_Master_Interrupt_Flag HRTIM Master Interrupt Flag
1933 #define HRTIM_MASTER_FLAG_MCMP1 HRTIM_MISR_MCMP1 /*!< Master compare 1 interrupt flag */
1934 #define HRTIM_MASTER_FLAG_MCMP2 HRTIM_MISR_MCMP2 /*!< Master compare 2 interrupt flag */
1935 #define HRTIM_MASTER_FLAG_MCMP3 HRTIM_MISR_MCMP3 /*!< Master compare 3 interrupt flag */
1936 #define HRTIM_MASTER_FLAG_MCMP4 HRTIM_MISR_MCMP4 /*!< Master compare 4 interrupt flag */
1937 #define HRTIM_MASTER_FLAG_MREP HRTIM_MISR_MREP /*!< Master Repetition interrupt flag */
1938 #define HRTIM_MASTER_FLAG_SYNC HRTIM_MISR_SYNC /*!< Synchronization input interrupt flag */
1939 #define HRTIM_MASTER_FLAG_MUPD HRTIM_MISR_MUPD /*!< Master update interrupt flag */
1944 /** @defgroup HRTIM_Timing_Unit_Interrupt_Flag HRTIM Timing Unit Interrupt Flag
1947 #define HRTIM_TIM_FLAG_CMP1 HRTIM_TIMISR_CMP1 /*!< Timer compare 1 interrupt flag */
1948 #define HRTIM_TIM_FLAG_CMP2 HRTIM_TIMISR_CMP2 /*!< Timer compare 2 interrupt flag */
1949 #define HRTIM_TIM_FLAG_CMP3 HRTIM_TIMISR_CMP3 /*!< Timer compare 3 interrupt flag */
1950 #define HRTIM_TIM_FLAG_CMP4 HRTIM_TIMISR_CMP4 /*!< Timer compare 4 interrupt flag */
1951 #define HRTIM_TIM_FLAG_REP HRTIM_TIMISR_REP /*!< Timer repetition interrupt flag */
1952 #define HRTIM_TIM_FLAG_UPD HRTIM_TIMISR_UPD /*!< Timer update interrupt flag */
1953 #define HRTIM_TIM_FLAG_CPT1 HRTIM_TIMISR_CPT1 /*!< Timer capture 1 interrupt flag */
1954 #define HRTIM_TIM_FLAG_CPT2 HRTIM_TIMISR_CPT2 /*!< Timer capture 2 interrupt flag */
1955 #define HRTIM_TIM_FLAG_SET1 HRTIM_TIMISR_SET1 /*!< Timer output 1 set interrupt flag */
1956 #define HRTIM_TIM_FLAG_RST1 HRTIM_TIMISR_RST1 /*!< Timer output 1 reset interrupt flag */
1957 #define HRTIM_TIM_FLAG_SET2 HRTIM_TIMISR_SET2 /*!< Timer output 2 set interrupt flag */
1958 #define HRTIM_TIM_FLAG_RST2 HRTIM_TIMISR_RST2 /*!< Timer output 2 reset interrupt flag */
1959 #define HRTIM_TIM_FLAG_RST HRTIM_TIMISR_RST /*!< Timer reset interrupt flag */
1960 #define HRTIM_TIM_FLAG_DLYPRT HRTIM_TIMISR_DLYPRT /*!< Timer delay protection interrupt flag */
1965 /** @defgroup HRTIM_Master_DMA_Request_Enable HRTIM Master DMA Request Enable
1968 #define HRTIM_MASTER_DMA_NONE 0x00000000U /*!< No DMA request enable */
1969 #define HRTIM_MASTER_DMA_MCMP1 HRTIM_MDIER_MCMP1DE /*!< Master compare 1 DMA request enable */
1970 #define HRTIM_MASTER_DMA_MCMP2 HRTIM_MDIER_MCMP2DE /*!< Master compare 2 DMA request enable */
1971 #define HRTIM_MASTER_DMA_MCMP3 HRTIM_MDIER_MCMP3DE /*!< Master compare 3 DMA request enable */
1972 #define HRTIM_MASTER_DMA_MCMP4 HRTIM_MDIER_MCMP4DE /*!< Master compare 4 DMA request enable */
1973 #define HRTIM_MASTER_DMA_MREP HRTIM_MDIER_MREPDE /*!< Master Repetition DMA request enable */
1974 #define HRTIM_MASTER_DMA_SYNC HRTIM_MDIER_SYNCDE /*!< Synchronization input DMA request enable */
1975 #define HRTIM_MASTER_DMA_MUPD HRTIM_MDIER_MUPDDE /*!< Master update DMA request enable */
1980 /** @defgroup HRTIM_Timing_Unit_DMA_Request_Enable HRTIM Timing Unit DMA Request Enable
1983 #define HRTIM_TIM_DMA_NONE 0x00000000U /*!< No DMA request enable */
1984 #define HRTIM_TIM_DMA_CMP1 HRTIM_TIMDIER_CMP1DE /*!< Timer compare 1 DMA request enable */
1985 #define HRTIM_TIM_DMA_CMP2 HRTIM_TIMDIER_CMP2DE /*!< Timer compare 2 DMA request enable */
1986 #define HRTIM_TIM_DMA_CMP3 HRTIM_TIMDIER_CMP3DE /*!< Timer compare 3 DMA request enable */
1987 #define HRTIM_TIM_DMA_CMP4 HRTIM_TIMDIER_CMP4DE /*!< Timer compare 4 DMA request enable */
1988 #define HRTIM_TIM_DMA_REP HRTIM_TIMDIER_REPDE /*!< Timer repetition DMA request enable */
1989 #define HRTIM_TIM_DMA_UPD HRTIM_TIMDIER_UPDDE /*!< Timer update DMA request enable */
1990 #define HRTIM_TIM_DMA_CPT1 HRTIM_TIMDIER_CPT1DE /*!< Timer capture 1 DMA request enable */
1991 #define HRTIM_TIM_DMA_CPT2 HRTIM_TIMDIER_CPT2DE /*!< Timer capture 2 DMA request enable */
1992 #define HRTIM_TIM_DMA_SET1 HRTIM_TIMDIER_SET1DE /*!< Timer output 1 set DMA request enable */
1993 #define HRTIM_TIM_DMA_RST1 HRTIM_TIMDIER_RST1DE /*!< Timer output 1 reset DMA request enable */
1994 #define HRTIM_TIM_DMA_SET2 HRTIM_TIMDIER_SET2DE /*!< Timer output 2 set DMA request enable */
1995 #define HRTIM_TIM_DMA_RST2 HRTIM_TIMDIER_RST2DE /*!< Timer output 2 reset DMA request enable */
1996 #define HRTIM_TIM_DMA_RST HRTIM_TIMDIER_RSTDE /*!< Timer reset DMA request enable */
1997 #define HRTIM_TIM_DMA_DLYPRT HRTIM_TIMDIER_DLYPRTDE /*!< Timer delay protection DMA request enable */
2006 /* Private macros --------------------------------------------------------*/
2007 /** @addtogroup HRTIM_Private_Macros
2010 #define IS_HRTIM_TIMERINDEX(TIMERINDEX)\
2011 (((TIMERINDEX) == HRTIM_TIMERINDEX_MASTER) || \
2012 ((TIMERINDEX) == HRTIM_TIMERINDEX_TIMER_A) || \
2013 ((TIMERINDEX) == HRTIM_TIMERINDEX_TIMER_B) || \
2014 ((TIMERINDEX) == HRTIM_TIMERINDEX_TIMER_C) || \
2015 ((TIMERINDEX) == HRTIM_TIMERINDEX_TIMER_D) || \
2016 ((TIMERINDEX) == HRTIM_TIMERINDEX_TIMER_E))
2018 #define IS_HRTIM_TIMING_UNIT(TIMERINDEX)\
2019 (((TIMERINDEX) == HRTIM_TIMERINDEX_TIMER_A) || \
2020 ((TIMERINDEX) == HRTIM_TIMERINDEX_TIMER_B) || \
2021 ((TIMERINDEX) == HRTIM_TIMERINDEX_TIMER_C) || \
2022 ((TIMERINDEX) == HRTIM_TIMERINDEX_TIMER_D) || \
2023 ((TIMERINDEX) == HRTIM_TIMERINDEX_TIMER_E))
2025 #define IS_HRTIM_TIMERID(TIMERID) (((TIMERID) & 0xFFC0FFFFU) == 0x00000000U)
2027 #define IS_HRTIM_COMPAREUNIT(COMPAREUNIT)\
2028 (((COMPAREUNIT) == HRTIM_COMPAREUNIT_1) || \
2029 ((COMPAREUNIT) == HRTIM_COMPAREUNIT_2) || \
2030 ((COMPAREUNIT) == HRTIM_COMPAREUNIT_3) || \
2031 ((COMPAREUNIT) == HRTIM_COMPAREUNIT_4))
2033 #define IS_HRTIM_CAPTUREUNIT(CAPTUREUNIT)\
2034 (((CAPTUREUNIT) == HRTIM_CAPTUREUNIT_1) || \
2035 ((CAPTUREUNIT) == HRTIM_CAPTUREUNIT_2))
2037 #define IS_HRTIM_OUTPUT(OUTPUT) (((OUTPUT) & 0xFFFFFC00U) == 0x00000000U)
2039 #define IS_HRTIM_TIMER_OUTPUT(TIMER, OUTPUT)\
2040 ((((TIMER) == HRTIM_TIMERINDEX_TIMER_A) && \
2041 (((OUTPUT) == HRTIM_OUTPUT_TA1) || \
2042 ((OUTPUT) == HRTIM_OUTPUT_TA2))) \
2044 (((TIMER) == HRTIM_TIMERINDEX_TIMER_B) && \
2045 (((OUTPUT) == HRTIM_OUTPUT_TB1) || \
2046 ((OUTPUT) == HRTIM_OUTPUT_TB2))) \
2048 (((TIMER) == HRTIM_TIMERINDEX_TIMER_C) && \
2049 (((OUTPUT) == HRTIM_OUTPUT_TC1) || \
2050 ((OUTPUT) == HRTIM_OUTPUT_TC2))) \
2052 (((TIMER) == HRTIM_TIMERINDEX_TIMER_D) && \
2053 (((OUTPUT) == HRTIM_OUTPUT_TD1) || \
2054 ((OUTPUT) == HRTIM_OUTPUT_TD2))) \
2056 (((TIMER) == HRTIM_TIMERINDEX_TIMER_E) && \
2057 (((OUTPUT) == HRTIM_OUTPUT_TE1) || \
2058 ((OUTPUT) == HRTIM_OUTPUT_TE2))))
2060 #define IS_HRTIM_EVENT(EVENT)\
2061 (((EVENT) == HRTIM_EVENT_NONE)|| \
2062 ((EVENT) == HRTIM_EVENT_1) || \
2063 ((EVENT) == HRTIM_EVENT_2) || \
2064 ((EVENT) == HRTIM_EVENT_3) || \
2065 ((EVENT) == HRTIM_EVENT_4) || \
2066 ((EVENT) == HRTIM_EVENT_5) || \
2067 ((EVENT) == HRTIM_EVENT_6) || \
2068 ((EVENT) == HRTIM_EVENT_7) || \
2069 ((EVENT) == HRTIM_EVENT_8) || \
2070 ((EVENT) == HRTIM_EVENT_9) || \
2071 ((EVENT) == HRTIM_EVENT_10))
2073 #define IS_HRTIM_FAULT(FAULT)\
2074 (((FAULT) == HRTIM_FAULT_1) || \
2075 ((FAULT) == HRTIM_FAULT_2) || \
2076 ((FAULT) == HRTIM_FAULT_3) || \
2077 ((FAULT) == HRTIM_FAULT_4) || \
2078 ((FAULT) == HRTIM_FAULT_5))
2080 #define IS_HRTIM_PRESCALERRATIO(PRESCALERRATIO)\
2081 (((PRESCALERRATIO) == HRTIM_PRESCALERRATIO_DIV1) || \
2082 ((PRESCALERRATIO) == HRTIM_PRESCALERRATIO_DIV2) || \
2083 ((PRESCALERRATIO) == HRTIM_PRESCALERRATIO_DIV4))
2085 #define IS_HRTIM_MODE(MODE)\
2086 (((MODE) == HRTIM_MODE_CONTINUOUS) || \
2087 ((MODE) == HRTIM_MODE_SINGLESHOT) || \
2088 ((MODE) == HRTIM_MODE_SINGLESHOT_RETRIGGERABLE))
2090 #define IS_HRTIM_MODE_ONEPULSE(MODE)\
2091 (((MODE) == HRTIM_MODE_SINGLESHOT) || \
2092 ((MODE) == HRTIM_MODE_SINGLESHOT_RETRIGGERABLE))
2095 #define IS_HRTIM_HALFMODE(HALFMODE)\
2096 (((HALFMODE) == HRTIM_HALFMODE_DISABLED) || \
2097 ((HALFMODE) == HRTIM_HALFMODE_ENABLED))
2099 #define IS_HRTIM_SYNCSTART(SYNCSTART)\
2100 (((SYNCSTART) == HRTIM_SYNCSTART_DISABLED) || \
2101 ((SYNCSTART) == HRTIM_SYNCSTART_ENABLED))
2103 #define IS_HRTIM_SYNCRESET(SYNCRESET)\
2104 (((SYNCRESET) == HRTIM_SYNCRESET_DISABLED) || \
2105 ((SYNCRESET) == HRTIM_SYNCRESET_ENABLED))
2107 #define IS_HRTIM_DACSYNC(DACSYNC)\
2108 (((DACSYNC) == HRTIM_DACSYNC_NONE) || \
2109 ((DACSYNC) == HRTIM_DACSYNC_DACTRIGOUT_1) || \
2110 ((DACSYNC) == HRTIM_DACSYNC_DACTRIGOUT_2) || \
2111 ((DACSYNC) == HRTIM_DACSYNC_DACTRIGOUT_3))
2113 #define IS_HRTIM_PRELOAD(PRELOAD)\
2114 (((PRELOAD) == HRTIM_PRELOAD_DISABLED) || \
2115 ((PRELOAD) == HRTIM_PRELOAD_ENABLED))
2117 #define IS_HRTIM_UPDATEGATING_MASTER(UPDATEGATING)\
2118 (((UPDATEGATING) == HRTIM_UPDATEGATING_INDEPENDENT) || \
2119 ((UPDATEGATING) == HRTIM_UPDATEGATING_DMABURST) || \
2120 ((UPDATEGATING) == HRTIM_UPDATEGATING_DMABURST_UPDATE))
2122 #define IS_HRTIM_UPDATEGATING_TIM(UPDATEGATING)\
2123 (((UPDATEGATING) == HRTIM_UPDATEGATING_INDEPENDENT) || \
2124 ((UPDATEGATING) == HRTIM_UPDATEGATING_DMABURST) || \
2125 ((UPDATEGATING) == HRTIM_UPDATEGATING_DMABURST_UPDATE) || \
2126 ((UPDATEGATING) == HRTIM_UPDATEGATING_UPDEN1) || \
2127 ((UPDATEGATING) == HRTIM_UPDATEGATING_UPDEN2) || \
2128 ((UPDATEGATING) == HRTIM_UPDATEGATING_UPDEN3) || \
2129 ((UPDATEGATING) == HRTIM_UPDATEGATING_UPDEN1_UPDATE) || \
2130 ((UPDATEGATING) == HRTIM_UPDATEGATING_UPDEN2_UPDATE) || \
2131 ((UPDATEGATING) == HRTIM_UPDATEGATING_UPDEN3_UPDATE))
2133 #define IS_HRTIM_TIMERBURSTMODE(MODE) \
2134 (((MODE) == HRTIM_TIMERBURSTMODE_MAINTAINCLOCK) || \
2135 ((MODE) == HRTIM_TIMERBURSTMODE_RESETCOUNTER))
2136 #define IS_HRTIM_UPDATEONREPETITION(UPDATEONREPETITION) \
2137 (((UPDATEONREPETITION) == HRTIM_UPDATEONREPETITION_DISABLED) || \
2138 ((UPDATEONREPETITION) == HRTIM_UPDATEONREPETITION_ENABLED))
2140 #define IS_HRTIM_TIMPUSHPULLMODE(TIMPUSHPULLMODE)\
2141 (((TIMPUSHPULLMODE) == HRTIM_TIMPUSHPULLMODE_DISABLED) || \
2142 ((TIMPUSHPULLMODE) == HRTIM_TIMPUSHPULLMODE_ENABLED))
2143 #define IS_HRTIM_TIMFAULTENABLE(TIMFAULTENABLE) (((TIMFAULTENABLE) & 0xFFFFFFE0U) == 0x00000000U)
2145 #define IS_HRTIM_TIMFAULTLOCK(TIMFAULTLOCK)\
2146 (((TIMFAULTLOCK) == HRTIM_TIMFAULTLOCK_READWRITE) || \
2147 ((TIMFAULTLOCK) == HRTIM_TIMFAULTLOCK_READONLY))
2149 #define IS_HRTIM_TIMDEADTIMEINSERTION(TIMPUSHPULLMODE, TIMDEADTIMEINSERTION)\
2150 ((((TIMPUSHPULLMODE) == HRTIM_TIMPUSHPULLMODE_DISABLED) && \
2151 ((((TIMDEADTIMEINSERTION) == HRTIM_TIMDEADTIMEINSERTION_DISABLED) || \
2152 ((TIMDEADTIMEINSERTION) == HRTIM_TIMDEADTIMEINSERTION_ENABLED)))) \
2154 (((TIMPUSHPULLMODE) == HRTIM_TIMPUSHPULLMODE_ENABLED) && \
2155 ((TIMDEADTIMEINSERTION) == HRTIM_TIMDEADTIMEINSERTION_DISABLED)))
2157 #define IS_HRTIM_TIMDELAYEDPROTECTION(TIMPUSHPULLMODE, TIMDELAYEDPROTECTION)\
2158 ((((TIMDELAYEDPROTECTION) == HRTIM_TIMER_A_B_C_DELAYEDPROTECTION_DISABLED) || \
2159 ((TIMDELAYEDPROTECTION) == HRTIM_TIMER_A_B_C_DELAYEDPROTECTION_DELAYEDOUT1_EEV6) || \
2160 ((TIMDELAYEDPROTECTION) == HRTIM_TIMER_A_B_C_DELAYEDPROTECTION_DELAYEDOUT2_EEV6) || \
2161 ((TIMDELAYEDPROTECTION) == HRTIM_TIMER_A_B_C_DELAYEDPROTECTION_DELAYEDBOTH_EEV6) || \
2162 ((TIMDELAYEDPROTECTION) == HRTIM_TIMER_A_B_C_DELAYEDPROTECTION_DELAYEDOUT1_DEEV7) || \
2163 ((TIMDELAYEDPROTECTION) == HRTIM_TIMER_A_B_C_DELAYEDPROTECTION_DELAYEDOUT2_DEEV7) || \
2164 ((TIMDELAYEDPROTECTION) == HRTIM_TIMER_A_B_C_DELAYEDPROTECTION_DELAYEDBOTH_EEV7)) \
2166 (((TIMPUSHPULLMODE) == HRTIM_TIMPUSHPULLMODE_ENABLED) && \
2167 (((TIMDELAYEDPROTECTION) == HRTIM_TIMER_A_B_C_DELAYEDPROTECTION_BALANCED_EEV6) || \
2168 ((TIMDELAYEDPROTECTION) == HRTIM_TIMER_A_B_C_DELAYEDPROTECTION_BALANCED_EEV7))))
2170 #define IS_HRTIM_TIMUPDATETRIGGER(TIMUPDATETRIGGER) (((TIMUPDATETRIGGER) & 0xFE07FFFFU) == 0x00000000U)
2172 #define IS_HRTIM_TIMRESETTRIGGER(TIMRESETTRIGGER) (((TIMRESETTRIGGER) & 0x80000001U) == 0x00000000U)
2175 #define IS_HRTIM_TIMUPDATEONRESET(TIMUPDATEONRESET) \
2176 (((TIMUPDATEONRESET) == HRTIM_TIMUPDATEONRESET_DISABLED) || \
2177 ((TIMUPDATEONRESET) == HRTIM_TIMUPDATEONRESET_ENABLED))
2179 #define IS_HRTIM_AUTODELAYEDMODE(AUTODELAYEDMODE)\
2180 (((AUTODELAYEDMODE) == HRTIM_AUTODELAYEDMODE_REGULAR) || \
2181 ((AUTODELAYEDMODE) == HRTIM_AUTODELAYEDMODE_AUTODELAYED_NOTIMEOUT) || \
2182 ((AUTODELAYEDMODE) == HRTIM_AUTODELAYEDMODE_AUTODELAYED_TIMEOUTCMP1) || \
2183 ((AUTODELAYEDMODE) == HRTIM_AUTODELAYEDMODE_AUTODELAYED_TIMEOUTCMP3))
2185 /* Auto delayed mode is only available for compare units 2 and 4U */
2186 #define IS_HRTIM_COMPAREUNIT_AUTODELAYEDMODE(COMPAREUNIT, AUTODELAYEDMODE) \
2187 ((((COMPAREUNIT) == HRTIM_COMPAREUNIT_2) && \
2188 (((AUTODELAYEDMODE) == HRTIM_AUTODELAYEDMODE_REGULAR) || \
2189 ((AUTODELAYEDMODE) == HRTIM_AUTODELAYEDMODE_AUTODELAYED_NOTIMEOUT) || \
2190 ((AUTODELAYEDMODE) == HRTIM_AUTODELAYEDMODE_AUTODELAYED_TIMEOUTCMP1) || \
2191 ((AUTODELAYEDMODE) == HRTIM_AUTODELAYEDMODE_AUTODELAYED_TIMEOUTCMP3))) \
2193 (((COMPAREUNIT) == HRTIM_COMPAREUNIT_4) && \
2194 (((AUTODELAYEDMODE) == HRTIM_AUTODELAYEDMODE_REGULAR) || \
2195 ((AUTODELAYEDMODE) == HRTIM_AUTODELAYEDMODE_AUTODELAYED_NOTIMEOUT) || \
2196 ((AUTODELAYEDMODE) == HRTIM_AUTODELAYEDMODE_AUTODELAYED_TIMEOUTCMP1) || \
2197 ((AUTODELAYEDMODE) == HRTIM_AUTODELAYEDMODE_AUTODELAYED_TIMEOUTCMP3))))
2199 #define IS_HRTIM_OUTPUTPOLARITY(OUTPUTPOLARITY)\
2200 (((OUTPUTPOLARITY) == HRTIM_OUTPUTPOLARITY_HIGH) || \
2201 ((OUTPUTPOLARITY) == HRTIM_OUTPUTPOLARITY_LOW))
2203 #define IS_HRTIM_OUTPUTPULSE(OUTPUTPULSE) ((OUTPUTPULSE) <= 0x0000FFFFU)
2205 #define IS_HRTIM_OUTPUTSET(OUTPUTSET)\
2206 (((OUTPUTSET) == HRTIM_OUTPUTSET_NONE) || \
2207 ((OUTPUTSET) == HRTIM_OUTPUTSET_RESYNC) || \
2208 ((OUTPUTSET) == HRTIM_OUTPUTSET_TIMPER) || \
2209 ((OUTPUTSET) == HRTIM_OUTPUTSET_TIMCMP1) || \
2210 ((OUTPUTSET) == HRTIM_OUTPUTSET_TIMCMP2) || \
2211 ((OUTPUTSET) == HRTIM_OUTPUTSET_TIMCMP3) || \
2212 ((OUTPUTSET) == HRTIM_OUTPUTSET_TIMCMP4) || \
2213 ((OUTPUTSET) == HRTIM_OUTPUTSET_MASTERPER) || \
2214 ((OUTPUTSET) == HRTIM_OUTPUTSET_MASTERCMP1) || \
2215 ((OUTPUTSET) == HRTIM_OUTPUTSET_MASTERCMP2) || \
2216 ((OUTPUTSET) == HRTIM_OUTPUTSET_MASTERCMP3) || \
2217 ((OUTPUTSET) == HRTIM_OUTPUTSET_MASTERCMP4) || \
2218 ((OUTPUTSET) == HRTIM_OUTPUTSET_TIMEV_1) || \
2219 ((OUTPUTSET) == HRTIM_OUTPUTSET_TIMEV_2) || \
2220 ((OUTPUTSET) == HRTIM_OUTPUTSET_TIMEV_3) || \
2221 ((OUTPUTSET) == HRTIM_OUTPUTSET_TIMEV_4) || \
2222 ((OUTPUTSET) == HRTIM_OUTPUTSET_TIMEV_5) || \
2223 ((OUTPUTSET) == HRTIM_OUTPUTSET_TIMEV_6) || \
2224 ((OUTPUTSET) == HRTIM_OUTPUTSET_TIMEV_7) || \
2225 ((OUTPUTSET) == HRTIM_OUTPUTSET_TIMEV_8) || \
2226 ((OUTPUTSET) == HRTIM_OUTPUTSET_TIMEV_9) || \
2227 ((OUTPUTSET) == HRTIM_OUTPUTSET_EEV_1) || \
2228 ((OUTPUTSET) == HRTIM_OUTPUTSET_EEV_2) || \
2229 ((OUTPUTSET) == HRTIM_OUTPUTSET_EEV_3) || \
2230 ((OUTPUTSET) == HRTIM_OUTPUTSET_EEV_4) || \
2231 ((OUTPUTSET) == HRTIM_OUTPUTSET_EEV_5) || \
2232 ((OUTPUTSET) == HRTIM_OUTPUTSET_EEV_6) || \
2233 ((OUTPUTSET) == HRTIM_OUTPUTSET_EEV_7) || \
2234 ((OUTPUTSET) == HRTIM_OUTPUTSET_EEV_8) || \
2235 ((OUTPUTSET) == HRTIM_OUTPUTSET_EEV_9) || \
2236 ((OUTPUTSET) == HRTIM_OUTPUTSET_EEV_10) || \
2237 ((OUTPUTSET) == HRTIM_OUTPUTSET_UPDATE))
2239 #define IS_HRTIM_OUTPUTRESET(OUTPUTRESET)\
2240 (((OUTPUTRESET) == HRTIM_OUTPUTRESET_NONE) || \
2241 ((OUTPUTRESET) == HRTIM_OUTPUTRESET_RESYNC) || \
2242 ((OUTPUTRESET) == HRTIM_OUTPUTRESET_TIMPER) || \
2243 ((OUTPUTRESET) == HRTIM_OUTPUTRESET_TIMCMP1) || \
2244 ((OUTPUTRESET) == HRTIM_OUTPUTRESET_TIMCMP2) || \
2245 ((OUTPUTRESET) == HRTIM_OUTPUTRESET_TIMCMP3) || \
2246 ((OUTPUTRESET) == HRTIM_OUTPUTRESET_TIMCMP4) || \
2247 ((OUTPUTRESET) == HRTIM_OUTPUTRESET_MASTERPER) || \
2248 ((OUTPUTRESET) == HRTIM_OUTPUTRESET_MASTERCMP1) || \
2249 ((OUTPUTRESET) == HRTIM_OUTPUTRESET_MASTERCMP2) || \
2250 ((OUTPUTRESET) == HRTIM_OUTPUTRESET_MASTERCMP3) || \
2251 ((OUTPUTRESET) == HRTIM_OUTPUTRESET_MASTERCMP4) || \
2252 ((OUTPUTRESET) == HRTIM_OUTPUTRESET_TIMEV_1) || \
2253 ((OUTPUTRESET) == HRTIM_OUTPUTRESET_TIMEV_2) || \
2254 ((OUTPUTRESET) == HRTIM_OUTPUTRESET_TIMEV_3) || \
2255 ((OUTPUTRESET) == HRTIM_OUTPUTRESET_TIMEV_4) || \
2256 ((OUTPUTRESET) == HRTIM_OUTPUTRESET_TIMEV_5) || \
2257 ((OUTPUTRESET) == HRTIM_OUTPUTRESET_TIMEV_6) || \
2258 ((OUTPUTRESET) == HRTIM_OUTPUTRESET_TIMEV_7) || \
2259 ((OUTPUTRESET) == HRTIM_OUTPUTRESET_TIMEV_8) || \
2260 ((OUTPUTRESET) == HRTIM_OUTPUTRESET_TIMEV_9) || \
2261 ((OUTPUTRESET) == HRTIM_OUTPUTRESET_EEV_1) || \
2262 ((OUTPUTRESET) == HRTIM_OUTPUTRESET_EEV_2) || \
2263 ((OUTPUTRESET) == HRTIM_OUTPUTRESET_EEV_3) || \
2264 ((OUTPUTRESET) == HRTIM_OUTPUTRESET_EEV_4) || \
2265 ((OUTPUTRESET) == HRTIM_OUTPUTRESET_EEV_5) || \
2266 ((OUTPUTRESET) == HRTIM_OUTPUTRESET_EEV_6) || \
2267 ((OUTPUTRESET) == HRTIM_OUTPUTRESET_EEV_7) || \
2268 ((OUTPUTRESET) == HRTIM_OUTPUTRESET_EEV_8) || \
2269 ((OUTPUTRESET) == HRTIM_OUTPUTRESET_EEV_9) || \
2270 ((OUTPUTRESET) == HRTIM_OUTPUTRESET_EEV_10) || \
2271 ((OUTPUTRESET) == HRTIM_OUTPUTRESET_UPDATE))
2273 #define IS_HRTIM_OUTPUTIDLEMODE(OUTPUTIDLEMODE)\
2274 (((OUTPUTIDLEMODE) == HRTIM_OUTPUTIDLEMODE_NONE) || \
2275 ((OUTPUTIDLEMODE) == HRTIM_OUTPUTIDLEMODE_IDLE))
2277 #define IS_HRTIM_OUTPUTIDLELEVEL(OUTPUTIDLELEVEL)\
2278 (((OUTPUTIDLELEVEL) == HRTIM_OUTPUTIDLELEVEL_INACTIVE) || \
2279 ((OUTPUTIDLELEVEL) == HRTIM_OUTPUTIDLELEVEL_ACTIVE))
2281 #define IS_HRTIM_OUTPUTFAULTLEVEL(OUTPUTFAULTLEVEL)\
2282 (((OUTPUTFAULTLEVEL) == HRTIM_OUTPUTFAULTLEVEL_NONE) || \
2283 ((OUTPUTFAULTLEVEL) == HRTIM_OUTPUTFAULTLEVEL_ACTIVE) || \
2284 ((OUTPUTFAULTLEVEL) == HRTIM_OUTPUTFAULTLEVEL_INACTIVE) || \
2285 ((OUTPUTFAULTLEVEL) == HRTIM_OUTPUTFAULTLEVEL_HIGHZ))
2287 #define IS_HRTIM_OUTPUTCHOPPERMODE(OUTPUTCHOPPERMODE)\
2288 (((OUTPUTCHOPPERMODE) == HRTIM_OUTPUTCHOPPERMODE_DISABLED) || \
2289 ((OUTPUTCHOPPERMODE) == HRTIM_OUTPUTCHOPPERMODE_ENABLED))
2291 #define IS_HRTIM_OUTPUTBURSTMODEENTRY(OUTPUTBURSTMODEENTRY)\
2292 (((OUTPUTBURSTMODEENTRY) == HRTIM_OUTPUTBURSTMODEENTRY_REGULAR) || \
2293 ((OUTPUTBURSTMODEENTRY) == HRTIM_OUTPUTBURSTMODEENTRY_DELAYED))
2296 #define IS_HRTIM_TIMER_CAPTURETRIGGER(TIMER, CAPTURETRIGGER) \
2297 (((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_NONE) || \
2298 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_UPDATE) || \
2299 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_EEV_1) || \
2300 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_EEV_2) || \
2301 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_EEV_3) || \
2302 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_EEV_4) || \
2303 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_EEV_5) || \
2304 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_EEV_6) || \
2305 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_EEV_7) || \
2306 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_EEV_8) || \
2307 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_EEV_9) || \
2308 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_EEV_10) \
2310 (((TIMER) == HRTIM_TIMERINDEX_TIMER_A) && \
2311 (((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TB1_SET) || \
2312 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TB1_RESET) || \
2313 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERB_CMP1) || \
2314 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERB_CMP2) || \
2315 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TC1_SET) || \
2316 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TC1_RESET) || \
2317 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERC_CMP1) || \
2318 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERC_CMP2) || \
2319 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TD1_SET) || \
2320 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TD1_RESET) || \
2321 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERD_CMP1) || \
2322 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERD_CMP2) || \
2323 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TE1_SET) || \
2324 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TE1_RESET) || \
2325 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERE_CMP1) || \
2326 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERE_CMP2))) \
2328 (((TIMER) == HRTIM_TIMERINDEX_TIMER_B) && \
2329 (((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TA1_SET) || \
2330 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TA1_RESET) || \
2331 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERA_CMP1) || \
2332 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERA_CMP2) || \
2333 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TC1_SET) || \
2334 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TC1_RESET) || \
2335 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERC_CMP1) || \
2336 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERC_CMP2) || \
2337 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TD1_SET) || \
2338 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TD1_RESET) || \
2339 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERD_CMP1) || \
2340 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERD_CMP2) || \
2341 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TE1_SET) || \
2342 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TE1_RESET) || \
2343 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERE_CMP1) || \
2344 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERE_CMP2))) \
2346 (((TIMER) == HRTIM_TIMERINDEX_TIMER_C) && \
2347 (((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TA1_SET) || \
2348 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TA1_RESET) || \
2349 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERA_CMP1) || \
2350 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERA_CMP2) || \
2351 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TB1_SET) || \
2352 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TB1_RESET) || \
2353 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERB_CMP1) || \
2354 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERB_CMP2) || \
2355 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TD1_SET) || \
2356 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TD1_RESET) || \
2357 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERD_CMP1) || \
2358 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERD_CMP2) || \
2359 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TE1_SET) || \
2360 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TE1_RESET) || \
2361 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERE_CMP1) || \
2362 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERE_CMP2))) \
2364 (((TIMER) == HRTIM_TIMERINDEX_TIMER_D) && \
2365 (((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TA1_SET) || \
2366 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TA1_RESET) || \
2367 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERA_CMP1) || \
2368 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERA_CMP2) || \
2369 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TB1_SET) || \
2370 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TB1_RESET) || \
2371 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERB_CMP1) || \
2372 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERB_CMP2) || \
2373 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TC1_SET) || \
2374 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TC1_RESET) || \
2375 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERC_CMP1) || \
2376 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERC_CMP2) || \
2377 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TE1_SET) || \
2378 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TE1_RESET) || \
2379 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERE_CMP1) || \
2380 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERE_CMP2))) \
2382 (((TIMER) == HRTIM_TIMERINDEX_TIMER_E) && \
2383 (((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TA1_SET) || \
2384 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TA1_RESET) || \
2385 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERA_CMP1) || \
2386 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERA_CMP2) || \
2387 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TB1_SET) || \
2388 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TB1_RESET) || \
2389 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERB_CMP1) || \
2390 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERB_CMP2) || \
2391 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TC1_SET) || \
2392 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TC1_RESET) || \
2393 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERC_CMP1) || \
2394 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERC_CMP2) || \
2395 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TD1_SET) || \
2396 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TD1_RESET) || \
2397 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERD_CMP1) || \
2398 ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERD_CMP2))))
2400 #define IS_HRTIM_TIMEVENTFILTER(TIMEVENTFILTER)\
2401 (((TIMEVENTFILTER) == HRTIM_TIMEVENTFILTER_NONE) || \
2402 ((TIMEVENTFILTER) == HRTIM_TIMEVENTFILTER_BLANKINGCMP1) || \
2403 ((TIMEVENTFILTER) == HRTIM_TIMEVENTFILTER_BLANKINGCMP2) || \
2404 ((TIMEVENTFILTER) == HRTIM_TIMEVENTFILTER_BLANKINGCMP3) || \
2405 ((TIMEVENTFILTER) == HRTIM_TIMEVENTFILTER_BLANKINGCMP4) || \
2406 ((TIMEVENTFILTER) == HRTIM_TIMEVENTFILTER_BLANKINGFLTR1) || \
2407 ((TIMEVENTFILTER) == HRTIM_TIMEVENTFILTER_BLANKINGFLTR2) || \
2408 ((TIMEVENTFILTER) == HRTIM_TIMEVENTFILTER_BLANKINGFLTR3) || \
2409 ((TIMEVENTFILTER) == HRTIM_TIMEVENTFILTER_BLANKINGFLTR4) || \
2410 ((TIMEVENTFILTER) == HRTIM_TIMEVENTFILTER_BLANKINGFLTR5) || \
2411 ((TIMEVENTFILTER) == HRTIM_TIMEVENTFILTER_BLANKINGFLTR6) || \
2412 ((TIMEVENTFILTER) == HRTIM_TIMEVENTFILTER_BLANKINGFLTR7) || \
2413 ((TIMEVENTFILTER) == HRTIM_TIMEVENTFILTER_BLANKINGFLTR8) || \
2414 ((TIMEVENTFILTER) == HRTIM_TIMEVENTFILTER_WINDOWINGCMP2) || \
2415 ((TIMEVENTFILTER) == HRTIM_TIMEVENTFILTER_WINDOWINGCMP3) || \
2416 ((TIMEVENTFILTER) == HRTIM_TIMEVENTFILTER_WINDOWINGTIM))
2418 #define IS_HRTIM_TIMEVENTLATCH(TIMEVENTLATCH)\
2419 (((TIMEVENTLATCH) == HRTIM_TIMEVENTLATCH_DISABLED) || \
2420 ((TIMEVENTLATCH) == HRTIM_TIMEVENTLATCH_ENABLED))
2422 #define IS_HRTIM_TIMDEADTIME_PRESCALERRATIO(PRESCALERRATIO)\
2423 (((PRESCALERRATIO) == HRTIM_TIMDEADTIME_PRESCALERRATIO_MUL8) || \
2424 ((PRESCALERRATIO) == HRTIM_TIMDEADTIME_PRESCALERRATIO_MUL4) || \
2425 ((PRESCALERRATIO) == HRTIM_TIMDEADTIME_PRESCALERRATIO_MUL2) || \
2426 ((PRESCALERRATIO) == HRTIM_TIMDEADTIME_PRESCALERRATIO_DIV1) || \
2427 ((PRESCALERRATIO) == HRTIM_TIMDEADTIME_PRESCALERRATIO_DIV2) || \
2428 ((PRESCALERRATIO) == HRTIM_TIMDEADTIME_PRESCALERRATIO_DIV4) || \
2429 ((PRESCALERRATIO) == HRTIM_TIMDEADTIME_PRESCALERRATIO_DIV8) || \
2430 ((PRESCALERRATIO) == HRTIM_TIMDEADTIME_PRESCALERRATIO_DIV16))
2432 #define IS_HRTIM_TIMDEADTIME_RISINGSIGN(RISINGSIGN)\
2433 (((RISINGSIGN) == HRTIM_TIMDEADTIME_RISINGSIGN_POSITIVE) || \
2434 ((RISINGSIGN) == HRTIM_TIMDEADTIME_RISINGSIGN_NEGATIVE))
2436 #define IS_HRTIM_TIMDEADTIME_RISINGLOCK(RISINGLOCK)\
2437 (((RISINGLOCK) == HRTIM_TIMDEADTIME_RISINGLOCK_WRITE) || \
2438 ((RISINGLOCK) == HRTIM_TIMDEADTIME_RISINGLOCK_READONLY))
2440 #define IS_HRTIM_TIMDEADTIME_RISINGSIGNLOCK(RISINGSIGNLOCK)\
2441 (((RISINGSIGNLOCK) == HRTIM_TIMDEADTIME_RISINGSIGNLOCK_WRITE) || \
2442 ((RISINGSIGNLOCK) == HRTIM_TIMDEADTIME_RISINGSIGNLOCK_READONLY))
2444 #define IS_HRTIM_TIMDEADTIME_FALLINGSIGN(FALLINGSIGN)\
2445 (((FALLINGSIGN) == HRTIM_TIMDEADTIME_FALLINGSIGN_POSITIVE) || \
2446 ((FALLINGSIGN) == HRTIM_TIMDEADTIME_FALLINGSIGN_NEGATIVE))
2448 #define IS_HRTIM_TIMDEADTIME_FALLINGLOCK(FALLINGLOCK)\
2449 (((FALLINGLOCK) == HRTIM_TIMDEADTIME_FALLINGLOCK_WRITE) || \
2450 ((FALLINGLOCK) == HRTIM_TIMDEADTIME_FALLINGLOCK_READONLY))
2452 #define IS_HRTIM_TIMDEADTIME_FALLINGSIGNLOCK(FALLINGSIGNLOCK)\
2453 (((FALLINGSIGNLOCK) == HRTIM_TIMDEADTIME_FALLINGSIGNLOCK_WRITE) || \
2454 ((FALLINGSIGNLOCK) == HRTIM_TIMDEADTIME_FALLINGSIGNLOCK_READONLY))
2456 #define IS_HRTIM_CHOPPER_PRESCALERRATIO(PRESCALERRATIO)\
2457 (((PRESCALERRATIO) == HRTIM_CHOPPER_PRESCALERRATIO_DIV16) || \
2458 ((PRESCALERRATIO) == HRTIM_CHOPPER_PRESCALERRATIO_DIV32) || \
2459 ((PRESCALERRATIO) == HRTIM_CHOPPER_PRESCALERRATIO_DIV48) || \
2460 ((PRESCALERRATIO) == HRTIM_CHOPPER_PRESCALERRATIO_DIV64) || \
2461 ((PRESCALERRATIO) == HRTIM_CHOPPER_PRESCALERRATIO_DIV80) || \
2462 ((PRESCALERRATIO) == HRTIM_CHOPPER_PRESCALERRATIO_DIV96) || \
2463 ((PRESCALERRATIO) == HRTIM_CHOPPER_PRESCALERRATIO_DIV112) || \
2464 ((PRESCALERRATIO) == HRTIM_CHOPPER_PRESCALERRATIO_DIV128) || \
2465 ((PRESCALERRATIO) == HRTIM_CHOPPER_PRESCALERRATIO_DIV144) || \
2466 ((PRESCALERRATIO) == HRTIM_CHOPPER_PRESCALERRATIO_DIV160) || \
2467 ((PRESCALERRATIO) == HRTIM_CHOPPER_PRESCALERRATIO_DIV176) || \
2468 ((PRESCALERRATIO) == HRTIM_CHOPPER_PRESCALERRATIO_DIV192) || \
2469 ((PRESCALERRATIO) == HRTIM_CHOPPER_PRESCALERRATIO_DIV208) || \
2470 ((PRESCALERRATIO) == HRTIM_CHOPPER_PRESCALERRATIO_DIV224) || \
2471 ((PRESCALERRATIO) == HRTIM_CHOPPER_PRESCALERRATIO_DIV240) || \
2472 ((PRESCALERRATIO) == HRTIM_CHOPPER_PRESCALERRATIO_DIV256))
2474 #define IS_HRTIM_CHOPPER_DUTYCYCLE(DUTYCYCLE)\
2475 (((DUTYCYCLE) == HRTIM_CHOPPER_DUTYCYCLE_0) || \
2476 ((DUTYCYCLE) == HRTIM_CHOPPER_DUTYCYCLE_125) || \
2477 ((DUTYCYCLE) == HRTIM_CHOPPER_DUTYCYCLE_250) || \
2478 ((DUTYCYCLE) == HRTIM_CHOPPER_DUTYCYCLE_375) || \
2479 ((DUTYCYCLE) == HRTIM_CHOPPER_DUTYCYCLE_500) || \
2480 ((DUTYCYCLE) == HRTIM_CHOPPER_DUTYCYCLE_625) || \
2481 ((DUTYCYCLE) == HRTIM_CHOPPER_DUTYCYCLE_750) || \
2482 ((DUTYCYCLE) == HRTIM_CHOPPER_DUTYCYCLE_875))
2484 #define IS_HRTIM_CHOPPER_PULSEWIDTH(PULSEWIDTH)\
2485 (((PULSEWIDTH) == HRTIM_CHOPPER_PULSEWIDTH_16) || \
2486 ((PULSEWIDTH) == HRTIM_CHOPPER_PULSEWIDTH_32) || \
2487 ((PULSEWIDTH) == HRTIM_CHOPPER_PULSEWIDTH_48) || \
2488 ((PULSEWIDTH) == HRTIM_CHOPPER_PULSEWIDTH_64) || \
2489 ((PULSEWIDTH) == HRTIM_CHOPPER_PULSEWIDTH_80) || \
2490 ((PULSEWIDTH) == HRTIM_CHOPPER_PULSEWIDTH_96) || \
2491 ((PULSEWIDTH) == HRTIM_CHOPPER_PULSEWIDTH_112) || \
2492 ((PULSEWIDTH) == HRTIM_CHOPPER_PULSEWIDTH_128) || \
2493 ((PULSEWIDTH) == HRTIM_CHOPPER_PULSEWIDTH_144) || \
2494 ((PULSEWIDTH) == HRTIM_CHOPPER_PULSEWIDTH_160) || \
2495 ((PULSEWIDTH) == HRTIM_CHOPPER_PULSEWIDTH_176) || \
2496 ((PULSEWIDTH) == HRTIM_CHOPPER_PULSEWIDTH_192) || \
2497 ((PULSEWIDTH) == HRTIM_CHOPPER_PULSEWIDTH_208) || \
2498 ((PULSEWIDTH) == HRTIM_CHOPPER_PULSEWIDTH_224) || \
2499 ((PULSEWIDTH) == HRTIM_CHOPPER_PULSEWIDTH_240) || \
2500 ((PULSEWIDTH) == HRTIM_CHOPPER_PULSEWIDTH_256))
2502 #define IS_HRTIM_SYNCINPUTSOURCE(SYNCINPUTSOURCE)\
2503 (((SYNCINPUTSOURCE) == HRTIM_SYNCINPUTSOURCE_NONE) || \
2504 ((SYNCINPUTSOURCE) == HRTIM_SYNCINPUTSOURCE_INTERNALEVENT) || \
2505 ((SYNCINPUTSOURCE) == HRTIM_SYNCINPUTSOURCE_EXTERNALEVENT))
2507 #define IS_HRTIM_SYNCOUTPUTSOURCE(SYNCOUTPUTSOURCE)\
2508 (((SYNCOUTPUTSOURCE) == HRTIM_SYNCOUTPUTSOURCE_MASTER_START) || \
2509 ((SYNCOUTPUTSOURCE) == HRTIM_SYNCOUTPUTSOURCE_MASTER_CMP1) || \
2510 ((SYNCOUTPUTSOURCE) == HRTIM_SYNCOUTPUTSOURCE_TIMA_START) || \
2511 ((SYNCOUTPUTSOURCE) == HRTIM_SYNCOUTPUTSOURCE_TIMA_CMP1))
2513 #define IS_HRTIM_SYNCOUTPUTPOLARITY(SYNCOUTPUTPOLARITY)\
2514 (((SYNCOUTPUTPOLARITY) == HRTIM_SYNCOUTPUTPOLARITY_NONE) || \
2515 ((SYNCOUTPUTPOLARITY) == HRTIM_SYNCOUTPUTPOLARITY_POSITIVE) || \
2516 ((SYNCOUTPUTPOLARITY) == HRTIM_SYNCOUTPUTPOLARITY_NEGATIVE))
2518 #define IS_HRTIM_EVENTSRC(EVENTSRC)\
2519 (((EVENTSRC) == HRTIM_EVENTSRC_1) || \
2520 ((EVENTSRC) == HRTIM_EVENTSRC_2) || \
2521 ((EVENTSRC) == HRTIM_EVENTSRC_3) || \
2522 ((EVENTSRC) == HRTIM_EVENTSRC_4))
2524 #define IS_HRTIM_EVENTPOLARITY(EVENTSENSITIVITY, EVENTPOLARITY)\
2525 ((((EVENTSENSITIVITY) == HRTIM_EVENTSENSITIVITY_LEVEL) && \
2526 (((EVENTPOLARITY) == HRTIM_EVENTPOLARITY_HIGH) || \
2527 ((EVENTPOLARITY) == HRTIM_EVENTPOLARITY_LOW))) \
2529 (((EVENTSENSITIVITY) == HRTIM_EVENTSENSITIVITY_RISINGEDGE) || \
2530 ((EVENTSENSITIVITY) == HRTIM_EVENTSENSITIVITY_FALLINGEDGE)|| \
2531 ((EVENTSENSITIVITY) == HRTIM_EVENTSENSITIVITY_BOTHEDGES)))
2533 #define IS_HRTIM_EVENTSENSITIVITY(EVENTSENSITIVITY)\
2534 (((EVENTSENSITIVITY) == HRTIM_EVENTSENSITIVITY_LEVEL) || \
2535 ((EVENTSENSITIVITY) == HRTIM_EVENTSENSITIVITY_RISINGEDGE) || \
2536 ((EVENTSENSITIVITY) == HRTIM_EVENTSENSITIVITY_FALLINGEDGE) || \
2537 ((EVENTSENSITIVITY) == HRTIM_EVENTSENSITIVITY_BOTHEDGES))
2539 #define IS_HRTIM_EVENTFASTMODE(EVENT, FASTMODE)\
2540 (((((EVENT) == HRTIM_EVENT_1) || \
2541 ((EVENT) == HRTIM_EVENT_2) || \
2542 ((EVENT) == HRTIM_EVENT_3) || \
2543 ((EVENT) == HRTIM_EVENT_4) || \
2544 ((EVENT) == HRTIM_EVENT_5)) && \
2545 (((FASTMODE) == HRTIM_EVENTFASTMODE_ENABLE) || \
2546 ((FASTMODE) == HRTIM_EVENTFASTMODE_DISABLE))) \
2548 (((EVENT) == HRTIM_EVENT_6) || \
2549 ((EVENT) == HRTIM_EVENT_7) || \
2550 ((EVENT) == HRTIM_EVENT_8) || \
2551 ((EVENT) == HRTIM_EVENT_9) || \
2552 ((EVENT) == HRTIM_EVENT_10)))
2555 #define IS_HRTIM_EVENTFILTER(EVENT, FILTER)\
2556 ((((EVENT) == HRTIM_EVENT_1) || \
2557 ((EVENT) == HRTIM_EVENT_2) || \
2558 ((EVENT) == HRTIM_EVENT_3) || \
2559 ((EVENT) == HRTIM_EVENT_4) || \
2560 ((EVENT) == HRTIM_EVENT_5)) \
2562 ((((EVENT) == HRTIM_EVENT_6) || \
2563 ((EVENT) == HRTIM_EVENT_7) || \
2564 ((EVENT) == HRTIM_EVENT_8) || \
2565 ((EVENT) == HRTIM_EVENT_9) || \
2566 ((EVENT) == HRTIM_EVENT_10)) && \
2567 (((FILTER) == HRTIM_EVENTFILTER_NONE) || \
2568 ((FILTER) == HRTIM_EVENTFILTER_1) || \
2569 ((FILTER) == HRTIM_EVENTFILTER_2) || \
2570 ((FILTER) == HRTIM_EVENTFILTER_3) || \
2571 ((FILTER) == HRTIM_EVENTFILTER_4) || \
2572 ((FILTER) == HRTIM_EVENTFILTER_5) || \
2573 ((FILTER) == HRTIM_EVENTFILTER_6) || \
2574 ((FILTER) == HRTIM_EVENTFILTER_7) || \
2575 ((FILTER) == HRTIM_EVENTFILTER_8) || \
2576 ((FILTER) == HRTIM_EVENTFILTER_9) || \
2577 ((FILTER) == HRTIM_EVENTFILTER_10) || \
2578 ((FILTER) == HRTIM_EVENTFILTER_11) || \
2579 ((FILTER) == HRTIM_EVENTFILTER_12) || \
2580 ((FILTER) == HRTIM_EVENTFILTER_13) || \
2581 ((FILTER) == HRTIM_EVENTFILTER_14) || \
2582 ((FILTER) == HRTIM_EVENTFILTER_15))))
2584 #define IS_HRTIM_EVENTPRESCALER(EVENTPRESCALER)\
2585 (((EVENTPRESCALER) == HRTIM_EVENTPRESCALER_DIV1) || \
2586 ((EVENTPRESCALER) == HRTIM_EVENTPRESCALER_DIV2) || \
2587 ((EVENTPRESCALER) == HRTIM_EVENTPRESCALER_DIV4) || \
2588 ((EVENTPRESCALER) == HRTIM_EVENTPRESCALER_DIV8))
2590 #define IS_HRTIM_FAULTSOURCE(FAULTSOURCE)\
2591 (((FAULTSOURCE) == HRTIM_FAULTSOURCE_DIGITALINPUT) || \
2592 ((FAULTSOURCE) == HRTIM_FAULTSOURCE_INTERNAL))
2594 #define IS_HRTIM_FAULTPOLARITY(HRTIM_FAULTPOLARITY)\
2595 (((HRTIM_FAULTPOLARITY) == HRTIM_FAULTPOLARITY_LOW) || \
2596 ((HRTIM_FAULTPOLARITY) == HRTIM_FAULTPOLARITY_HIGH))
2598 #define IS_HRTIM_FAULTMODECTL(FAULTMODECTL)\
2599 (((FAULTMODECTL) == HRTIM_FAULTMODECTL_DISABLED) || \
2600 ((FAULTMODECTL) == HRTIM_FAULTMODECTL_ENABLED))
2602 #define IS_HRTIM_FAULTFILTER(FAULTFILTER)\
2603 (((FAULTFILTER) == HRTIM_FAULTFILTER_NONE) || \
2604 ((FAULTFILTER) == HRTIM_FAULTFILTER_1) || \
2605 ((FAULTFILTER) == HRTIM_FAULTFILTER_2) || \
2606 ((FAULTFILTER) == HRTIM_FAULTFILTER_3) || \
2607 ((FAULTFILTER) == HRTIM_FAULTFILTER_4) || \
2608 ((FAULTFILTER) == HRTIM_FAULTFILTER_5) || \
2609 ((FAULTFILTER) == HRTIM_FAULTFILTER_6) || \
2610 ((FAULTFILTER) == HRTIM_FAULTFILTER_7) || \
2611 ((FAULTFILTER) == HRTIM_FAULTFILTER_8) || \
2612 ((FAULTFILTER) == HRTIM_FAULTFILTER_9) || \
2613 ((FAULTFILTER) == HRTIM_FAULTFILTER_10) || \
2614 ((FAULTFILTER) == HRTIM_FAULTFILTER_11) || \
2615 ((FAULTFILTER) == HRTIM_FAULTFILTER_12) || \
2616 ((FAULTFILTER) == HRTIM_FAULTFILTER_13) || \
2617 ((FAULTFILTER) == HRTIM_FAULTFILTER_14) || \
2618 ((FAULTFILTER) == HRTIM_FAULTFILTER_15))
2620 #define IS_HRTIM_FAULTLOCK(FAULTLOCK)\
2621 (((FAULTLOCK) == HRTIM_FAULTLOCK_READWRITE) || \
2622 ((FAULTLOCK) == HRTIM_FAULTLOCK_READONLY))
2624 #define IS_HRTIM_FAULTPRESCALER(FAULTPRESCALER)\
2625 (((FAULTPRESCALER) == HRTIM_FAULTPRESCALER_DIV1) || \
2626 ((FAULTPRESCALER) == HRTIM_FAULTPRESCALER_DIV2) || \
2627 ((FAULTPRESCALER) == HRTIM_FAULTPRESCALER_DIV4) || \
2628 ((FAULTPRESCALER) == HRTIM_FAULTPRESCALER_DIV8))
2630 #define IS_HRTIM_BURSTMODE(BURSTMODE)\
2631 (((BURSTMODE) == HRTIM_BURSTMODE_SINGLESHOT) || \
2632 ((BURSTMODE) == HRTIM_BURSTMODE_CONTINOUS))
2634 #define IS_HRTIM_BURSTMODECLOCKSOURCE(BURSTMODECLOCKSOURCE)\
2635 (((BURSTMODECLOCKSOURCE) == HRTIM_BURSTMODECLOCKSOURCE_MASTER) || \
2636 ((BURSTMODECLOCKSOURCE) == HRTIM_BURSTMODECLOCKSOURCE_TIMER_A) || \
2637 ((BURSTMODECLOCKSOURCE) == HRTIM_BURSTMODECLOCKSOURCE_TIMER_B) || \
2638 ((BURSTMODECLOCKSOURCE) == HRTIM_BURSTMODECLOCKSOURCE_TIMER_C) || \
2639 ((BURSTMODECLOCKSOURCE) == HRTIM_BURSTMODECLOCKSOURCE_TIMER_D) || \
2640 ((BURSTMODECLOCKSOURCE) == HRTIM_BURSTMODECLOCKSOURCE_TIMER_E) || \
2641 ((BURSTMODECLOCKSOURCE) == HRTIM_BURSTMODECLOCKSOURCE_TIM16_OC) || \
2642 ((BURSTMODECLOCKSOURCE) == HRTIM_BURSTMODECLOCKSOURCE_TIM17_OC) || \
2643 ((BURSTMODECLOCKSOURCE) == HRTIM_BURSTMODECLOCKSOURCE_TIM7_TRGO) || \
2644 ((BURSTMODECLOCKSOURCE) == HRTIM_BURSTMODECLOCKSOURCE_FHRTIM))
2646 #define IS_HRTIM_HRTIM_BURSTMODEPRESCALER(BURSTMODEPRESCALER)\
2647 (((BURSTMODEPRESCALER) == HRTIM_BURSTMODEPRESCALER_DIV1) || \
2648 ((BURSTMODEPRESCALER) == HRTIM_BURSTMODEPRESCALER_DIV2) || \
2649 ((BURSTMODEPRESCALER) == HRTIM_BURSTMODEPRESCALER_DIV4) || \
2650 ((BURSTMODEPRESCALER) == HRTIM_BURSTMODEPRESCALER_DIV8) || \
2651 ((BURSTMODEPRESCALER) == HRTIM_BURSTMODEPRESCALER_DIV16) || \
2652 ((BURSTMODEPRESCALER) == HRTIM_BURSTMODEPRESCALER_DIV32) || \
2653 ((BURSTMODEPRESCALER) == HRTIM_BURSTMODEPRESCALER_DIV64) || \
2654 ((BURSTMODEPRESCALER) == HRTIM_BURSTMODEPRESCALER_DIV128) || \
2655 ((BURSTMODEPRESCALER) == HRTIM_BURSTMODEPRESCALER_DIV256) || \
2656 ((BURSTMODEPRESCALER) == HRTIM_BURSTMODEPRESCALER_DIV512) || \
2657 ((BURSTMODEPRESCALER) == HRTIM_BURSTMODEPRESCALER_DIV1024) || \
2658 ((BURSTMODEPRESCALER) == HRTIM_BURSTMODEPRESCALER_DIV2048) || \
2659 ((BURSTMODEPRESCALER) == HRTIM_BURSTMODEPRESCALER_DIV4096) || \
2660 ((BURSTMODEPRESCALER) == HRTIM_BURSTMODEPRESCALER_DIV8192) || \
2661 ((BURSTMODEPRESCALER) == HRTIM_BURSTMODEPRESCALER_DIV16384) || \
2662 ((BURSTMODEPRESCALER) == HRTIM_BURSTMODEPRESCALER_DIV32768))
2664 #define IS_HRTIM_BURSTMODEPRELOAD(BURSTMODEPRELOAD)\
2665 (((BURSTMODEPRELOAD) == HRIM_BURSTMODEPRELOAD_DISABLED) || \
2666 ((BURSTMODEPRELOAD) == HRIM_BURSTMODEPRELOAD_ENABLED))
2668 #define IS_HRTIM_BURSTMODETRIGGER(BURSTMODETRIGGER)\
2669 (((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_NONE) || \
2670 ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_MASTER_RESET) || \
2671 ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_MASTER_REPETITION) || \
2672 ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_MASTER_CMP1) || \
2673 ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_MASTER_CMP2) || \
2674 ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_MASTER_CMP3) || \
2675 ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_MASTER_CMP4) || \
2676 ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_TIMERA_RESET) || \
2677 ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_TIMERA_REPETITION) || \
2678 ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_TIMERA_CMP1) || \
2679 ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_TIMERA_CMP2) || \
2680 ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_TIMERB_RESET) || \
2681 ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_TIMERB_REPETITION) || \
2682 ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_TIMERB_CMP1) || \
2683 ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_TIMERB_CMP2) || \
2684 ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_TIMERC_RESET) || \
2685 ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_TIMERC_REPETITION) || \
2686 ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_TIMERC_CMP1) || \
2687 ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_TIMERC_CMP2) || \
2688 ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_TIMERD_RESET) || \
2689 ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_TIMERD_REPETITION) || \
2690 ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_TIMERD_CMP1) || \
2691 ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_TIMERD_CMP2) || \
2692 ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_TIMERE_RESET) || \
2693 ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_TIMERE_REPETITION) || \
2694 ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_TIMERE_CMP1) || \
2695 ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_TIMERE_CMP2) || \
2696 ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_TIMERA_EVENT7) || \
2697 ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_TIMERD_EVENT8) || \
2698 ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_EVENT_7) || \
2699 ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_EVENT_8) || \
2700 ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_EVENT_ONCHIP))
2702 #define IS_HRTIM_ADCTRIGGERUPDATE(ADCTRIGGERUPDATE)\
2703 (((ADCTRIGGERUPDATE) == HRTIM_ADCTRIGGERUPDATE_MASTER) || \
2704 ((ADCTRIGGERUPDATE) == HRTIM_ADCTRIGGERUPDATE_TIMER_A) || \
2705 ((ADCTRIGGERUPDATE) == HRTIM_ADCTRIGGERUPDATE_TIMER_B) || \
2706 ((ADCTRIGGERUPDATE) == HRTIM_ADCTRIGGERUPDATE_TIMER_C) || \
2707 ((ADCTRIGGERUPDATE) == HRTIM_ADCTRIGGERUPDATE_TIMER_D) || \
2708 ((ADCTRIGGERUPDATE) == HRTIM_ADCTRIGGERUPDATE_TIMER_E))
2710 #define IS_HRTIM_CALIBRATIONRATE(CALIBRATIONRATE)\
2711 (((CALIBRATIONRATE) == HRTIM_SINGLE_CALIBRATION) || \
2712 ((CALIBRATIONRATE) == HRTIM_CALIBRATIONRATE_7300) || \
2713 ((CALIBRATIONRATE) == HRTIM_CALIBRATIONRATE_910) || \
2714 ((CALIBRATIONRATE) == HRTIM_CALIBRATIONRATE_114) || \
2715 ((CALIBRATIONRATE) == HRTIM_CALIBRATIONRATE_14))
2717 #define IS_HRTIM_TIMER_BURSTDMA(TIMER, BURSTDMA) \
2718 ((((TIMER) == HRTIM_TIMERINDEX_MASTER) && (((BURSTDMA) & 0xFFFFC000U) == 0x00000000U)) \
2719 || (((TIMER) == HRTIM_TIMERINDEX_TIMER_A) && (((BURSTDMA) & 0xFFE00000U) == 0x00000000U)) \
2720 || (((TIMER) == HRTIM_TIMERINDEX_TIMER_B) && (((BURSTDMA) & 0xFFE00000U) == 0x00000000U)) \
2721 || (((TIMER) == HRTIM_TIMERINDEX_TIMER_C) && (((BURSTDMA) & 0xFFE00000U) == 0x00000000U)) \
2722 || (((TIMER) == HRTIM_TIMERINDEX_TIMER_D) && (((BURSTDMA) & 0xFFE00000U) == 0x00000000U)) \
2723 || (((TIMER) == HRTIM_TIMERINDEX_TIMER_E) && (((BURSTDMA) & 0xFFE00000U) == 0x00000000U)))
2725 #define IS_HRTIM_BURSTMODECTL(BURSTMODECTL)\
2726 (((BURSTMODECTL) == HRTIM_BURSTMODECTL_DISABLED) || \
2727 ((BURSTMODECTL) == HRTIM_BURSTMODECTL_ENABLED))
2729 #define IS_HRTIM_TIMERUPDATE(TIMERUPDATE) (((TIMERUPDATE) & 0xFFFFFFC0U) == 0x00000000U)
2731 #define IS_HRTIM_TIMERRESET(TIMERRESET) (((TIMERRESET) & 0xFFFFC0FFU) == 0x00000000U)
2733 #define IS_HRTIM_IT(IT) (((IT) & 0xFFFCFFC0U) == 0x00000000U)
2736 #define IS_HRTIM_MASTER_IT(MASTER_IT) (((MASTER_IT) & 0xFFFFFF80U) == 0x00000000U)
2739 #define IS_HRTIM_TIM_IT(TIM_IT) (((TIM_IT) & 0xFFFF8020U) == 0x00000000U)
2742 #define IS_HRTIM_MASTER_DMA(MASTER_DMA) (((MASTER_DMA) & 0xFF80FFFFU) == 0x00000000U)
2744 #define IS_HRTIM_TIM_DMA(TIM_DMA) (((TIM_DMA) & 0x8020FFFFU) == 0x00000000U)
2749 /* Exported macros -----------------------------------------------------------*/
2750 /** @defgroup HRTIM_Exported_Macros HRTIM Exported Macros
2754 /** @brief Reset HRTIM handle state
2755 * @param __HANDLE__ HRTIM handle.
2758 #if (USE_HAL_HRTIM_REGISTER_CALLBACKS == 1)
2759 #define __HAL_HRTIM_RESET_HANDLE_STATE(__HANDLE__) do{ \
2760 (__HANDLE__)->State = HAL_HRTIM_STATE_RESET; \
2761 (__HANDLE__)->MspInitCallback = NULL; \
2762 (__HANDLE__)->MspDeInitCallback = NULL; \
2765 #define __HAL_HRTIM_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_HRTIM_STATE_RESET)
2768 /** @brief Enables or disables the timer counter(s)
2769 * @param __HANDLE__ specifies the HRTIM Handle.
2770 * @param __TIMERS__ timers to enable/disable
2771 * This parameter can be any combinations of the following values:
2772 * @arg HRTIM_TIMERID_MASTER: Master timer identifier
2773 * @arg HRTIM_TIMERID_TIMER_A: Timer A identifier
2774 * @arg HRTIM_TIMERID_TIMER_B: Timer B identifier
2775 * @arg HRTIM_TIMERID_TIMER_C: Timer C identifier
2776 * @arg HRTIM_TIMERID_TIMER_D: Timer D identifier
2777 * @arg HRTIM_TIMERID_TIMER_E: Timer E identifier
2780 #define __HAL_HRTIM_ENABLE(__HANDLE__, __TIMERS__) ((__HANDLE__)->Instance->sMasterRegs.MCR |= (__TIMERS__))
2782 /* The counter of a timing unit is disabled only if all the timer outputs */
2783 /* are disabled and no capture is configured */
2784 #define HRTIM_TAOEN_MASK (HRTIM_OENR_TA2OEN | HRTIM_OENR_TA1OEN)
2785 #define HRTIM_TBOEN_MASK (HRTIM_OENR_TB2OEN | HRTIM_OENR_TB1OEN)
2786 #define HRTIM_TCOEN_MASK (HRTIM_OENR_TC2OEN | HRTIM_OENR_TC1OEN)
2787 #define HRTIM_TDOEN_MASK (HRTIM_OENR_TD2OEN | HRTIM_OENR_TD1OEN)
2788 #define HRTIM_TEOEN_MASK (HRTIM_OENR_TE2OEN | HRTIM_OENR_TE1OEN)
2789 #define __HAL_HRTIM_DISABLE(__HANDLE__, __TIMERS__)\
2791 if (((__TIMERS__) & HRTIM_TIMERID_MASTER) == HRTIM_TIMERID_MASTER)\
2793 ((__HANDLE__)->Instance->sMasterRegs.MCR &= ~HRTIM_TIMERID_MASTER);\
2795 if (((__TIMERS__) & HRTIM_TIMERID_TIMER_A) == HRTIM_TIMERID_TIMER_A)\
2797 if (((__HANDLE__)->Instance->sCommonRegs.OENR & HRTIM_TAOEN_MASK) == (uint32_t)RESET)\
2799 ((__HANDLE__)->Instance->sMasterRegs.MCR &= ~HRTIM_TIMERID_TIMER_A);\
2802 if (((__TIMERS__) & HRTIM_TIMERID_TIMER_B) == HRTIM_TIMERID_TIMER_B)\
2804 if (((__HANDLE__)->Instance->sCommonRegs.OENR & HRTIM_TBOEN_MASK) == (uint32_t)RESET)\
2806 ((__HANDLE__)->Instance->sMasterRegs.MCR &= ~HRTIM_TIMERID_TIMER_B);\
2809 if (((__TIMERS__) & HRTIM_TIMERID_TIMER_C) == HRTIM_TIMERID_TIMER_C)\
2811 if (((__HANDLE__)->Instance->sCommonRegs.OENR & HRTIM_TCOEN_MASK) == (uint32_t)RESET)\
2813 ((__HANDLE__)->Instance->sMasterRegs.MCR &= ~HRTIM_TIMERID_TIMER_C);\
2816 if (((__TIMERS__) & HRTIM_TIMERID_TIMER_D) == HRTIM_TIMERID_TIMER_D)\
2818 if (((__HANDLE__)->Instance->sCommonRegs.OENR & HRTIM_TDOEN_MASK) == (uint32_t)RESET)\
2820 ((__HANDLE__)->Instance->sMasterRegs.MCR &= ~HRTIM_TIMERID_TIMER_D);\
2823 if (((__TIMERS__) & HRTIM_TIMERID_TIMER_E) == HRTIM_TIMERID_TIMER_E)\
2825 if (((__HANDLE__)->Instance->sCommonRegs.OENR & HRTIM_TEOEN_MASK) == (uint32_t)RESET)\
2827 ((__HANDLE__)->Instance->sMasterRegs.MCR &= ~HRTIM_TIMERID_TIMER_E);\
2833 /** @brief Enables or disables the specified HRTIM common interrupts.
2834 * @param __HANDLE__ specifies the HRTIM Handle.
2835 * @param __INTERRUPT__ specifies the interrupt source to enable or disable.
2836 * This parameter can be one of the following values:
2837 * @arg HRTIM_IT_FLT1: Fault 1 interrupt enable
2838 * @arg HRTIM_IT_FLT2: Fault 2 interrupt enable
2839 * @arg HRTIM_IT_FLT3: Fault 3 interrupt enable
2840 * @arg HRTIM_IT_FLT4: Fault 4 interrupt enable
2841 * @arg HRTIM_IT_FLT5: Fault 5 interrupt enable
2842 * @arg HRTIM_IT_SYSFLT: System Fault interrupt enable
2843 * @arg HRTIM_IT_BMPER: Burst mode period interrupt enable
2846 #define __HAL_HRTIM_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->sCommonRegs.IER |= (__INTERRUPT__))
2847 #define __HAL_HRTIM_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->sCommonRegs.IER &= ~(__INTERRUPT__))
2849 /** @brief Enables or disables the specified HRTIM Master timer interrupts.
2850 * @param __HANDLE__ specifies the HRTIM Handle.
2851 * @param __INTERRUPT__ specifies the interrupt source to enable or disable.
2852 * This parameter can be one of the following values:
2853 * @arg HRTIM_MASTER_IT_MCMP1: Master compare 1 interrupt enable
2854 * @arg HRTIM_MASTER_IT_MCMP2: Master compare 2 interrupt enable
2855 * @arg HRTIM_MASTER_IT_MCMP3: Master compare 3 interrupt enable
2856 * @arg HRTIM_MASTER_IT_MCMP4: Master compare 4 interrupt enable
2857 * @arg HRTIM_MASTER_IT_MREP: Master Repetition interrupt enable
2858 * @arg HRTIM_MASTER_IT_SYNC: Synchronization input interrupt enable
2859 * @arg HRTIM_MASTER_IT_MUPD: Master update interrupt enable
2862 #define __HAL_HRTIM_MASTER_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->sMasterRegs.MDIER |= (__INTERRUPT__))
2863 #define __HAL_HRTIM_MASTER_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->sMasterRegs.MDIER &= ~(__INTERRUPT__))
2865 /** @brief Enables or disables the specified HRTIM Timerx interrupts.
2866 * @param __HANDLE__ specifies the HRTIM Handle.
2867 * @param __TIMER__ specified the timing unit (Timer A to E)
2868 * @param __INTERRUPT__ specifies the interrupt source to enable or disable.
2869 * This parameter can be one of the following values:
2870 * @arg HRTIM_TIM_IT_CMP1: Timer compare 1 interrupt enable
2871 * @arg HRTIM_TIM_IT_CMP2: Timer compare 2 interrupt enable
2872 * @arg HRTIM_TIM_IT_CMP3: Timer compare 3 interrupt enable
2873 * @arg HRTIM_TIM_IT_CMP4: Timer compare 4 interrupt enable
2874 * @arg HRTIM_TIM_IT_REP: Timer repetition interrupt enable
2875 * @arg HRTIM_TIM_IT_UPD: Timer update interrupt enable
2876 * @arg HRTIM_TIM_IT_CPT1: Timer capture 1 interrupt enable
2877 * @arg HRTIM_TIM_IT_CPT2: Timer capture 2 interrupt enable
2878 * @arg HRTIM_TIM_IT_SET1: Timer output 1 set interrupt enable
2879 * @arg HRTIM_TIM_IT_RST1: Timer output 1 reset interrupt enable
2880 * @arg HRTIM_TIM_IT_SET2: Timer output 2 set interrupt enable
2881 * @arg HRTIM_TIM_IT_RST2: Timer output 2 reset interrupt enable
2882 * @arg HRTIM_TIM_IT_RST: Timer reset interrupt enable
2883 * @arg HRTIM_TIM_IT_DLYPRT: Timer delay protection interrupt enable
2886 #define __HAL_HRTIM_TIMER_ENABLE_IT(__HANDLE__, __TIMER__, __INTERRUPT__) ((__HANDLE__)->Instance->sTimerxRegs[(__TIMER__)].TIMxDIER |= (__INTERRUPT__))
2887 #define __HAL_HRTIM_TIMER_DISABLE_IT(__HANDLE__, __TIMER__, __INTERRUPT__) ((__HANDLE__)->Instance->sTimerxRegs[(__TIMER__)].TIMxDIER &= ~(__INTERRUPT__))
2889 /** @brief Checks if the specified HRTIM common interrupt source is enabled or disabled.
2890 * @param __HANDLE__ specifies the HRTIM Handle.
2891 * @param __INTERRUPT__ specifies the interrupt source to check.
2892 * This parameter can be one of the following values:
2893 * @arg HRTIM_IT_FLT1: Fault 1 interrupt enable
2894 * @arg HRTIM_IT_FLT2: Fault 2 interrupt enable
2895 * @arg HRTIM_IT_FLT3: Fault 3 enable
2896 * @arg HRTIM_IT_FLT4: Fault 4 enable
2897 * @arg HRTIM_IT_FLT5: Fault 5 enable
2898 * @arg HRTIM_IT_SYSFLT: System Fault interrupt enable
2899 * @arg HRTIM_IT_BMPER: Burst mode period interrupt enable
2900 * @retval The new state of __INTERRUPT__ (TRUE or FALSE).
2902 #define __HAL_HRTIM_GET_ITSTATUS(__HANDLE__, __INTERRUPT__) ((((__HANDLE__)->Instance->sCommonRegs.IER & (__INTERRUPT__)) == (__INTERRUPT__)) ? SET : RESET)
2904 /** @brief Checks if the specified HRTIM Master interrupt source is enabled or disabled.
2905 * @param __HANDLE__ specifies the HRTIM Handle.
2906 * @param __INTERRUPT__ specifies the interrupt source to check.
2907 * This parameter can be one of the following values:
2908 * @arg HRTIM_MASTER_IT_MCMP1: Master compare 1 interrupt enable
2909 * @arg HRTIM_MASTER_IT_MCMP2: Master compare 2 interrupt enable
2910 * @arg HRTIM_MASTER_IT_MCMP3: Master compare 3 interrupt enable
2911 * @arg HRTIM_MASTER_IT_MCMP4: Master compare 4 interrupt enable
2912 * @arg HRTIM_MASTER_IT_MREP: Master Repetition interrupt enable
2913 * @arg HRTIM_MASTER_IT_SYNC: Synchronization input interrupt enable
2914 * @arg HRTIM_MASTER_IT_MUPD: Master update interrupt enable
2915 * @retval The new state of __INTERRUPT__ (TRUE or FALSE).
2917 #define __HAL_HRTIM_MASTER_GET_ITSTATUS(__HANDLE__, __INTERRUPT__) ((((__HANDLE__)->Instance->sMasterRegs.MDIER & (__INTERRUPT__)) == (__INTERRUPT__)) ? SET : RESET)
2919 /** @brief Checks if the specified HRTIM Timerx interrupt source is enabled or disabled.
2920 * @param __HANDLE__ specifies the HRTIM Handle.
2921 * @param __TIMER__ specified the timing unit (Timer A to E)
2922 * @param __INTERRUPT__ specifies the interrupt source to check.
2923 * This parameter can be one of the following values:
2924 * @arg HRTIM_MASTER_IT_MCMP1: Master compare 1 interrupt enable
2925 * @arg HRTIM_MASTER_IT_MCMP2: Master compare 2 interrupt enable
2926 * @arg HRTIM_MASTER_IT_MCMP3: Master compare 3 interrupt enable
2927 * @arg HRTIM_MASTER_IT_MCMP4: Master compare 4 interrupt enable
2928 * @arg HRTIM_MASTER_IT_MREP: Master Repetition interrupt enable
2929 * @arg HRTIM_MASTER_IT_SYNC: Synchronization input interrupt enable
2930 * @arg HRTIM_MASTER_IT_MUPD: Master update interrupt enable
2931 * @arg HRTIM_TIM_IT_CMP1: Timer compare 1 interrupt enable
2932 * @arg HRTIM_TIM_IT_CMP2: Timer compare 2 interrupt enable
2933 * @arg HRTIM_TIM_IT_CMP3: Timer compare 3 interrupt enable
2934 * @arg HRTIM_TIM_IT_CMP4: Timer compare 4 interrupt enable
2935 * @arg HRTIM_TIM_IT_REP: Timer repetition interrupt enable
2936 * @arg HRTIM_TIM_IT_UPD: Timer update interrupt enable
2937 * @arg HRTIM_TIM_IT_CPT1: Timer capture 1 interrupt enable
2938 * @arg HRTIM_TIM_IT_CPT2: Timer capture 2 interrupt enable
2939 * @arg HRTIM_TIM_IT_SET1: Timer output 1 set interrupt enable
2940 * @arg HRTIM_TIM_IT_RST1: Timer output 1 reset interrupt enable
2941 * @arg HRTIM_TIM_IT_SET2: Timer output 2 set interrupt enable
2942 * @arg HRTIM_TIM_IT_RST2: Timer output 2 reset interrupt enable
2943 * @arg HRTIM_TIM_IT_RST: Timer reset interrupt enable
2944 * @arg HRTIM_TIM_IT_DLYPRT: Timer delay protection interrupt enable
2945 * @retval The new state of __INTERRUPT__ (TRUE or FALSE).
2947 #define __HAL_HRTIM_TIMER_GET_ITSTATUS(__HANDLE__, __TIMER__, __INTERRUPT__) ((((__HANDLE__)->Instance->sTimerxRegs[(__TIMER__)].TIMxDIER & (__INTERRUPT__)) == (__INTERRUPT__)) ? SET : RESET)
2949 /** @brief Clears the specified HRTIM common pending flag.
2950 * @param __HANDLE__ specifies the HRTIM Handle.
2951 * @param __INTERRUPT__ specifies the interrupt pending bit to clear.
2952 * This parameter can be one of the following values:
2953 * @arg HRTIM_IT_FLT1: Fault 1 interrupt clear flag
2954 * @arg HRTIM_IT_FLT2: Fault 2 interrupt clear flag
2955 * @arg HRTIM_IT_FLT3: Fault 3 clear flag
2956 * @arg HRTIM_IT_FLT4: Fault 4 clear flag
2957 * @arg HRTIM_IT_FLT5: Fault 5 clear flag
2958 * @arg HRTIM_IT_SYSFLT: System Fault interrupt clear flag
2959 * @arg HRTIM_IT_BMPER: Burst mode period interrupt clear flag
2962 #define __HAL_HRTIM_CLEAR_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->sCommonRegs.ICR = (__INTERRUPT__))
2964 /** @brief Clears the specified HRTIM Master pending flag.
2965 * @param __HANDLE__ specifies the HRTIM Handle.
2966 * @param __INTERRUPT__ specifies the interrupt pending bit to clear.
2967 * This parameter can be one of the following values:
2968 * @arg HRTIM_MASTER_IT_MCMP1: Master compare 1 interrupt clear flag
2969 * @arg HRTIM_MASTER_IT_MCMP2: Master compare 2 interrupt clear flag
2970 * @arg HRTIM_MASTER_IT_MCMP3: Master compare 3 interrupt clear flag
2971 * @arg HRTIM_MASTER_IT_MCMP4: Master compare 4 interrupt clear flag
2972 * @arg HRTIM_MASTER_IT_MREP: Master Repetition interrupt clear flag
2973 * @arg HRTIM_MASTER_IT_SYNC: Synchronization input interrupt clear flag
2974 * @arg HRTIM_MASTER_IT_MUPD: Master update interrupt clear flag
2977 #define __HAL_HRTIM_MASTER_CLEAR_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->sMasterRegs.MICR = (__INTERRUPT__))
2979 /** @brief Clears the specified HRTIM Timerx pending flag.
2980 * @param __HANDLE__ specifies the HRTIM Handle.
2981 * @param __TIMER__ specified the timing unit (Timer A to E)
2982 * @param __INTERRUPT__ specifies the interrupt pending bit to clear.
2983 * This parameter can be one of the following values:
2984 * @arg HRTIM_TIM_IT_CMP1: Timer compare 1 interrupt clear flag
2985 * @arg HRTIM_TIM_IT_CMP2: Timer compare 2 interrupt clear flag
2986 * @arg HRTIM_TIM_IT_CMP3: Timer compare 3 interrupt clear flag
2987 * @arg HRTIM_TIM_IT_CMP4: Timer compare 4 interrupt clear flag
2988 * @arg HRTIM_TIM_IT_REP: Timer repetition interrupt clear flag
2989 * @arg HRTIM_TIM_IT_UPD: Timer update interrupt clear flag
2990 * @arg HRTIM_TIM_IT_CPT1: Timer capture 1 interrupt clear flag
2991 * @arg HRTIM_TIM_IT_CPT2: Timer capture 2 interrupt clear flag
2992 * @arg HRTIM_TIM_IT_SET1: Timer output 1 set interrupt clear flag
2993 * @arg HRTIM_TIM_IT_RST1: Timer output 1 reset interrupt clear flag
2994 * @arg HRTIM_TIM_IT_SET2: Timer output 2 set interrupt clear flag
2995 * @arg HRTIM_TIM_IT_RST2: Timer output 2 reset interrupt clear flag
2996 * @arg HRTIM_TIM_IT_RST: Timer reset interrupt clear flag
2997 * @arg HRTIM_TIM_IT_DLYPRT: Timer output 1 delay protection interrupt clear flag
3000 #define __HAL_HRTIM_TIMER_CLEAR_IT(__HANDLE__, __TIMER__, __INTERRUPT__) ((__HANDLE__)->Instance->sTimerxRegs[(__TIMER__)].TIMxICR = (__INTERRUPT__))
3003 /** @brief Enables or disables the specified HRTIM Master timer DMA requests.
3004 * @param __HANDLE__ specifies the HRTIM Handle.
3005 * @param __DMA__ specifies the DMA request to enable or disable.
3006 * This parameter can be one of the following values:
3007 * @arg HRTIM_MASTER_DMA_MCMP1: Master compare 1 DMA request enable
3008 * @arg HRTIM_MASTER_DMA_MCMP2: Master compare 2 DMA request enable
3009 * @arg HRTIM_MASTER_DMA_MCMP3: Master compare 3 DMA request enable
3010 * @arg HRTIM_MASTER_DMA_MCMP4: Master compare 4 DMA request enable
3011 * @arg HRTIM_MASTER_DMA_MREP: Master Repetition DMA request enable
3012 * @arg HRTIM_MASTER_DMA_SYNC: Synchronization input DMA request enable
3013 * @arg HRTIM_MASTER_DMA_MUPD: Master update DMA request enable
3016 #define __HAL_HRTIM_MASTER_ENABLE_DMA(__HANDLE__, __DMA__) ((__HANDLE__)->Instance->sMasterRegs.MDIER |= (__DMA__))
3017 #define __HAL_HRTIM_MASTER_DISABLE_DMA(__HANDLE__, __DMA__) ((__HANDLE__)->Instance->sMasterRegs.MDIER &= ~(__DMA__))
3019 /** @brief Enables or disables the specified HRTIM Timerx DMA requests.
3020 * @param __HANDLE__ specifies the HRTIM Handle.
3021 * @param __TIMER__ specified the timing unit (Timer A to E)
3022 * @param __DMA__ specifies the DMA request to enable or disable.
3023 * This parameter can be one of the following values:
3024 * @arg HRTIM_TIM_DMA_CMP1: Timer compare 1 DMA request enable
3025 * @arg HRTIM_TIM_DMA_CMP2: Timer compare 2 DMA request enable
3026 * @arg HRTIM_TIM_DMA_CMP3: Timer compare 3 DMA request enable
3027 * @arg HRTIM_TIM_DMA_CMP4: Timer compare 4 DMA request enable
3028 * @arg HRTIM_TIM_DMA_REP: Timer repetition DMA request enable
3029 * @arg HRTIM_TIM_DMA_UPD: Timer update DMA request enable
3030 * @arg HRTIM_TIM_DMA_CPT1: Timer capture 1 DMA request enable
3031 * @arg HRTIM_TIM_DMA_CPT2: Timer capture 2 DMA request enable
3032 * @arg HRTIM_TIM_DMA_SET1: Timer output 1 set DMA request enable
3033 * @arg HRTIM_TIM_DMA_RST1: Timer output 1 reset DMA request enable
3034 * @arg HRTIM_TIM_DMA_SET2: Timer output 2 set DMA request enable
3035 * @arg HRTIM_TIM_DMA_RST2: Timer output 2 reset DMA request enable
3036 * @arg HRTIM_TIM_DMA_RST: Timer reset DMA request enable
3037 * @arg HRTIM_TIM_DMA_DLYPRT: Timer delay protection DMA request enable
3040 #define __HAL_HRTIM_TIMER_ENABLE_DMA(__HANDLE__, __TIMER__, __DMA__) ((__HANDLE__)->Instance->sTimerxRegs[(__TIMER__)].TIMxDIER |= (__DMA__))
3041 #define __HAL_HRTIM_TIMER_DISABLE_DMA(__HANDLE__, __TIMER__, __DMA__) ((__HANDLE__)->Instance->sTimerxRegs[(__TIMER__)].TIMxDIER &= ~(__DMA__))
3043 #define __HAL_HRTIM_GET_FLAG(__HANDLE__, __FLAG__) (((__HANDLE__)->Instance->sCommonRegs.ISR & (__FLAG__)) == (__FLAG__))
3044 #define __HAL_HRTIM_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->sCommonRegs.ICR = (__FLAG__))
3046 #define __HAL_HRTIM_MASTER_GET_FLAG(__HANDLE__, __FLAG__) (((__HANDLE__)->Instance->sMasterRegs.MISR & (__FLAG__)) == (__FLAG__))
3047 #define __HAL_HRTIM_MASTER_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->sMasterRegs.MICR = (__FLAG__))
3049 #define __HAL_HRTIM_TIMER_GET_FLAG(__HANDLE__, __TIMER__, __FLAG__) (((__HANDLE__)->Instance->sTimerxRegs[(__TIMER__)].TIMxISR & (__FLAG__)) == (__FLAG__))
3050 #define __HAL_HRTIM_TIMER_CLEAR_FLAG(__HANDLE__, __TIMER__, __FLAG__) ((__HANDLE__)->Instance->sTimerxRegs[(__TIMER__)].TIMxICR = (__FLAG__))
3052 /** @brief Sets the HRTIM timer Counter Register value on runtime
3053 * @param __HANDLE__ HRTIM Handle.
3054 * @param __TIMER__ HRTIM timer
3055 * This parameter can be one of the following values:
3056 * @arg 0x5 for master timer
3057 * @arg 0x0 to 0x4 for timers A to E
3058 * @param __COUNTER__ specifies the Counter Register new value.
3061 #define __HAL_HRTIM_SETCOUNTER(__HANDLE__, __TIMER__, __COUNTER__) \
3062 (((__TIMER__) == HRTIM_TIMERINDEX_MASTER) ? ((__HANDLE__)->Instance->sMasterRegs.MCNTR = (__COUNTER__)) :\
3063 ((__HANDLE__)->Instance->sTimerxRegs[(__TIMER__)].CNTxR = (__COUNTER__)))
3065 /** @brief Gets the HRTIM timer Counter Register value on runtime
3066 * @param __HANDLE__ HRTIM Handle.
3067 * @param __TIMER__ HRTIM timer
3068 * This parameter can be one of the following values:
3069 * @arg 0x5 for master timer
3070 * @arg 0x0 to 0x4 for timers A to E
3071 * @retval HRTIM timer Counter Register value
3073 #define __HAL_HRTIM_GETCOUNTER(__HANDLE__, __TIMER__) \
3074 (((__TIMER__) == HRTIM_TIMERINDEX_MASTER) ? ((__HANDLE__)->Instance->sMasterRegs.MCNTR) :\
3075 ((__HANDLE__)->Instance->sTimerxRegs[(__TIMER__)].CNTxR))
3077 /** @brief Sets the HRTIM timer Period value on runtime
3078 * @param __HANDLE__ HRTIM Handle.
3079 * @param __TIMER__ HRTIM timer
3080 * This parameter can be one of the following values:
3081 * @arg 0x5 for master timer
3082 * @arg 0x0 to 0x4 for timers A to E
3083 * @param __PERIOD__ specifies the Period Register new value.
3086 #define __HAL_HRTIM_SETPERIOD(__HANDLE__, __TIMER__, __PERIOD__) \
3087 (((__TIMER__) == HRTIM_TIMERINDEX_MASTER) ? ((__HANDLE__)->Instance->sMasterRegs.MPER = (__PERIOD__)) :\
3088 ((__HANDLE__)->Instance->sTimerxRegs[(__TIMER__)].PERxR = (__PERIOD__)))
3090 /** @brief Gets the HRTIM timer Period Register value on runtime
3091 * @param __HANDLE__ HRTIM Handle.
3092 * @param __TIMER__ HRTIM timer
3093 * This parameter can be one of the following values:
3094 * @arg 0x5 for master timer
3095 * @arg 0x0 to 0x4 for timers A to E
3096 * @retval timer Period Register
3098 #define __HAL_HRTIM_GETPERIOD(__HANDLE__, __TIMER__) \
3099 (((__TIMER__) == HRTIM_TIMERINDEX_MASTER) ? ((__HANDLE__)->Instance->sMasterRegs.MPER) :\
3100 ((__HANDLE__)->Instance->sTimerxRegs[(__TIMER__)].PERxR))
3102 /** @brief Sets the HRTIM timer clock prescaler value on runtime
3103 * @param __HANDLE__ HRTIM Handle.
3104 * @param __TIMER__ HRTIM timer
3105 * This parameter can be one of the following values:
3106 * @arg 0x5 for master timer
3107 * @arg 0x0 to 0x4 for timers A to E
3108 * @param __PRESCALER__ specifies the clock prescaler new value.
3109 * This parameter can be one of the following values:
3110 * @arg HRTIM_PRESCALERRATIO_DIV1: fHRCK: 144 MHz - Resolution: 6.95 ns - Min PWM frequency: 2.2 kHz (fHRTIM=144MHz)
3111 * @arg HRTIM_PRESCALERRATIO_DIV2: fHRCK: 72 MHz - Resolution: 13.88 ns- Min PWM frequency: 1.1 kHz (fHRTIM=144MHz)
3112 * @arg HRTIM_PRESCALERRATIO_DIV4: fHRCK: 36 MHz - Resolution: 27.7 ns- Min PWM frequency: 550Hz (fHRTIM=144MHz)
3115 #define __HAL_HRTIM_SETCLOCKPRESCALER(__HANDLE__, __TIMER__, __PRESCALER__) \
3116 (((__TIMER__) == HRTIM_TIMERINDEX_MASTER) ? (MODIFY_REG((__HANDLE__)->Instance->sMasterRegs.MCR, HRTIM_MCR_CK_PSC, (__PRESCALER__))) :\
3117 (MODIFY_REG((__HANDLE__)->Instance->sTimerxRegs[(__TIMER__)].TIMxCR, HRTIM_TIMCR_CK_PSC, (__PRESCALER__))))
3119 /** @brief Gets the HRTIM timer clock prescaler value on runtime
3120 * @param __HANDLE__ HRTIM Handle.
3121 * @param __TIMER__ HRTIM timer
3122 * This parameter can be one of the following values:
3123 * @arg 0x5 for master timer
3124 * @arg 0x0 to 0x4 for timers A to E
3125 * @retval timer clock prescaler value
3127 #define __HAL_HRTIM_GETCLOCKPRESCALER(__HANDLE__, __TIMER__) \
3128 (((__TIMER__) == HRTIM_TIMERINDEX_MASTER) ? ((__HANDLE__)->Instance->sMasterRegs.MCR & HRTIM_MCR_CK_PSC) :\
3129 ((__HANDLE__)->Instance->sTimerxRegs[(__TIMER__)].TIMxCR & HRTIM_TIMCR_CK_PSC))
3131 /** @brief Sets the HRTIM timer Compare Register value on runtime
3132 * @param __HANDLE__ HRTIM Handle.
3133 * @param __TIMER__ HRTIM timer
3134 * This parameter can be one of the following values:
3135 * @arg 0x0 to 0x4 for timers A to E
3136 * @param __COMPAREUNIT__ timer compare unit
3137 * This parameter can be one of the following values:
3138 * @arg HRTIM_COMPAREUNIT_1: Compare unit 1
3139 * @arg HRTIM_COMPAREUNIT_2: Compare unit 2
3140 * @arg HRTIM_COMPAREUNIT_3: Compare unit 3
3141 * @arg HRTIM_COMPAREUNIT_4: Compare unit 4
3142 * @param __COMPARE__ specifies the Compare new value.
3145 #define __HAL_HRTIM_SETCOMPARE(__HANDLE__, __TIMER__, __COMPAREUNIT__, __COMPARE__) \
3146 (((__TIMER__) == HRTIM_TIMERINDEX_MASTER) ? \
3147 (((__COMPAREUNIT__) == HRTIM_COMPAREUNIT_1) ? ((__HANDLE__)->Instance->sMasterRegs.MCMP1R = (__COMPARE__)) :\
3148 ((__COMPAREUNIT__) == HRTIM_COMPAREUNIT_2) ? ((__HANDLE__)->Instance->sMasterRegs.MCMP2R = (__COMPARE__)) :\
3149 ((__COMPAREUNIT__) == HRTIM_COMPAREUNIT_3) ? ((__HANDLE__)->Instance->sMasterRegs.MCMP3R = (__COMPARE__)) :\
3150 ((__HANDLE__)->Instance->sMasterRegs.MCMP4R = (__COMPARE__))) \
3152 (((__COMPAREUNIT__) == HRTIM_COMPAREUNIT_1) ? ((__HANDLE__)->Instance->sTimerxRegs[(__TIMER__)].CMP1xR = (__COMPARE__)) :\
3153 ((__COMPAREUNIT__) == HRTIM_COMPAREUNIT_2) ? ((__HANDLE__)->Instance->sTimerxRegs[(__TIMER__)].CMP2xR = (__COMPARE__)) :\
3154 ((__COMPAREUNIT__) == HRTIM_COMPAREUNIT_3) ? ((__HANDLE__)->Instance->sTimerxRegs[(__TIMER__)].CMP3xR = (__COMPARE__)) :\
3155 ((__HANDLE__)->Instance->sTimerxRegs[(__TIMER__)].CMP4xR = (__COMPARE__))))
3157 /** @brief Gets the HRTIM timer Compare Register value on runtime
3158 * @param __HANDLE__ HRTIM Handle.
3159 * @param __TIMER__ HRTIM timer
3160 * This parameter can be one of the following values:
3161 * @arg 0x0 to 0x4 for timers A to E
3162 * @param __COMPAREUNIT__ timer compare unit
3163 * This parameter can be one of the following values:
3164 * @arg HRTIM_COMPAREUNIT_1: Compare unit 1
3165 * @arg HRTIM_COMPAREUNIT_2: Compare unit 2
3166 * @arg HRTIM_COMPAREUNIT_3: Compare unit 3
3167 * @arg HRTIM_COMPAREUNIT_4: Compare unit 4
3168 * @retval Compare value
3170 #define __HAL_HRTIM_GETCOMPARE(__HANDLE__, __TIMER__, __COMPAREUNIT__) \
3171 (((__TIMER__) == HRTIM_TIMERINDEX_MASTER) ? \
3172 (((__COMPAREUNIT__) == HRTIM_COMPAREUNIT_1) ? ((__HANDLE__)->Instance->sMasterRegs.MCMP1R) :\
3173 ((__COMPAREUNIT__) == HRTIM_COMPAREUNIT_2) ? ((__HANDLE__)->Instance->sMasterRegs.MCMP2R) :\
3174 ((__COMPAREUNIT__) == HRTIM_COMPAREUNIT_3) ? ((__HANDLE__)->Instance->sMasterRegs.MCMP3R) :\
3175 ((__HANDLE__)->Instance->sMasterRegs.MCMP4R)) \
3177 (((__COMPAREUNIT__) == HRTIM_COMPAREUNIT_1) ? ((__HANDLE__)->Instance->sTimerxRegs[(__TIMER__)].CMP1xR) :\
3178 ((__COMPAREUNIT__) == HRTIM_COMPAREUNIT_2) ? ((__HANDLE__)->Instance->sTimerxRegs[(__TIMER__)].CMP2xR) :\
3179 ((__COMPAREUNIT__) == HRTIM_COMPAREUNIT_3) ? ((__HANDLE__)->Instance->sTimerxRegs[(__TIMER__)].CMP3xR) :\
3180 ((__HANDLE__)->Instance->sTimerxRegs[(__TIMER__)].CMP4xR)))
3186 /* Exported functions --------------------------------------------------------*/
3187 /** @addtogroup HRTIM_Exported_Functions
3191 /** @addtogroup HRTIM_Exported_Functions_Group1
3195 /* Initialization and Configuration functions ********************************/
3196 HAL_StatusTypeDef
HAL_HRTIM_Init(HRTIM_HandleTypeDef
*hhrtim
);
3198 HAL_StatusTypeDef
HAL_HRTIM_DeInit (HRTIM_HandleTypeDef
*hhrtim
);
3200 void HAL_HRTIM_MspInit(HRTIM_HandleTypeDef
*hhrtim
);
3202 void HAL_HRTIM_MspDeInit(HRTIM_HandleTypeDef
*hhrtim
);
3204 HAL_StatusTypeDef
HAL_HRTIM_TimeBaseConfig(HRTIM_HandleTypeDef
*hhrtim
,
3206 HRTIM_TimeBaseCfgTypeDef
* pTimeBaseCfg
);
3211 /** @addtogroup HRTIM_Exported_Functions_Group2
3215 /* Simple time base related functions *****************************************/
3216 HAL_StatusTypeDef
HAL_HRTIM_SimpleBaseStart(HRTIM_HandleTypeDef
*hhrtim
,
3219 HAL_StatusTypeDef
HAL_HRTIM_SimpleBaseStop(HRTIM_HandleTypeDef
*hhrtim
,
3222 HAL_StatusTypeDef
HAL_HRTIM_SimpleBaseStart_IT(HRTIM_HandleTypeDef
*hhrtim
,
3225 HAL_StatusTypeDef
HAL_HRTIM_SimpleBaseStop_IT(HRTIM_HandleTypeDef
*hhrtim
,
3228 HAL_StatusTypeDef
HAL_HRTIM_SimpleBaseStart_DMA(HRTIM_HandleTypeDef
*hhrtim
,
3234 HAL_StatusTypeDef
HAL_HRTIM_SimpleBaseStop_DMA(HRTIM_HandleTypeDef
*hhrtim
,
3241 /** @addtogroup HRTIM_Exported_Functions_Group3
3244 /* Simple output compare related functions ************************************/
3245 HAL_StatusTypeDef
HAL_HRTIM_SimpleOCChannelConfig(HRTIM_HandleTypeDef
*hhrtim
,
3248 HRTIM_SimpleOCChannelCfgTypeDef
* pSimpleOCChannelCfg
);
3250 HAL_StatusTypeDef
HAL_HRTIM_SimpleOCStart(HRTIM_HandleTypeDef
*hhrtim
,
3252 uint32_t OCChannel
);
3254 HAL_StatusTypeDef
HAL_HRTIM_SimpleOCStop(HRTIM_HandleTypeDef
*hhrtim
,
3256 uint32_t OCChannel
);
3258 HAL_StatusTypeDef
HAL_HRTIM_SimpleOCStart_IT(HRTIM_HandleTypeDef
*hhrtim
,
3260 uint32_t OCChannel
);
3262 HAL_StatusTypeDef
HAL_HRTIM_SimpleOCStop_IT(HRTIM_HandleTypeDef
*hhrtim
,
3264 uint32_t OCChannel
);
3266 HAL_StatusTypeDef
HAL_HRTIM_SimpleOCStart_DMA(HRTIM_HandleTypeDef
*hhrtim
,
3273 HAL_StatusTypeDef
HAL_HRTIM_SimpleOCStop_DMA(HRTIM_HandleTypeDef
*hhrtim
,
3275 uint32_t OCChannel
);
3281 /** @addtogroup HRTIM_Exported_Functions_Group4
3284 /* Simple PWM output related functions ****************************************/
3285 HAL_StatusTypeDef
HAL_HRTIM_SimplePWMChannelConfig(HRTIM_HandleTypeDef
*hhrtim
,
3287 uint32_t PWMChannel
,
3288 HRTIM_SimplePWMChannelCfgTypeDef
* pSimplePWMChannelCfg
);
3290 HAL_StatusTypeDef
HAL_HRTIM_SimplePWMStart(HRTIM_HandleTypeDef
*hhrtim
,
3292 uint32_t PWMChannel
);
3294 HAL_StatusTypeDef
HAL_HRTIM_SimplePWMStop(HRTIM_HandleTypeDef
*hhrtim
,
3296 uint32_t PWMChannel
);
3298 HAL_StatusTypeDef
HAL_HRTIM_SimplePWMStart_IT(HRTIM_HandleTypeDef
*hhrtim
,
3300 uint32_t PWMChannel
);
3302 HAL_StatusTypeDef
HAL_HRTIM_SimplePWMStop_IT(HRTIM_HandleTypeDef
*hhrtim
,
3304 uint32_t PWMChannel
);
3306 HAL_StatusTypeDef
HAL_HRTIM_SimplePWMStart_DMA(HRTIM_HandleTypeDef
*hhrtim
,
3308 uint32_t PWMChannel
,
3313 HAL_StatusTypeDef
HAL_HRTIM_SimplePWMStop_DMA(HRTIM_HandleTypeDef
*hhrtim
,
3315 uint32_t PWMChannel
);
3321 /** @addtogroup HRTIM_Exported_Functions_Group5
3324 /* Simple capture related functions *******************************************/
3325 HAL_StatusTypeDef
HAL_HRTIM_SimpleCaptureChannelConfig(HRTIM_HandleTypeDef
*hhrtim
,
3327 uint32_t CaptureChannel
,
3328 HRTIM_SimpleCaptureChannelCfgTypeDef
* pSimpleCaptureChannelCfg
);
3330 HAL_StatusTypeDef
HAL_HRTIM_SimpleCaptureStart(HRTIM_HandleTypeDef
*hhrtim
,
3332 uint32_t CaptureChannel
);
3334 HAL_StatusTypeDef
HAL_HRTIM_SimpleCaptureStop(HRTIM_HandleTypeDef
*hhrtim
,
3336 uint32_t CaptureChannel
);
3338 HAL_StatusTypeDef
HAL_HRTIM_SimpleCaptureStart_IT(HRTIM_HandleTypeDef
*hhrtim
,
3340 uint32_t CaptureChannel
);
3342 HAL_StatusTypeDef
HAL_HRTIM_SimpleCaptureStop_IT(HRTIM_HandleTypeDef
*hhrtim
,
3344 uint32_t CaptureChannel
);
3346 HAL_StatusTypeDef
HAL_HRTIM_SimpleCaptureStart_DMA(HRTIM_HandleTypeDef
*hhrtim
,
3348 uint32_t CaptureChannel
,
3353 HAL_StatusTypeDef
HAL_HRTIM_SimpleCaptureStop_DMA(HRTIM_HandleTypeDef
*hhrtim
,
3355 uint32_t CaptureChannel
);
3361 /** @addtogroup HRTIM_Exported_Functions_Group6
3364 /* Simple one pulse related functions *****************************************/
3365 HAL_StatusTypeDef
HAL_HRTIM_SimpleOnePulseChannelConfig(HRTIM_HandleTypeDef
*hhrtim
,
3367 uint32_t OnePulseChannel
,
3368 HRTIM_SimpleOnePulseChannelCfgTypeDef
* pSimpleOnePulseChannelCfg
);
3370 HAL_StatusTypeDef
HAL_HRTIM_SimpleOnePulseStart(HRTIM_HandleTypeDef
*hhrtim
,
3372 uint32_t OnePulseChannel
);
3374 HAL_StatusTypeDef
HAL_HRTIM_SimpleOnePulseStop(HRTIM_HandleTypeDef
*hhrtim
,
3376 uint32_t OnePulseChannel
);
3378 HAL_StatusTypeDef
HAL_HRTIM_SimpleOnePulseStart_IT(HRTIM_HandleTypeDef
*hhrtim
,
3380 uint32_t OnePulseChannel
);
3382 HAL_StatusTypeDef
HAL_HRTIM_SimpleOnePulseStop_IT(HRTIM_HandleTypeDef
*hhrtim
,
3384 uint32_t OnePulseChannel
);
3390 /** @addtogroup HRTIM_Exported_Functions_Group7
3393 HAL_StatusTypeDef
HAL_HRTIM_BurstModeConfig(HRTIM_HandleTypeDef
*hhrtim
,
3394 HRTIM_BurstModeCfgTypeDef
* pBurstModeCfg
);
3396 HAL_StatusTypeDef
HAL_HRTIM_EventConfig(HRTIM_HandleTypeDef
*hhrtim
,
3398 HRTIM_EventCfgTypeDef
* pEventCfg
);
3400 HAL_StatusTypeDef
HAL_HRTIM_EventPrescalerConfig(HRTIM_HandleTypeDef
*hhrtim
,
3401 uint32_t Prescaler
);
3403 HAL_StatusTypeDef
HAL_HRTIM_FaultConfig(HRTIM_HandleTypeDef
*hhrtim
,
3405 HRTIM_FaultCfgTypeDef
* pFaultCfg
);
3407 HAL_StatusTypeDef
HAL_HRTIM_FaultPrescalerConfig(HRTIM_HandleTypeDef
*hhrtim
,
3408 uint32_t Prescaler
);
3410 void HAL_HRTIM_FaultModeCtl(HRTIM_HandleTypeDef
* hhrtim
,
3414 HAL_StatusTypeDef
HAL_HRTIM_ADCTriggerConfig(HRTIM_HandleTypeDef
*hhrtim
,
3415 uint32_t ADCTrigger
,
3416 HRTIM_ADCTriggerCfgTypeDef
* pADCTriggerCfg
);
3422 /** @addtogroup HRTIM_Exported_Functions_Group8
3425 /* Waveform related functions *************************************************/
3426 HAL_StatusTypeDef
HAL_HRTIM_WaveformTimerConfig(HRTIM_HandleTypeDef
*hhrtim
,
3428 HRTIM_TimerCfgTypeDef
* pTimerCfg
);
3430 HAL_StatusTypeDef
HAL_HRTIM_WaveformCompareConfig(HRTIM_HandleTypeDef
*hhrtim
,
3432 uint32_t CompareUnit
,
3433 HRTIM_CompareCfgTypeDef
* pCompareCfg
);
3435 HAL_StatusTypeDef
HAL_HRTIM_WaveformCaptureConfig(HRTIM_HandleTypeDef
*hhrtim
,
3437 uint32_t CaptureUnit
,
3438 HRTIM_CaptureCfgTypeDef
* pCaptureCfg
);
3440 HAL_StatusTypeDef
HAL_HRTIM_WaveformOutputConfig(HRTIM_HandleTypeDef
*hhrtim
,
3443 HRTIM_OutputCfgTypeDef
* pOutputCfg
);
3445 HAL_StatusTypeDef
HAL_HRTIM_WaveformSetOutputLevel(HRTIM_HandleTypeDef
*hhrtim
,
3448 uint32_t OutputLevel
);
3450 HAL_StatusTypeDef
HAL_HRTIM_TimerEventFilteringConfig(HRTIM_HandleTypeDef
*hhrtim
,
3453 HRTIM_TimerEventFilteringCfgTypeDef
* pTimerEventFilteringCfg
);
3455 HAL_StatusTypeDef
HAL_HRTIM_DeadTimeConfig(HRTIM_HandleTypeDef
*hhrtim
,
3457 HRTIM_DeadTimeCfgTypeDef
* pDeadTimeCfg
);
3459 HAL_StatusTypeDef
HAL_HRTIM_ChopperModeConfig(HRTIM_HandleTypeDef
*hhrtim
,
3461 HRTIM_ChopperModeCfgTypeDef
* pChopperModeCfg
);
3463 HAL_StatusTypeDef
HAL_HRTIM_BurstDMAConfig(HRTIM_HandleTypeDef
*hhrtim
,
3465 uint32_t RegistersToUpdate
);
3468 HAL_StatusTypeDef
HAL_HRTIM_WaveformCountStart(HRTIM_HandleTypeDef
*hhrtim
,
3471 HAL_StatusTypeDef
HAL_HRTIM_WaveformCountStop(HRTIM_HandleTypeDef
*hhrtim
,
3474 HAL_StatusTypeDef
HAL_HRTIM_WaveformCountStart_IT(HRTIM_HandleTypeDef
*hhrtim
,
3477 HAL_StatusTypeDef
HAL_HRTIM_WaveformCountStop_IT(HRTIM_HandleTypeDef
*hhrtim
,
3480 HAL_StatusTypeDef
HAL_HRTIM_WaveformCountStart_DMA(HRTIM_HandleTypeDef
*hhrtim
,
3483 HAL_StatusTypeDef
HAL_HRTIM_WaveformCountStop_DMA(HRTIM_HandleTypeDef
*hhrtim
,
3486 HAL_StatusTypeDef
HAL_HRTIM_WaveformOutputStart(HRTIM_HandleTypeDef
*hhrtim
,
3487 uint32_t OutputsToStart
);
3489 HAL_StatusTypeDef
HAL_HRTIM_WaveformOutputStop(HRTIM_HandleTypeDef
*hhrtim
,
3490 uint32_t OutputsToStop
);
3492 HAL_StatusTypeDef
HAL_HRTIM_BurstModeCtl(HRTIM_HandleTypeDef
*hhrtim
,
3495 HAL_StatusTypeDef
HAL_HRTIM_BurstModeSoftwareTrigger(HRTIM_HandleTypeDef
*hhrtim
);
3497 HAL_StatusTypeDef
HAL_HRTIM_SoftwareCapture(HRTIM_HandleTypeDef
*hhrtim
,
3499 uint32_t CaptureUnit
);
3501 HAL_StatusTypeDef
HAL_HRTIM_SoftwareUpdate(HRTIM_HandleTypeDef
*hhrtim
,
3504 HAL_StatusTypeDef
HAL_HRTIM_SoftwareReset(HRTIM_HandleTypeDef
*hhrtim
,
3507 HAL_StatusTypeDef
HAL_HRTIM_BurstDMATransfer(HRTIM_HandleTypeDef
*hhrtim
,
3509 uint32_t BurstBufferAddress
,
3510 uint32_t BurstBufferLength
);
3512 HAL_StatusTypeDef
HAL_HRTIM_UpdateEnable(HRTIM_HandleTypeDef
*hhrtim
,
3515 HAL_StatusTypeDef
HAL_HRTIM_UpdateDisable(HRTIM_HandleTypeDef
*hhrtim
,
3522 /** @addtogroup HRTIM_Exported_Functions_Group9
3525 /* HRTIM peripheral state functions */
3526 HAL_HRTIM_StateTypeDef
HAL_HRTIM_GetState(HRTIM_HandleTypeDef
* hhrtim
);
3528 uint32_t HAL_HRTIM_GetCapturedValue(HRTIM_HandleTypeDef
* hhrtim
,
3530 uint32_t CaptureUnit
);
3532 uint32_t HAL_HRTIM_WaveformGetOutputLevel(HRTIM_HandleTypeDef
*hhrtim
,
3536 uint32_t HAL_HRTIM_WaveformGetOutputState(HRTIM_HandleTypeDef
* hhrtim
,
3540 uint32_t HAL_HRTIM_GetDelayedProtectionStatus(HRTIM_HandleTypeDef
*hhrtim
,
3544 uint32_t HAL_HRTIM_GetBurstStatus(HRTIM_HandleTypeDef
*hhrtim
);
3546 uint32_t HAL_HRTIM_GetCurrentPushPullStatus(HRTIM_HandleTypeDef
*hhrtim
,
3549 uint32_t HAL_HRTIM_GetIdlePushPullStatus(HRTIM_HandleTypeDef
*hhrtim
,
3556 /** @addtogroup HRTIM_Exported_Functions_Group10
3560 void HAL_HRTIM_IRQHandler(HRTIM_HandleTypeDef
*hhrtim
,
3563 /* HRTIM events related callback functions */
3564 void HAL_HRTIM_Fault1Callback(HRTIM_HandleTypeDef
*hhrtim
);
3565 void HAL_HRTIM_Fault2Callback(HRTIM_HandleTypeDef
*hhrtim
);
3566 void HAL_HRTIM_Fault3Callback(HRTIM_HandleTypeDef
*hhrtim
);
3567 void HAL_HRTIM_Fault4Callback(HRTIM_HandleTypeDef
*hhrtim
);
3568 void HAL_HRTIM_Fault5Callback(HRTIM_HandleTypeDef
*hhrtim
);
3569 void HAL_HRTIM_SystemFaultCallback(HRTIM_HandleTypeDef
*hhrtim
);
3570 void HAL_HRTIM_BurstModePeriodCallback(HRTIM_HandleTypeDef
*hhrtim
);
3571 void HAL_HRTIM_SynchronizationEventCallback(HRTIM_HandleTypeDef
*hhrtim
);
3573 /* Timer events related callback functions */
3574 void HAL_HRTIM_RegistersUpdateCallback(HRTIM_HandleTypeDef
*hhrtim
,
3576 void HAL_HRTIM_RepetitionEventCallback(HRTIM_HandleTypeDef
*hhrtim
,
3578 void HAL_HRTIM_Compare1EventCallback(HRTIM_HandleTypeDef
*hhrtim
,
3580 void HAL_HRTIM_Compare2EventCallback(HRTIM_HandleTypeDef
*hhrtim
,
3582 void HAL_HRTIM_Compare3EventCallback(HRTIM_HandleTypeDef
*hhrtim
,
3584 void HAL_HRTIM_Compare4EventCallback(HRTIM_HandleTypeDef
*hhrtim
,
3586 void HAL_HRTIM_Capture1EventCallback(HRTIM_HandleTypeDef
*hhrtim
,
3588 void HAL_HRTIM_Capture2EventCallback(HRTIM_HandleTypeDef
*hhrtim
,
3590 void HAL_HRTIM_DelayedProtectionCallback(HRTIM_HandleTypeDef
*hhrtim
,
3592 void HAL_HRTIM_CounterResetCallback(HRTIM_HandleTypeDef
*hhrtim
,
3594 void HAL_HRTIM_Output1SetCallback(HRTIM_HandleTypeDef
*hhrtim
,
3596 void HAL_HRTIM_Output1ResetCallback(HRTIM_HandleTypeDef
*hhrtim
,
3598 void HAL_HRTIM_Output2SetCallback(HRTIM_HandleTypeDef
*hhrtim
,
3600 void HAL_HRTIM_Output2ResetCallback(HRTIM_HandleTypeDef
*hhrtim
,
3602 void HAL_HRTIM_BurstDMATransferCallback(HRTIM_HandleTypeDef
*hhrtim
,
3604 void HAL_HRTIM_ErrorCallback(HRTIM_HandleTypeDef
*hhrtim
);
3606 #if (USE_HAL_HRTIM_REGISTER_CALLBACKS == 1)
3607 HAL_StatusTypeDef
HAL_HRTIM_RegisterCallback(HRTIM_HandleTypeDef
* hhrtim
,
3608 HAL_HRTIM_CallbackIDTypeDef CallbackID
,
3609 pHRTIM_CallbackTypeDef pCallback
);
3611 HAL_StatusTypeDef
HAL_HRTIM_UnRegisterCallback(HRTIM_HandleTypeDef
* hhrtim
,
3612 HAL_HRTIM_CallbackIDTypeDef CallbackID
);
3614 HAL_StatusTypeDef
HAL_HRTIM_TIMxRegisterCallback(HRTIM_HandleTypeDef
* hhrtim
,
3615 HAL_HRTIM_CallbackIDTypeDef CallbackID
,
3616 pHRTIM_TIMxCallbackTypeDef pCallback
);
3618 HAL_StatusTypeDef
HAL_HRTIM_TIMxUnRegisterCallback(HRTIM_HandleTypeDef
* hhrtim
,
3619 HAL_HRTIM_CallbackIDTypeDef CallbackID
);
3620 #endif /* USE_HAL_HRTIM_REGISTER_CALLBACKS */
3644 #endif /* STM32H7xx_HAL_HRTIM_H */
3646 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/