 |
MAX32665 Peripheral Driver API
Peripheral Driver API for the MAX32665
|
44 #include "mxc_device.h"
48 #include "mxc_delay.h"
114 typedef void (*mxc_tmr_complete_t) (
int error);
#define MXC_V_TMR_CN_TMODE_ONESHOT
Definition: tmr_regs.h:132
@ TMR_MODE_ONESHOT
Timer Mode ONESHOT.
Definition: tmr.h:83
#define MXC_V_TMR_CN_TMODE_CONTINUOUS
Definition: tmr_regs.h:134
#define MXC_S_TMR_CN_PRES_DIV8
Definition: tmr_regs.h:158
#define MXC_S_TMR_CN_PRES_DIV128
Definition: tmr_regs.h:166
uint32_t MXC_TMR_GetCompare(mxc_tmr_regs_t *tmr)
Get the timer compare count.
mxc_tmr_pres_t pres
Desired timer prescaler.
Definition: tmr.h:107
void MXC_TMR_ClearFlags(mxc_tmr_regs_t *tmr)
Clear the timer interrupt.
uint32_t MXC_TMR_GetFlags(mxc_tmr_regs_t *tmr)
Get the timer interrupt status.
@ TMR_PRES_16
Divide input clock by 16.
Definition: tmr.h:68
@ TMR_MODE_PWM
Timer Mode PWM.
Definition: tmr.h:86
#define MXC_V_TMR_CN_TMODE_PWM
Definition: tmr_regs.h:138
#define MXC_F_TMR_CN_PRES3
Definition: tmr_regs.h:175
#define MXC_V_TMR_CN_TMODE_GATED
Definition: tmr_regs.h:144
@ TMR_PRES_256
Divide input clock by 256.
Definition: tmr.h:72
int MXC_TMR_TO_Check(mxc_tmr_regs_t *tmr)
Check on time out timer.
unsigned int MXC_TMR_SW_Stop(mxc_tmr_regs_t *tmr)
Stopwatch stop.
@ TMR_MODE_CAPTURE_COMPARE
Timer Mode CAPTURECOMPARE.
Definition: tmr.h:90
unsigned pol
Polarity (0 or 1)
Definition: tmr.h:110
void MXC_TMR_Shutdown(mxc_tmr_regs_t *tmr)
Shutdown timer module clock.
@ TMR_MODE_COUNTER
Timer Mode COUNTER.
Definition: tmr.h:85
#define MXC_V_TMR_CN_TMODE_CAPTURE
Definition: tmr_regs.h:140
@ TMR_PRES_4096
Divide input clock by 4096.
Definition: tmr.h:76
@ TMR_PRES_64
Divide input clock by 64.
Definition: tmr.h:70
mxc_tmr_mode_t mode
Desired timer mode.
Definition: tmr.h:108
void MXC_TMR_SetCompare(mxc_tmr_regs_t *tmr, uint32_t cmp_cnt)
Set the timer compare count.
@ TMR_PRES_2
Divide input clock by 2.
Definition: tmr.h:65
@ TMR_UNIT_MICROSEC
Microsecond Unit Indicator.
Definition: tmr.h:98
@ TMR_PRES_8
Divide input clock by 8.
Definition: tmr.h:67
#define MXC_V_TMR_CN_TMODE_CAPTURECOMPARE
Definition: tmr_regs.h:146
@ TMR_UNIT_SEC
Second Unit Indicator.
Definition: tmr.h:100
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.
@ TMR_MODE_CAPTURE
Timer Mode CAPTURE.
Definition: tmr.h:87
@ TMR_PRES_2048
Divide input clock by 2048.
Definition: tmr.h:75
@ TMR_UNIT_MILLISEC
Millisecond Unit Indicator.
Definition: tmr.h:99
mxc_tmr_mode_t
Timer modes.
Definition: tmr.h:82
void MXC_TMR_Init(mxc_tmr_regs_t *tmr, mxc_tmr_cfg_t *cfg)
Initialize timer module clock.
#define MXC_S_TMR_CN_PRES_DIV4
Definition: tmr_regs.h:156
@ TMR_PRES_512
Divide input clock by 512.
Definition: tmr.h:73
#define MXC_V_TMR_CN_TMODE_COUNTER
Definition: tmr_regs.h:136
@ TMR_PRES_4
Divide input clock by 4.
Definition: tmr.h:66
void MXC_TMR_EnableInt(mxc_tmr_regs_t *tmr)
enable interupt
unsigned int MXC_TMR_TO_Elapsed(mxc_tmr_regs_t *tmr)
Get elapsed time of timeout timer.
mxc_tmr_pres_t
Timer prescaler values.
Definition: tmr.h:63
#define MXC_S_TMR_CN_PRES_DIV16
Definition: tmr_regs.h:160
@ TMR_MODE_CONTINUOUS
Timer Mode CONTINUOUS.
Definition: tmr.h:84
Timer Configuration.
Definition: tmr.h:106
uint32_t cmp_cnt
Compare register value in timer ticks.
Definition: tmr.h:109
#define MXC_S_TMR_CN_PRES_DIV32
Definition: tmr_regs.h:162
#define MXC_S_TMR_CN_PRES_DIV64
Definition: tmr_regs.h:164
void MXC_TMR_Delay(mxc_tmr_regs_t *tmr, unsigned long us)
Dealay for a set periord of time measured in microseconds.
@ TMR_PRES_128
Divide input clock by 128.
Definition: tmr.h:71
void MXC_TMR_SetCount(mxc_tmr_regs_t *tmr, uint32_t cnt)
Set the timer count.
void MXC_TMR_TO_Stop(mxc_tmr_regs_t *tmr)
Stop the Timeout timer.
@ TMR_UNIT_NANOSEC
Nanosecond Unit Indicator.
Definition: tmr.h:97
@ TMR_PRES_1
Divide input clock by 1.
Definition: tmr.h:64
void MXC_TMR_SW_Start(mxc_tmr_regs_t *tmr)
Start stopwatch.
void MXC_TMR_Start(mxc_tmr_regs_t *tmr)
Start the timer counting.
unsigned int MXC_TMR_TO_Remaining(mxc_tmr_regs_t *tmr)
Amount of time remaining until timeour.
Definition: tmr_regs.h:88
uint32_t MXC_TMR_GetCapture(mxc_tmr_regs_t *tmr)
Get the timer capture count.
void MXC_TMR_TO_Clear(mxc_tmr_regs_t *tmr)
Clear timeout timer back to zero.
@ TMR_MODE_GATED
Timer Mode GATED.
Definition: tmr.h:89
@ TMR_PRES_32
Divide input clock by 32.
Definition: tmr.h:69
#define MXC_S_TMR_CN_PRES_DIV2
Definition: tmr_regs.h:154
void MXC_TMR_DisableInt(mxc_tmr_regs_t *tmr)
disable interupt
@ TMR_PRES_1024
Divide input clock by 1024.
Definition: tmr.h:74
@ TMR_MODE_COMPARE
Timer Mode COMPARE.
Definition: tmr.h:88
int MXC_TMR_SetPWM(mxc_tmr_regs_t *tmr, uint32_t pwm)
Set the value of the first transition in PWM mode.
mxc_tmr_unit_t
Timer units of time enumeration.
Definition: tmr.h:96
int MXC_TMR_GetTime(mxc_tmr_regs_t *tmr, uint32_t ticks, uint32_t *time, mxc_tmr_unit_t *units)
Get time from timer.
#define MXC_V_TMR_CN_TMODE_COMPARE
Definition: tmr_regs.h:142
#define MXC_S_TMR_CN_PRES_DIV1
Definition: tmr_regs.h:152
void MXC_TMR_Stop(mxc_tmr_regs_t *tmr)
Stop the timer.
uint32_t MXC_TMR_GetCount(mxc_tmr_regs_t *tmr)
Get the timer count.