![]() |
MAX32665 SDK Documentation
0.2
Software Development Kit Overview and API Documentation
|
Modules | |
TMR_Registers | |
Registers, Bit Masks and Bit Positions for the TMR Peripheral Module. | |
Timer Utility Functions | |
Data Structures | |
struct | tmr_cfg_t |
Timer Configuration. More... | |
struct | tmr_pwm_cfg_t |
Timer PWM Configuration. More... | |
Enumerations | |
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... | |
Functions | |
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... | |
enum tmr_pres_t |
enum tmr_mode_t |
enum tmr_unit_t |
void TMR_Init | ( | mxc_tmr_regs_t * | tmr, |
tmr_pres_t | pres, | ||
const sys_cfg_tmr_t * | sys_cfg | ||
) |
tmr | Pointer to timer module to initialize. |
pres | Prescaler value. |
sys_cfg | System configuration object |
void TMR_Shutdown | ( | mxc_tmr_regs_t * | tmr | ) |
tmr | Pointer to timer module to initialize. |
void TMR_Enable | ( | mxc_tmr_regs_t * | tmr | ) |
tmr | Pointer to timer module to initialize. |
void TMR_Disable | ( | mxc_tmr_regs_t * | tmr | ) |
tmr | Pointer to timer module to initialize. |
void TMR_Config | ( | mxc_tmr_regs_t * | tmr, |
const tmr_cfg_t * | cfg | ||
) |
tmr | Pointer to timer module to initialize. |
cfg | Pointer to timer configuration struct. |
int TMR_PWMConfig | ( | mxc_tmr_regs_t * | tmr, |
const tmr_pwm_cfg_t * | cfg | ||
) |
tmr | Pointer to timer module to initialize. |
cfg | Pointer to timer PWM configuration struct. |
int TMR_PWMSetDuty | ( | mxc_tmr_regs_t * | tmr, |
uint32_t | duty | ||
) |
tmr | Pointer to timer module to initialize |
duty | New duty cycle count |
int TMR_PWMSetPeriod | ( | mxc_tmr_regs_t * | tmr, |
uint32_t | per | ||
) |
tmr | Pointer to timer module to initialize. |
per | New period count. |
uint32_t TMR_GetCompare | ( | mxc_tmr_regs_t * | tmr | ) |
tmr | Pointer to timer module to initialize. |
uint32_t TMR_GetCapture | ( | mxc_tmr_regs_t * | tmr | ) |
tmr | Pointer to timer module to initialize. |
uint32_t TMR_GetCount | ( | mxc_tmr_regs_t * | tmr | ) |
tmr | Pointer to timer module to initialize. |
void TMR_IntClear | ( | mxc_tmr_regs_t * | tmr | ) |
tmr | Pointer to timer module to initialize. |
uint32_t TMR_IntStatus | ( | mxc_tmr_regs_t * | tmr | ) |
tmr | Pointer to timer module to initialize. |
void TMR_SetCompare | ( | mxc_tmr_regs_t * | tmr, |
uint32_t | cmp_cnt | ||
) |
tmr | Pointer to timer module to initialize. |
cmp_cnt | New compare count. |
void TMR_SetCount | ( | mxc_tmr_regs_t * | tmr, |
uint32_t | cnt | ||
) |
tmr | Pointer to timer module to initialize. |
cnt | New count. |
int TMR_GetTicks | ( | mxc_tmr_regs_t * | tmr, |
uint32_t | time, | ||
tmr_unit_t | units, | ||
uint32_t * | ticks | ||
) |
tmr | Pointer to timer module to initialize. |
time | Number of units of time. |
units | Which units of time you want to convert. |
ticks | Pointer to store the number of ticks calculated. |
int TMR_GetTime | ( | mxc_tmr_regs_t * | tmr, |
uint32_t | ticks, | ||
uint32_t * | time, | ||
tmr_unit_t * | units | ||
) |
tmr | Pointer to timer module to initialize. |
ticks | Number of ticks. |
time | Pointer to store number of units of time. |
units | Pointer to store the units that time represents. |