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)
225 timerPRSSELCh8 = _TIMER_CC_CTRL_PRSSEL_PRSCH8,
227 #if defined(_TIMER_CC_CTRL_PRSSEL_PRSCH9)
228 timerPRSSELCh9 = _TIMER_CC_CTRL_PRSSEL_PRSCH9,
230 #if defined(_TIMER_CC_CTRL_PRSSEL_PRSCH10)
231 timerPRSSELCh10 = _TIMER_CC_CTRL_PRSSEL_PRSCH10,
233 #if defined(_TIMER_CC_CTRL_PRSSEL_PRSCH11)
234 timerPRSSELCh11 = _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
__STATIC_INLINE void TIMER_IntDisable(TIMER_TypeDef *timer, uint32_t flags)
Disable one or more TIMER interrupts.
#define _TIMER_CC_CTRL_CUFOA_CLEAR
#define _TIMER_DTFC_DTFA_CLEAR
#define _TIMER_CTRL_PRESC_DIV32
__STATIC_INLINE void TIMER_TopSet(TIMER_TypeDef *timer, uint32_t val)
Set top value for timer.
#define _TIMER_CTRL_CLKSEL_TIMEROUF
TIMER_ClkSel_TypeDef clkSel
bool enableFaultSourcePrsSel0
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.
#define _TIMER_CTRL_CLKSEL_PRESCHFPERCLK
TIMER_InputAction_TypeDef fallAction
__STATIC_INLINE void TIMER_Enable(TIMER_TypeDef *timer, bool enable)
Start/stop TIMER.
#define _TIMER_CTRL_CLKSEL_CC1
#define _TIMER_CTRL_PRESC_DIV16
#define _TIMER_CC_CTRL_PRSSEL_PRSCH4
__STATIC_INLINE void TIMER_CounterSet(TIMER_TypeDef *timer, uint32_t val)
Set TIMER counter value.
#define _TIMER_CC_CTRL_ICEDGE_FALLING
#define _TIMER_CTRL_PRESC_DIV1
#define _TIMER_CTRL_PRESC_DIV2
#define _TIMER_CTRL_MODE_DOWN
#define _TIMER_CTRL_PRESC_DIV128
__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_CC_CTRL_MODE_PWM
__STATIC_INLINE void TIMER_EnableDTI(TIMER_TypeDef *timer, bool enable)
Enable or disable DTI unit.
TIMER_CCMode_TypeDef mode
#define _TIMER_CTRL_FALLA_RELOADSTART
void TIMER_InitDTI(TIMER_TypeDef *timer, const TIMER_InitDTI_TypeDef *init)
Initialize the TIMER DTI unit.
bool invertComplementaryOut
#define _TIMER_CTRL_PRESC_DIV64
__STATIC_INLINE void TIMER_IntEnable(TIMER_TypeDef *timer, uint32_t flags)
Enable one or more TIMER interrupts.
#define _TIMER_DTFC_DTFA_NONE
#define TIMER_DTLOCK_LOCKKEY_LOCK
#define _TIMER_CC_CTRL_PRSSEL_PRSCH3
#define _TIMER_CTRL_MODE_QDEC
#define _TIMER_CC_CTRL_ICEDGE_BOTH
__STATIC_INLINE void TIMER_IntSet(TIMER_TypeDef *timer, uint32_t flags)
Set one or more pending TIMER interrupts from SW.
#define _TIMER_CTRL_PRESC_DIV4
TIMER_PRSSEL_TypeDef prsSel
__STATIC_INLINE void TIMER_TopBufSet(TIMER_TypeDef *timer, uint32_t val)
Set top value buffer for timer.
#define _TIMER_CC_CTRL_CUFOA_SET
#define _TIMER_CC_CTRL_MODE_OFF
#define _TIMER_CC_CTRL_CUFOA_NONE
#define _TIMER_CC_CTRL_PRSSEL_PRSCH1
#define _TIMER_CC_CTRL_PRSSEL_PRSCH2
#define _TIMER_DTFC_DTFA_TRISTATE
__STATIC_INLINE void TIMER_Lock(TIMER_TypeDef *timer)
Lock some of the TIMER registers in order to protect them from being modified.
TIMER_DtiFaultAction_TypeDef faultAction
__STATIC_INLINE uint32_t TIMER_IntGet(TIMER_TypeDef *timer)
Get pending TIMER interrupt flags.
#define TIMER_DTCTRL_DTEN
TIMER_OutputAction_TypeDef
#define _TIMER_CTRL_PRESC_DIV8
#define _TIMER_CC_CTRL_ICEVCTRL_FALLING
TIMER_PRSSEL_TypeDef faultSourcePrsSel1
TIMER_Event_TypeDef eventCtrl
TIMER_Prescale_TypeDef prescale
#define _TIMER_CTRL_FALLA_START
#define _TIMER_CTRL_FALLA_STOP
__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
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_CTRL_PRESC_DIV1024
TIMER_OutputAction_TypeDef cofoa
#define _TIMER_CTRL_MODE_UP
#define _TIMER_CC_CTRL_PRSSEL_PRSCH0
#define _TIMER_DTFC_DTFA_INACTIVE
void TIMER_Init(TIMER_TypeDef *timer, const TIMER_Init_TypeDef *init)
Initialize TIMER.
TIMER_DtiFaultAction_TypeDef
#define _TIMER_CC_CTRL_ICEVCTRL_EVERYSECONDEDGE
#define _TIMER_CC_CTRL_ICEDGE_RISING
__STATIC_INLINE uint32_t TIMER_TopGet(TIMER_TypeDef *timer)
Get top value setting for timer.
#define _TIMER_CTRL_FALLA_NONE
#define _TIMER_CC_CTRL_ICEVCTRL_EVERYEDGE
TIMER_InputAction_TypeDef riseAction
__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...
__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_CC_CTRL_PRSSEL_PRSCH5
bool enableFaultSourceCoreLockup
#define _TIMER_CTRL_MODE_UPDOWN
bool enableFaultSourcePrsSel1
#define _TIMER_CC_CTRL_PRSSEL_PRSCH6
#define _TIMER_CC_CTRL_PRSSEL_PRSCH7
void TIMER_InitCC(TIMER_TypeDef *timer, unsigned int ch, const TIMER_InitCC_TypeDef *init)
Initialize TIMER compare/capture channel.
TIMER_OutputAction_TypeDef cmoa
__STATIC_INLINE uint32_t TIMER_GetDTIFault(TIMER_TypeDef *timer)
Get DTI fault source flags status.
#define TIMER_DTLOCK_LOCKKEY_UNLOCK
#define _TIMER_CTRL_PRESC_DIV512
#define _TIMER_CTRL_PRESC_DIV256
#define _TIMER_CC_CTRL_ICEDGE_NONE
__STATIC_INLINE void TIMER_Unlock(TIMER_TypeDef *timer)
Unlock the TIMER so that writing to locked registers again is possible.
#define _TIMER_CC_CTRL_MODE_OUTPUTCOMPARE
#define _TIMER_CC_CTRL_CUFOA_TOGGLE
#define _TIMER_CC_CTRL_MODE_INPUTCAPTURE
TIMER_InputAction_TypeDef
bool enableFaultSourceDebugger
#define _TIMER_CC_CTRL_ICEVCTRL_RISING