You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

3662 lines
230 KiB

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