MAX32665 SDK Documentation  0.2
Software Development Kit Overview and API Documentation
Timer Utility Functions

Macros

#define SEC(s)   (((unsigned long)s) * 1000000UL)
 
#define MSEC(ms)   (ms * 1000UL)
 
#define USEC(us)   (us)
 

Functions

void TMR_Delay (mxc_tmr_regs_t *tmr, unsigned long us, const sys_cfg_tmr_t *sys_cfg)
 Delays for the specified number of microseconds. More...
 
void TMR_TO_Start (mxc_tmr_regs_t *tmr, unsigned long us, const sys_cfg_tmr_t *sys_cfg)
 Start the timeout time for the specified number of microseconds. More...
 
int TMR_TO_Check (mxc_tmr_regs_t *tmr)
 Check if the timeout has occurred. More...
 
void TMR_TO_Stop (mxc_tmr_regs_t *tmr)
 Stops the timer for the timeout. More...
 
void TMR_TO_Clear (mxc_tmr_regs_t *tmr)
 Clears the timeout flag. More...
 
unsigned int TMR_TO_Elapsed (mxc_tmr_regs_t *tmr)
 Get the number of microseconds elapsed since TMR_TO_Start(). More...
 
unsigned int TMR_TO_Remaining (mxc_tmr_regs_t *tmr)
 Get the number of microseconds remaining in the timeout. More...
 
void TMR_SW_Start (mxc_tmr_regs_t *tmr, const sys_cfg_tmr_t *sys_cfg)
 Start the stopwatch. More...
 
unsigned int TMR_SW_Stop (mxc_tmr_regs_t *tmr)
 Stop the stopwatch and return the number of microseconds that have elapsed. More...
 

Detailed Description

Function Documentation

◆ TMR_Delay()

void TMR_Delay ( mxc_tmr_regs_t tmr,
unsigned long  us,
const sys_cfg_tmr_t *  sys_cfg 
)
Parameters
tmrWhich Timer instance to use
usNumber of microseconds to delay.
sys_cfgSystem configuration object, identical to TMR_Init()

◆ TMR_TO_Start()

void TMR_TO_Start ( mxc_tmr_regs_t tmr,
unsigned long  us,
const sys_cfg_tmr_t *  sys_cfg 
)
Parameters
tmrWhich Timer instance to use
usNumber of microseconds in the timeout.
sys_cfgSystem configuration object, identical to TMR_Init()

◆ TMR_TO_Check()

int TMR_TO_Check ( mxc_tmr_regs_t tmr)
Parameters
tmrWhich Timer instance to use
Returns
E_NO_ERROR if the timeout has not occurred, E_TIME_OUT if it has.

◆ TMR_TO_Stop()

void TMR_TO_Stop ( mxc_tmr_regs_t tmr)
Parameters
tmrWhich Timer instance to use

◆ TMR_TO_Clear()

void TMR_TO_Clear ( mxc_tmr_regs_t tmr)
Parameters
tmrWhich Timer instance to use

◆ TMR_TO_Elapsed()

unsigned int TMR_TO_Elapsed ( mxc_tmr_regs_t tmr)
Parameters
tmrWhich Timer instance to use
Returns
Number of microseconds since TMR_TO_Start().

◆ TMR_TO_Remaining()

unsigned int TMR_TO_Remaining ( mxc_tmr_regs_t tmr)
Parameters
tmrWhich Timer instance to use
Returns
Number of microseconds until timeout.

◆ TMR_SW_Start()

void TMR_SW_Start ( mxc_tmr_regs_t tmr,
const sys_cfg_tmr_t *  sys_cfg 
)
Note
This function does not handle overflows
Parameters
tmrWhich Timer to use
sys_cfgSystem configuration object, identical to TMR_Init()

◆ TMR_SW_Stop()

unsigned int TMR_SW_Stop ( mxc_tmr_regs_t tmr)
Note
This function does not handle overflows
Parameters
tmrWhich Timer instance to use
Returns
Number of microseconds since TMR_SW_Start().