This section describes default configuration structures for LPTRM module. Create a new configuration structure if default ones don't initialize on-chip peripheral in required operating mode (see Creating Configuration Structure).
#define LPTMR_MODULE_TMR_CNT_RST_ONTCF_MODE_CONFIG |
( |
|
presc, |
|
|
|
clksrc |
|
) |
| |
Value:(tLPTMR){ \
SET(LPTMR_CSR_TIE_MASK)|
SET(LPTMR_CSR_TPS(0))| \
CLR(LPTMR_CSR_TPP_MASK)|
CLR(LPTMR_CSR_TFC_MASK)| \
CLR(LPTMR_CSR_TMS_MASK)|
CLR(LPTMR_CSR_TEN_MASK), \
SET(LPTMR_PSR_PCS(clksrc))|
SET(LPTMR_PSR_PRESCALE(presc))| \
CLR(LPTMR_PSR_PBYP_MASK) \
}
Timer mode selected and Timer operation is disabled after LPTMR_Init() function call. Timer counts until TCF flag is set then counter is reset and counting starts again.
- Parameters
-
presc | Input clock divider value in range from 0 up 15. It divides Timer clock by factor \(2^{(presc+1)}\). |
clksrc | Select one of the LPTMR Clocks Sources. |
#define LPTMR_MODULE_TMR_FREERUN_MODE_CONFIG |
( |
|
presc, |
|
|
|
clksrc |
|
) |
| |
Value:(tLPTMR){ \
SET(LPTMR_CSR_TIE_MASK)|
SET(LPTMR_CSR_TPS(0))| \
CLR(LPTMR_CSR_TPP_MASK)|
SET(LPTMR_CSR_TFC_MASK)| \
CLR(LPTMR_CSR_TMS_MASK)|
CLR(LPTMR_CSR_TEN_MASK), \
SET(LPTMR_PSR_PCS(clksrc))|
SET(LPTMR_PSR_PRESCALE(presc))| \
CLR(LPTMR_PSR_PBYP_MASK) \
}
Timer mode selected and Timer operation is disabled after LPTMR_Init() function call. Timer counts in free running mode.
- Parameters
-
presc | Input clock divider value in range from 0 up 15. It divides Timer clock by factor \(2^{(presc+1)}\). |
clksrc | Select one of the LPTMR Clocks Sources. |