34 #if defined(TIMER_COUNT) && (TIMER_COUNT > 0)
78 EFM_ASSERT(TIMER_REF_VALID(timer));
134 EFM_ASSERT(TIMER_REF_VALID(timer));
135 EFM_ASSERT(TIMER_CH_VALID(ch));
152 #if defined(_TIMER_DTCTRL_MASK)
163 void TIMER_InitDTI(
TIMER_TypeDef *timer,
const TIMER_InitDTI_TypeDef *init)
165 EFM_ASSERT(
TIMER0 == timer);
168 TIMER_EnableDTI (timer,
false);
173 (init->autoRestart ? TIMER_DTCTRL_DTDAS : 0)
174 | (init->activeLowOut ? TIMER_DTCTRL_DTIPOL : 0)
175 | (init->invertComplementaryOut ? TIMER_DTCTRL_DTCINV : 0)
176 | (init->enablePrsSource ? TIMER_DTCTRL_DTPRSEN : 0)
177 | ((uint32_t)(init->prsSel) << _TIMER_DTCTRL_DTPRSSEL_SHIFT);
181 ((uint32_t)(init->prescale) << _TIMER_DTTIME_DTPRESC_SHIFT)
182 | ((uint32_t)(init->riseTime) << _TIMER_DTTIME_DTRISET_SHIFT)
183 | ((uint32_t)(init->fallTime) << _TIMER_DTTIME_DTFALLT_SHIFT);
187 (init->enableFaultSourceCoreLockup ? TIMER_DTFC_DTLOCKUPFEN : 0)
188 | (init->enableFaultSourceDebugger ? TIMER_DTFC_DTDBGFEN : 0)
189 | (init->enableFaultSourcePrsSel0 ? TIMER_DTFC_DTPRS0FEN : 0)
190 | (init->enableFaultSourcePrsSel1 ? TIMER_DTFC_DTPRS1FEN : 0)
191 | ((uint32_t)(init->faultAction) << _TIMER_DTFC_DTFA_SHIFT)
192 | ((uint32_t)(init->faultSourcePrsSel0) << _TIMER_DTFC_DTPRS0FSEL_SHIFT)
193 | ((uint32_t)(init->faultSourcePrsSel1) << _TIMER_DTFC_DTPRS1FSEL_SHIFT);
196 timer->DTOGEN = init->outputsEnableMask;
199 TIMER_ClearDTIFault(timer, TIMER_GetDTIFault(timer));
202 TIMER_EnableDTI (timer, init->enable);
222 EFM_ASSERT(TIMER_REF_VALID(timer));
237 for (i = 0; TIMER_CH_VALID(i); i++)
246 #if defined(TIMER_DTLOCK_LOCKKEY_UNLOCK)
248 timer->DTLOCK = TIMER_DTLOCK_LOCKKEY_UNLOCK;
250 timer->DTCTRL = _TIMER_DTCTRL_RESETVALUE;
251 timer->DTTIME = _TIMER_DTTIME_RESETVALUE;
252 timer->DTFC = _TIMER_DTFC_RESETVALUE;
253 timer->DTOGEN = _TIMER_DTOGEN_RESETVALUE;
254 timer->DTFAULTC = _TIMER_DTFAULTC_MASK;
#define _TIMER_CTRL_RESETVALUE
#define _TIMER_CNT_RESETVALUE
#define TIMER_CTRL_QDM_X4
#define _TIMER_TOPB_RESETVALUE
TIMER_ClkSel_TypeDef clkSel
#define TIMER_CC_CTRL_COIST
TIMER_OutputAction_TypeDef cufoa
Emlib peripheral API "assert" implementation.
void TIMER_Reset(TIMER_TypeDef *timer)
Reset TIMER to same state as after a HW reset.
#define _TIMER_CC_CTRL_CMOA_SHIFT
TIMER_InputAction_TypeDef fallAction
#define _TIMER_CC_CCV_RESETVALUE
#define _TIMER_TOP_RESETVALUE
#define _TIMER_CTRL_FALLA_SHIFT
Timer/counter (TIMER) peripheral API.
#define _TIMER_CC_CCVB_RESETVALUE
TIMER_CCMode_TypeDef mode
#define _TIMER_CC_CTRL_MODE_SHIFT
TIMER_PRSSEL_TypeDef prsSel
#define _TIMER_CC_CTRL_RESETVALUE
#define _TIMER_CTRL_PRESC_SHIFT
#define TIMER_CC_CTRL_FILT_ENABLE
#define TIMER_CC_CTRL_INSEL_PRS
TIMER_Event_TypeDef eventCtrl
#define _TIMER_CTRL_MODE_SHIFT
#define _TIMER_CC_CTRL_COFOA_SHIFT
#define _TIMER_CC_CTRL_ICEDGE_SHIFT
TIMER_Prescale_TypeDef prescale
TIMER_OutputAction_TypeDef cofoa
#define _TIMER_CC_CTRL_PRSSEL_SHIFT
void TIMER_Init(TIMER_TypeDef *timer, const TIMER_Init_TypeDef *init)
Initialize TIMER.
#define TIMER_CC_CTRL_OUTINV
#define _TIMER_CTRL_CLKSEL_SHIFT
TIMER_InputAction_TypeDef riseAction
void TIMER_InitCC(TIMER_TypeDef *timer, unsigned int ch, const TIMER_InitCC_TypeDef *init)
Initialize TIMER compare/capture channel.
TIMER_OutputAction_TypeDef cmoa
#define _TIMER_CTRL_RISEA_SHIFT
#define TIMER_CTRL_DEBUGRUN
#define _TIMER_CC_CTRL_CUFOA_SHIFT
#define _TIMER_CC_CTRL_ICEVCTRL_SHIFT
#define TIMER_CTRL_DMACLRACT
#define _TIMER_IEN_RESETVALUE