44 #include "mxc_device.h" 142 typedef void (*mxc_tmr_complete_t) (
int error);
mxc_tmr_unit_t
Timer units of time enumeration.
Definition: tmr.h:107
void MXC_TMR_TO_Clear(mxc_tmr_regs_t *tmr)
Clear timeout timer back to zero.
uint32_t MXC_TMR_GetCompare(mxc_tmr_regs_t *tmr)
Get the timer compare count.
uint32_t MXC_TMR_GetFlags(mxc_tmr_regs_t *tmr)
Get the timer interrupt status.
#define MXC_V_TMR_CTRL0_MODE_A_CAPTURE
Definition: tmr_regs.h:191
mxc_tmr_pres_t pres
Definition: tmr.h:133
void MXC_TMR_SetCount(mxc_tmr_regs_t *tmr, uint32_t cnt)
Set the timer count.
#define MXC_V_TMR_CTRL0_MODE_A_PWM
Definition: tmr_regs.h:189
#define MXC_S_TMR_CTRL0_CLKDIV_A_DIV_BY_4096
Definition: tmr_regs.h:231
int MXC_TMR_GetTime(mxc_tmr_regs_t *tmr, uint32_t ticks, uint32_t *time, mxc_tmr_unit_t *units)
Get time from timer.
void MXC_TMR_DisableInt(mxc_tmr_regs_t *tmr)
disable interupt
unsigned pol
Definition: tmr.h:138
#define MXC_S_TMR_CTRL0_MODE_A_CAPCOMP
Definition: tmr_regs.h:198
void MXC_TMR_EnableInt(mxc_tmr_regs_t *tmr)
enable interupt
void MXC_TMR_ClearFlags(mxc_tmr_regs_t *tmr)
Clear the timer interrupt.
mxc_tmr_mode_t mode
Definition: tmr.h:134
int MXC_TMR_GetTicks(mxc_tmr_regs_t *tmr, uint32_t time, mxc_tmr_unit_t units, uint32_t *ticks)
Get ticks from timer.
#define MXC_V_TMR_CTRL0_MODE_A_COMPARE
Definition: tmr_regs.h:193
#define MXC_V_TMR_CTRL0_MODE_A_CONTINUOUS
Definition: tmr_regs.h:185
unsigned int MXC_TMR_SW_Stop(mxc_tmr_regs_t *tmr)
Stopwatch stop.
#define MXC_S_TMR_CTRL0_CLKDIV_A_DIV_BY_512
Definition: tmr_regs.h:225
#define MXC_S_TMR_CTRL0_CLKDIV_A_DIV_BY_1
Definition: tmr_regs.h:207
int MXC_TMR_TO_Check(mxc_tmr_regs_t *tmr)
Check on time out timer.
#define MXC_S_TMR_CTRL0_MODE_A_ONE_SHOT
Definition: tmr_regs.h:184
mxc_tmr_clock_t
Peripheral Clock settings.
Definition: tmr.h:117
#define MXC_S_TMR_CTRL0_CLKDIV_A_DIV_BY_4
Definition: tmr_regs.h:211
void MXC_TMR_TO_Start(mxc_tmr_regs_t *tmr, unsigned long us)
Start a timer that will time out after a certain number of microseconds.
uint32_t MXC_TMR_GetPeriod(mxc_tmr_regs_t *tmr, mxc_tmr_clock_t clock, uint32_t prescalar, uint32_t frequency)
Calculate count for required frequency.
unsigned int MXC_TMR_TO_Elapsed(mxc_tmr_regs_t *tmr)
Get elapsed time of timeout timer.
void MXC_TMR_Shutdown(mxc_tmr_regs_t *tmr)
Shutdown timer module clock.
#define MXC_S_TMR_CTRL0_CLKDIV_A_DIV_BY_1024
Definition: tmr_regs.h:227
#define MXC_S_TMR_CTRL0_CLKDIV_A_DIV_BY_128
Definition: tmr_regs.h:221
#define MXC_V_TMR_CTRL0_MODE_A_COUNTER
Definition: tmr_regs.h:187
void MXC_TMR_TO_Stop(mxc_tmr_regs_t *tmr)
Stop the Timeout timer.
#define MXC_S_TMR_CTRL0_CLKDIV_A_DIV_BY_2
Definition: tmr_regs.h:209
uint32_t cmp_cnt
Definition: tmr.h:137
void MXC_TMR_SetCompare(mxc_tmr_regs_t *tmr, uint32_t cmp_cnt)
Set the timer compare count.
#define MXC_S_TMR_CTRL0_CLKDIV_A_DIV_BY_256
Definition: tmr_regs.h:223
Timer Configuration.
Definition: tmr.h:132
mxc_tmr_mode_t
Timer modes.
Definition: tmr.h:83
void MXC_TMR_DisableWakeup(mxc_tmr_regs_t *tmr, mxc_tmr_cfg_t *cfg)
Disable wakeup from sleep.
void MXC_TMR_Start(mxc_tmr_regs_t *tmr)
Start the timer counting.
uint32_t MXC_TMR_GetCount(mxc_tmr_regs_t *tmr)
Get the timer count.
uint32_t MXC_TMR_GetCapture(mxc_tmr_regs_t *tmr)
Get the timer capture count.
void MXC_TMR_SW_Start(mxc_tmr_regs_t *tmr)
Start stopwatch.
mxc_tmr_bit_mode_t bitMode
Definition: tmr.h:135
mxc_tmr_pres_t
Timer prescaler values.
Definition: tmr.h:64
#define MXC_V_TMR_CTRL0_MODE_A_GATED
Definition: tmr_regs.h:195
#define MXC_S_TMR_CTRL0_CLKDIV_A_DIV_BY_32
Definition: tmr_regs.h:217
int MXC_TMR_SetPWM(mxc_tmr_regs_t *tmr, uint32_t pwm)
Set the value of the first transition in PWM mode.
#define MXC_S_TMR_CTRL0_CLKDIV_A_DIV_BY_64
Definition: tmr_regs.h:219
void MXC_TMR_Stop(mxc_tmr_regs_t *tmr)
Stop the timer.
#define MXC_S_TMR_CTRL0_CLKDIV_A_DIV_BY_2048
Definition: tmr_regs.h:229
unsigned int MXC_TMR_TO_Remaining(mxc_tmr_regs_t *tmr)
Amount of time remaining until timeour.
void MXC_TMR_EnableWakeup(mxc_tmr_regs_t *tmr, mxc_tmr_cfg_t *cfg)
Enable wakeup from sleep.
Definition: tmr_regs.h:88
void MXC_TMR_Delay(mxc_tmr_regs_t *tmr, unsigned long us)
Dealay for a set periord of time measured in microseconds.
int MXC_TMR_Init(mxc_tmr_regs_t *tmr, mxc_tmr_cfg_t *cfg, bool init_pins)
Initialize timer module clock.
mxc_tmr_clock_t clock
Definition: tmr.h:136
#define MXC_S_TMR_CTRL0_CLKDIV_A_DIV_BY_8
Definition: tmr_regs.h:213
#define MXC_S_TMR_CTRL0_CLKDIV_A_DIV_BY_16
Definition: tmr_regs.h:215
mxc_tmr_bit_mode_t
Timer bit mode.
Definition: tmr.h:98