93 loop_mode, clk_src, output_mode, output_level);
189 div = (div <= 1) ? 1 : (div & ~0x1);
#define SYSCTL_SYS_CFG_1_TIMERSE0
#define SYSCTL_SYS_CFG_1_TIMERSE1
#define SYSCTL_SYS_CFG_0
Clock dividers for TIMERSE and SCLK.
#define SYSCTL_SYS_CFG_1
TIMERSE0, TIMERSE1, and WDT enable.
uint32_t timer_get_cycle_width(uint32_t timer)
Gets the cycle width.
bool timer_int_overflow_status(uint32_t timer)
Gets the interrupt overflow status.
void timer_pwm_target_value(uint32_t timer, uint16_t period0, uint16_t period1)
Sets the target values for PWM mode.
void timer_output_level(uint32_t timer, enum timer_level level)
Selects the initial output level.
void timer_int_mask(uint32_t timer, enum timer_int_masked masked)
Sets the interrupt mask.
static void timer_setup_internal(uint32_t timer, bool timer_int_en, enum timer_operation_modes op_mode, enum timer_edge_modes edge_mode, enum timer_loop_modes loop_mode, enum timer_clk_src clk_src, enum timer_output_modes output_mode, enum timer_level output_level)
Internal function for timer setup.
void timer_operation_mode(uint32_t timer, enum timer_operation_modes mode)
Selects the mode of operation.
bool timer_int_status(uint32_t timer)
Gets the interrupt status after masking.
void timer_clock_div(uint8_t div)
Set the timer clock divider, based off of the 18MHz oscillator.
enum timer_pwm_period timer_get_pwm_period(uint32_t timer)
Gets the current output period in PWM mode.
void timer_edge_mode(uint32_t timer, enum timer_edge_modes mode)
Selects the edge mode.
void timer_counter_setup(uint32_t timer, bool timer_int_en, enum timer_edge_modes edge_mode, enum timer_loop_modes loop_mode, enum timer_clk_src clk_src, enum timer_output_modes output_mode, enum timer_level output_level, uint32_t target)
Setup the timer in counter mode.
void timer_clock_enable(uint32_t timer, bool en)
Enables or disables the timer's internal clock.
void timer_counter_target_value(uint32_t timer, uint32_t target)
Sets the target values for counter mode.
uint32_t timer_get_current_value(uint32_t timer)
Gets the current counter value, and clears the interrupt/interrupt overflow.
void timer_clock_source(uint32_t timer, enum timer_clk_src src)
Selects the clock source for the timer.
void timer_output_mode(uint32_t timer, enum timer_output_modes mode)
Selects the output mode.
void timer_duty_cycle_capture_setup(uint32_t timer, bool timer_int_en, enum timer_edge_modes edge_mode, enum timer_loop_modes loop_mode)
Setup the timer in duty cycle capture mode.
void timer_enable(uint32_t timer, bool en)
Enables or disables the timer.
void timer_loop_mode(uint32_t timer, enum timer_loop_modes mode)
Selects the loop mode.
void timer_pulse_capture_setup(uint32_t timer, bool timer_int_en, enum timer_edge_modes edge_mode, enum timer_loop_modes loop_mode)
Setup the timer in pulse capture mode.
uint32_t timer_get_pulse_width(uint32_t timer)
Gets the pulse width in pulse capture mode, or gets the period width in duty cycle capture mode.
bool timer_int_raw_status(uint32_t timer)
Gets the interrupt status before masking.
void timer_pwm_setup(uint32_t timer, bool timer_int_en, enum timer_edge_modes edge_mode, enum timer_clk_src clk_src, enum timer_level output_level, uint16_t period0, uint16_t period1)
Setup the timer in PWM mode.
void timer_int_enable(uint32_t timer, bool en)
Enable or disable the interrupt.
#define TIMER_INTCTL_INTEN
Interrupt enable.
#define TIMER_CTRL_OUTMOD_SHIFT
#define TIMER_CTRL_LMOD
Loop mode selection.
#define TIMER_CTRL_TMOD
Valid edge selection.
#define TIMER_CTRL_OSCMOD
Clock source selection.
#define TIMER_CTRL_WMOD_MASK
Timer Operation Mode Mask.
#define TIMER_CTRL_OUTMOD_MASK
Timer Output Mode Mask.
#define TIMER_CTRL_WMOD_SHIFT
#define TIMER_INTCTL_INTMSK
Interrupt mask.
#define TIMER_OUTPVAL(x)
Timer output pin value.
#define TIMER_CAPLH(x)
Pulse width in modes 2 and 3.
#define TIMER_INTMSKSTAT(x)
Interrupt status after masking.
#define TIMER_INTSTAT(x)
Interrupt status before masking.
#define TIMER_INTFLAG(x)
Interrupt overflow; 1 if interrupt occurs again without being cleared.
#define TIMER_CURVAL(x)
Current count value in modes 0, 2, and 3.
#define TIMER_CAPW(x)
Cycle width in mode 3.
#define TIMER_MOD2LF(x)
PWM state in mode 1.
#define TIMER_CTRL(x)
Timer control register.
#define TIMER_TARVAL(x)
The target value(s).
#define TIMER_INTCTL(x)
Interrupt enable and mask.
timer_output_modes
Timer Output Modes.
timer_pwm_period
Timer PWM Periods.
timer_loop_modes
Timer Loop Modes.
timer_edge_modes
Timer Edge Modes.
timer_clk_src
Timer Clock Source.
timer_int_masked
Timer Interrupt Mask.
timer_operation_modes
Timer Operation Modes.
@ TIMER_MODE_DUTY_CYCLE_CAPTURE
@ TIMER_MODE_PULSE_CAPTURE