|
| enum | tmr_pres_t {
TMR_PRES_1 = MXC_S_TMR_CN_PRES_DIV1,
TMR_PRES_2 = MXC_S_TMR_CN_PRES_DIV2,
TMR_PRES_4 = MXC_S_TMR_CN_PRES_DIV4,
TMR_PRES_8 = MXC_S_TMR_CN_PRES_DIV8,
TMR_PRES_16 = MXC_S_TMR_CN_PRES_DIV16,
TMR_PRES_32 = MXC_S_TMR_CN_PRES_DIV32,
TMR_PRES_64 = MXC_S_TMR_CN_PRES_DIV64,
TMR_PRES_128 = MXC_S_TMR_CN_PRES_DIV128,
TMR_PRES_256 = MXC_F_TMR_CN_PRES3 | MXC_S_TMR_CN_PRES_DIV1,
TMR_PRES_512 = MXC_F_TMR_CN_PRES3 | MXC_S_TMR_CN_PRES_DIV2,
TMR_PRES_1024 = MXC_F_TMR_CN_PRES3 | MXC_S_TMR_CN_PRES_DIV4,
TMR_PRES_2048 = MXC_F_TMR_CN_PRES3 | MXC_S_TMR_CN_PRES_DIV8,
TMR_PRES_4096 = MXC_F_TMR_CN_PRES3 | MXC_S_TMR_CN_PRES_DIV16
} |
| | Timer prescaler values. More...
|
| |
| enum | tmr_mode_t {
TMR_MODE_ONESHOT = MXC_V_TMR_CN_TMODE_ONESHOT,
TMR_MODE_CONTINUOUS = MXC_V_TMR_CN_TMODE_CONTINUOUS,
TMR_MODE_COUNTER = MXC_V_TMR_CN_TMODE_COUNTER,
TMR_MODE_PWM = MXC_V_TMR_CN_TMODE_PWM,
TMR_MODE_CAPTURE = MXC_V_TMR_CN_TMODE_CAPTURE,
TMR_MODE_COMPARE = MXC_V_TMR_CN_TMODE_COMPARE,
TMR_MODE_GATED = MXC_V_TMR_CN_TMODE_GATED,
TMR_MODE_CAPTURE_COMPARE = MXC_V_TMR_CN_TMODE_CAPTURECOMPARE
} |
| | Timer modes. More...
|
| |
| enum | tmr_unit_t {
TMR_UNIT_NANOSEC = 0,
TMR_UNIT_MICROSEC,
TMR_UNIT_MILLISEC,
TMR_UNIT_SEC
} |
| | Timer units of time enumeration. More...
|
| |
|
| void | TMR_Init (mxc_tmr_regs_t *tmr, tmr_pres_t pres, const sys_cfg_tmr_t *sys_cfg) |
| | Initialize timer module clock. More...
|
| |
| void | TMR_Shutdown (mxc_tmr_regs_t *tmr) |
| | Shutdown timer module clock. More...
|
| |
| void | TMR_Enable (mxc_tmr_regs_t *tmr) |
| | Enable the timer. More...
|
| |
| void | TMR_Disable (mxc_tmr_regs_t *tmr) |
| | Disable the timer. More...
|
| |
| void | TMR_Config (mxc_tmr_regs_t *tmr, const tmr_cfg_t *cfg) |
| | Configure the timer. More...
|
| |
| int | TMR_PWMConfig (mxc_tmr_regs_t *tmr, const tmr_pwm_cfg_t *cfg) |
| | Configure the timer for PWM operation. More...
|
| |
| int | TMR_PWMSetDuty (mxc_tmr_regs_t *tmr, uint32_t duty) |
| | Set the timer duty cycle. More...
|
| |
| int | TMR_PWMSetPeriod (mxc_tmr_regs_t *tmr, uint32_t per) |
| | Set the timer period. More...
|
| |
| uint32_t | TMR_GetCompare (mxc_tmr_regs_t *tmr) |
| | Get the timer compare count. More...
|
| |
| uint32_t | TMR_GetCapture (mxc_tmr_regs_t *tmr) |
| | Get the timer capture count. More...
|
| |
| uint32_t | TMR_GetCount (mxc_tmr_regs_t *tmr) |
| | Get the timer count. More...
|
| |
| void | TMR_IntClear (mxc_tmr_regs_t *tmr) |
| | Clear the timer interrupt. More...
|
| |
| uint32_t | TMR_IntStatus (mxc_tmr_regs_t *tmr) |
| | Get the timer interrupt status. More...
|
| |
| void | TMR_SetCompare (mxc_tmr_regs_t *tmr, uint32_t cmp_cnt) |
| | Set the timer compare count. More...
|
| |
| void | TMR_SetCount (mxc_tmr_regs_t *tmr, uint32_t cnt) |
| | Set the timer count. More...
|
| |
| int | TMR_GetTicks (mxc_tmr_regs_t *tmr, uint32_t time, tmr_unit_t units, uint32_t *ticks) |
| | Convert real time to timer ticks. More...
|
| |
| int | TMR_GetTime (mxc_tmr_regs_t *tmr, uint32_t ticks, uint32_t *time, tmr_unit_t *units) |
| | Convert timer ticks to real time. More...
|
| |