47 #include "mxc_config.h" Divide input clock by 32.
Definition: tmr.h:71
#define MXC_S_TMR_CN_PRES_DIV8
CN_PRES_DIV8 Setting.
Definition: tmr_regs.h:158
Divide input clock by 16.
Definition: tmr.h:70
Divide input clock by 4.
Definition: tmr.h:68
tmr_pres_t
Timer prescaler values.
Definition: tmr.h:64
Timer Mode COUNTER.
Definition: tmr.h:87
int TMR_GetTime(mxc_tmr_regs_t *tmr, uint32_t ticks, uint32_t *time, tmr_unit_t *units)
Convert timer ticks to real time.
int TMR_PWMSetDuty(mxc_tmr_regs_t *tmr, uint32_t duty)
Set the timer duty cycle.
#define MXC_F_TMR_CN_PRES3
CN_PRES3 Mask.
Definition: tmr_regs.h:175
void TMR_Config(mxc_tmr_regs_t *tmr, const tmr_cfg_t *cfg)
Configure the timer.
Divide input clock by 2048.
Definition: tmr.h:77
Divide input clock by 512.
Definition: tmr.h:75
int TMR_GetTicks(mxc_tmr_regs_t *tmr, uint32_t time, tmr_unit_t units, uint32_t *ticks)
Convert real time to timer ticks.
Timer PWM Configuration.
Definition: tmr.h:116
void TMR_IntClear(mxc_tmr_regs_t *tmr)
Clear the timer interrupt.
void TMR_Enable(mxc_tmr_regs_t *tmr)
Enable the timer.
Millisecond Unit Indicator.
Definition: tmr.h:100
int TMR_PWMSetPeriod(mxc_tmr_regs_t *tmr, uint32_t per)
Set the timer period.
#define MXC_S_TMR_CN_PRES_DIV64
CN_PRES_DIV64 Setting.
Definition: tmr_regs.h:164
Nanosecond Unit Indicator.
Definition: tmr.h:98
void TMR_Init(mxc_tmr_regs_t *tmr, tmr_pres_t pres, const sys_cfg_tmr_t *sys_cfg)
Initialize timer module clock.
uint32_t TMR_IntStatus(mxc_tmr_regs_t *tmr)
Get the timer interrupt status.
void TMR_SetCompare(mxc_tmr_regs_t *tmr, uint32_t cmp_cnt)
Set the timer compare count.
#define MXC_V_TMR_CN_TMODE_CONTINUOUS
CN_TMODE_CONTINUOUS Value.
Definition: tmr_regs.h:134
uint32_t TMR_GetCapture(mxc_tmr_regs_t *tmr)
Get the timer capture count.
void TMR_SetCount(mxc_tmr_regs_t *tmr, uint32_t cnt)
Set the timer count.
Divide input clock by 1.
Definition: tmr.h:66
Timer Configuration.
Definition: tmr.h:107
Divide input clock by 1024.
Definition: tmr.h:76
#define MXC_V_TMR_CN_TMODE_CAPTURE
CN_TMODE_CAPTURE Value.
Definition: tmr_regs.h:140
#define MXC_V_TMR_CN_TMODE_CAPTURECOMPARE
CN_TMODE_CAPTURECOMPARE Value.
Definition: tmr_regs.h:146
Second Unit Indicator.
Definition: tmr.h:101
#define MXC_S_TMR_CN_PRES_DIV2
CN_PRES_DIV2 Setting.
Definition: tmr_regs.h:154
void TMR_Shutdown(mxc_tmr_regs_t *tmr)
Shutdown timer module clock.
Divide input clock by 256.
Definition: tmr.h:74
#define MXC_V_TMR_CN_TMODE_ONESHOT
CN_TMODE_ONESHOT Value.
Definition: tmr_regs.h:132
#define MXC_S_TMR_CN_PRES_DIV128
CN_PRES_DIV128 Setting.
Definition: tmr_regs.h:166
#define MXC_S_TMR_CN_PRES_DIV32
CN_PRES_DIV32 Setting.
Definition: tmr_regs.h:162
Timer Mode COMPARE.
Definition: tmr.h:90
Timer Mode ONESHOT.
Definition: tmr.h:85
Divide input clock by 64.
Definition: tmr.h:72
int TMR_PWMConfig(mxc_tmr_regs_t *tmr, const tmr_pwm_cfg_t *cfg)
Configure the timer for PWM operation.
unsigned pol
Compare register value in timer ticks.
Definition: tmr.h:110
uint32_t duty_cnt
PWM period in timer ticks.
Definition: tmr.h:119
#define MXC_V_TMR_CN_TMODE_COMPARE
CN_TMODE_COMPARE Value.
Definition: tmr_regs.h:142
Timer Mode PWM.
Definition: tmr.h:88
uint32_t TMR_GetCompare(mxc_tmr_regs_t *tmr)
Get the timer compare count.
uint32_t per_cnt
PWM polarity (0 or 1)
Definition: tmr.h:118
Timer Mode CAPTURE.
Definition: tmr.h:89
Divide input clock by 8.
Definition: tmr.h:69
tmr_unit_t
Timer units of time enumeration.
Definition: tmr.h:97
Divide input clock by 128.
Definition: tmr.h:73
uint32_t cmp_cnt
Desired timer mode.
Definition: tmr.h:109
Structure type to access the TMR Registers.
Definition: tmr_regs.h:88
#define MXC_V_TMR_CN_TMODE_GATED
CN_TMODE_GATED Value.
Definition: tmr_regs.h:144
Microsecond Unit Indicator.
Definition: tmr.h:99
Divide input clock by 2.
Definition: tmr.h:67
void TMR_Disable(mxc_tmr_regs_t *tmr)
Disable the timer.
Timer Mode CONTINUOUS.
Definition: tmr.h:86
#define MXC_S_TMR_CN_PRES_DIV4
CN_PRES_DIV4 Setting.
Definition: tmr_regs.h:156
uint32_t TMR_GetCount(mxc_tmr_regs_t *tmr)
Get the timer count.
#define MXC_V_TMR_CN_TMODE_COUNTER
CN_TMODE_COUNTER Value.
Definition: tmr_regs.h:136
#define MXC_S_TMR_CN_PRES_DIV1
CN_PRES_DIV1 Setting.
Definition: tmr_regs.h:152
Timer Mode GATED.
Definition: tmr.h:91
#define MXC_S_TMR_CN_PRES_DIV16
CN_PRES_DIV16 Setting.
Definition: tmr_regs.h:160
#define MXC_V_TMR_CN_TMODE_PWM
CN_TMODE_PWM Value.
Definition: tmr_regs.h:138
tmr_mode_t
Timer modes.
Definition: tmr.h:83