37 #if defined(TIMER_COUNT) && (TIMER_COUNT > 0)
63 #define TIMER_REF_VALID(ref) TIMER_Valid(ref)
66 #if defined(_SILICON_LABS_32B_SERIES_0)
67 #define TIMER_CH_VALID(ch) ((ch) < 3)
68 #elif defined(_SILICON_LABS_32B_SERIES_1)
69 #define TIMER_CH_VALID(ch) ((ch) < 4)
71 #error "Unknown device. Undefined number of channels."
212 #if defined(_TIMER_CC_CTRL_PRSSEL_PRSCH4)
215 #if defined(_TIMER_CC_CTRL_PRSSEL_PRSCH5)
218 #if defined(_TIMER_CC_CTRL_PRSSEL_PRSCH6)
221 #if defined(_TIMER_CC_CTRL_PRSSEL_PRSCH7)
224 #if defined(_TIMER_CC_CTRL_PRSSEL_PRSCH8)
227 #if defined(_TIMER_CC_CTRL_PRSSEL_PRSCH9)
230 #if defined(_TIMER_CC_CTRL_PRSSEL_PRSCH10)
233 #if defined(_TIMER_CC_CTRL_PRSSEL_PRSCH11)
238 #if defined(_TIMER_DTFC_DTFA_NONE)
268 #if defined(TIMER_CTRL_X2CNT) && defined(TIMER_CTRL_ATI)
300 #if defined(TIMER_CTRL_X2CNT) && defined(TIMER_CTRL_ATI)
301 #define TIMER_INIT_DEFAULT \
306 timerClkSelHFPerClk, \
309 timerInputActionNone, \
310 timerInputActionNone, \
318 #define TIMER_INIT_DEFAULT \
323 timerClkSelHFPerClk, \
324 timerInputActionNone, \
325 timerInputActionNone, \
381 #define TIMER_INITCC_DEFAULT \
383 timerEventEveryEdge, \
386 timerOutputActionNone, \
387 timerOutputActionNone, \
388 timerOutputActionNone, \
396 #if defined(_TIMER_DTCTRL_MASK)
459 #define TIMER_INITDTI_DEFAULT \
470 TIMER_DTOGEN_DTOGCC0EN|TIMER_DTOGEN_DTOGCDTI0EN, \
477 timerDtiFaultActionInactive, \
531 #if defined(WTIMER_PRESENT)
562 return timer->
CC[ch].
CCV;
613 timer->
CC[ch].
CCV = val;
662 EFM_ASSERT(TIMER_REF_VALID(timer));
680 #if defined(_TIMER_DTCTRL_MASK)
695 EFM_ASSERT(
TIMER0 == timer);
724 EFM_ASSERT(
TIMER0 == timer);
743 EFM_ASSERT(
TIMER0 == timer);
779 timer->
IEN &= ~flags;
853 return timer->
IF & ien;
873 #if defined(_TIMER_DTLOCK_LOCKKEY_LOCK)
892 EFM_ASSERT(
TIMER0 == timer);
955 #if defined(TIMER_DTLOCK_LOCKKEY_UNLOCK)
965 EFM_ASSERT(
TIMER0 == timer);
uint32_t outputsEnableMask
#define _TIMER_CTRL_MODE_UP
__STATIC_INLINE void TIMER_IntDisable(TIMER_TypeDef *timer, uint32_t flags)
Disable one or more TIMER interrupts.
#define _TIMER_CTRL_PRESC_DIV256
__STATIC_INLINE void TIMER_TopSet(TIMER_TypeDef *timer, uint32_t val)
Set top value for timer.
#define _TIMER_CTRL_MODE_DOWN
TIMER_ClkSel_TypeDef clkSel
bool enableFaultSourcePrsSel0
#define _TIMER_CC_CTRL_ICEDGE_BOTH
TIMER_OutputAction_TypeDef cufoa
Emlib peripheral API "assert" implementation.
TIMER_PRSSEL_TypeDef faultSourcePrsSel0
void TIMER_Reset(TIMER_TypeDef *timer)
Reset TIMER to same state as after a HW reset.
TIMER_InputAction_TypeDef fallAction
__STATIC_INLINE void TIMER_Enable(TIMER_TypeDef *timer, bool enable)
Start/stop TIMER.
#define _TIMER_CC_CTRL_CUFOA_TOGGLE
#define _TIMER_CC_CTRL_ICEDGE_FALLING
#define _TIMER_CC_CTRL_PRSSEL_PRSCH4
#define _TIMER_CC_CTRL_PRSSEL_PRSCH10
__STATIC_INLINE void TIMER_CounterSet(TIMER_TypeDef *timer, uint32_t val)
Set TIMER counter value.
__STATIC_INLINE void TIMER_IntClear(TIMER_TypeDef *timer, uint32_t flags)
Clear one or more pending TIMER interrupts.
CMSIS Cortex-M Peripheral Access Layer for Silicon Laboratories microcontroller devices.
#define TIMER_DTLOCK_LOCKKEY_LOCK
#define _TIMER_CC_CTRL_MODE_INPUTCAPTURE
__STATIC_INLINE void TIMER_EnableDTI(TIMER_TypeDef *timer, bool enable)
Enable or disable DTI unit.
TIMER_CCMode_TypeDef mode
void TIMER_InitDTI(TIMER_TypeDef *timer, const TIMER_InitDTI_TypeDef *init)
Initialize the TIMER DTI unit.
#define _TIMER_CTRL_PRESC_DIV4
bool invertComplementaryOut
__STATIC_INLINE void TIMER_IntEnable(TIMER_TypeDef *timer, uint32_t flags)
Enable one or more TIMER interrupts.
#define _TIMER_CC_CTRL_CUFOA_CLEAR
#define _TIMER_CC_CTRL_PRSSEL_PRSCH8
#define _TIMER_CC_CTRL_PRSSEL_PRSCH7
#define _TIMER_CTRL_PRESC_DIV1024
__STATIC_INLINE void TIMER_IntSet(TIMER_TypeDef *timer, uint32_t flags)
Set one or more pending TIMER interrupts from SW.
#define _TIMER_DTFC_DTFA_NONE
TIMER_PRSSEL_TypeDef prsSel
__STATIC_INLINE void TIMER_TopBufSet(TIMER_TypeDef *timer, uint32_t val)
Set top value buffer for timer.
#define _TIMER_DTFC_DTFA_INACTIVE
#define _TIMER_DTFC_DTFA_TRISTATE
#define _TIMER_CC_CTRL_ICEVCTRL_RISING
__STATIC_INLINE void TIMER_Lock(TIMER_TypeDef *timer)
Lock some of the TIMER registers in order to protect them from being modified.
#define _TIMER_CC_CTRL_PRSSEL_PRSCH3
#define _TIMER_CC_CTRL_ICEVCTRL_EVERYSECONDEDGE
#define _TIMER_CC_CTRL_PRSSEL_PRSCH11
TIMER_DtiFaultAction_TypeDef faultAction
#define _TIMER_CTRL_PRESC_DIV8
__STATIC_INLINE uint32_t TIMER_IntGet(TIMER_TypeDef *timer)
Get pending TIMER interrupt flags.
#define _TIMER_CC_CTRL_PRSSEL_PRSCH6
#define _TIMER_CC_CTRL_ICEVCTRL_FALLING
#define _TIMER_CTRL_FALLA_NONE
TIMER_OutputAction_TypeDef
#define _TIMER_CTRL_PRESC_DIV64
#define _TIMER_CTRL_MODE_UPDOWN
TIMER_PRSSEL_TypeDef faultSourcePrsSel1
#define _TIMER_CC_CTRL_ICEDGE_RISING
TIMER_Event_TypeDef eventCtrl
#define _TIMER_CC_CTRL_ICEVCTRL_EVERYEDGE
TIMER_Prescale_TypeDef prescale
#define _TIMER_CTRL_PRESC_DIV32
#define _TIMER_CTRL_CLKSEL_PRESCHFPERCLK
__STATIC_INLINE void TIMER_CompareSet(TIMER_TypeDef *timer, unsigned int ch, uint32_t val)
Set compare value for compare/capture channel when operating in compare or PWM mode.
__STATIC_INLINE uint32_t TIMER_CounterGet(TIMER_TypeDef *timer)
Get TIMER counter value.
__STATIC_INLINE uint32_t TIMER_CaptureGet(TIMER_TypeDef *timer, unsigned int ch)
Get capture value for compare/capture channel when operating in capture mode.
TIMER_PRSSEL_TypeDef prsSel
#define _TIMER_CTRL_MODE_QDEC
TIMER_Prescale_TypeDef prescale
__STATIC_INLINE bool TIMER_Valid(const TIMER_TypeDef *ref)
Validate the TIMER register block pointer.
__STATIC_INLINE uint32_t TIMER_MaxCount(const TIMER_TypeDef *ref)
Get the Max count of the timer.
#define _TIMER_CC_CTRL_PRSSEL_PRSCH1
TIMER_OutputAction_TypeDef cofoa
#define _TIMER_CC_CTRL_CUFOA_SET
#define _TIMER_CC_CTRL_CUFOA_NONE
#define _TIMER_CC_CTRL_PRSSEL_PRSCH2
#define _TIMER_CC_CTRL_MODE_OUTPUTCOMPARE
void TIMER_Init(TIMER_TypeDef *timer, const TIMER_Init_TypeDef *init)
Initialize TIMER.
TIMER_DtiFaultAction_TypeDef
#define _TIMER_CTRL_CLKSEL_CC1
#define _TIMER_CTRL_PRESC_DIV512
__STATIC_INLINE uint32_t TIMER_TopGet(TIMER_TypeDef *timer)
Get top value setting for timer.
#define TIMER_DTLOCK_LOCKKEY_UNLOCK
TIMER_InputAction_TypeDef riseAction
#define _TIMER_CTRL_FALLA_START
#define _TIMER_CC_CTRL_ICEDGE_NONE
__STATIC_INLINE void TIMER_CompareBufSet(TIMER_TypeDef *timer, unsigned int ch, uint32_t val)
Set compare value buffer for compare/capture channel when operating in compare or PWM mode...
#define _TIMER_CC_CTRL_PRSSEL_PRSCH9
#define _TIMER_CTRL_PRESC_DIV1
__STATIC_INLINE uint32_t TIMER_IntGetEnabled(TIMER_TypeDef *timer)
Get enabled and pending TIMER interrupt flags. Useful for handling more interrupt sources in the same...
__STATIC_INLINE void TIMER_ClearDTIFault(TIMER_TypeDef *timer, uint32_t flags)
Clear DTI fault source flags.
#define _TIMER_DTFC_DTFA_CLEAR
bool enableFaultSourceCoreLockup
bool enableFaultSourcePrsSel1
#define _TIMER_CC_CTRL_PRSSEL_PRSCH0
#define _TIMER_CC_CTRL_PRSSEL_PRSCH5
#define TIMER_DTCTRL_DTEN
void TIMER_InitCC(TIMER_TypeDef *timer, unsigned int ch, const TIMER_InitCC_TypeDef *init)
Initialize TIMER compare/capture channel.
#define _TIMER_CTRL_PRESC_DIV128
#define _TIMER_CC_CTRL_MODE_OFF
TIMER_OutputAction_TypeDef cmoa
__STATIC_INLINE uint32_t TIMER_GetDTIFault(TIMER_TypeDef *timer)
Get DTI fault source flags status.
#define _TIMER_CTRL_FALLA_STOP
#define _TIMER_CTRL_PRESC_DIV2
__STATIC_INLINE void TIMER_Unlock(TIMER_TypeDef *timer)
Unlock the TIMER so that writing to locked registers again is possible.
#define _TIMER_CTRL_FALLA_RELOADSTART
TIMER_InputAction_TypeDef
#define _TIMER_CTRL_CLKSEL_TIMEROUF
#define _TIMER_CC_CTRL_MODE_PWM
bool enableFaultSourceDebugger
#define _TIMER_CTRL_PRESC_DIV16