Firmware SDK
twr_timer

Driver for timer. More...

Functions

void twr_timer_init (void)
 Initialize timer.
 
void twr_timer_start (void)
 Start timer.
 
uint16_t twr_timer_get_microseconds (void)
 Get actual tick of timer. More...
 
void twr_timer_delay (uint16_t microseconds)
 Relative delay. More...
 
void twr_timer_clear (void)
 Clear timer counter.
 
void twr_timer_stop (void)
 Stop timer.
 
bool twr_timer_set_irq_handler (TIM_TypeDef *tim, void(*irq_handler)(void *), void *irq_param)
 Register timer IRQ handler. More...
 
void twr_timer_clear_irq_handler (TIM_TypeDef *tim)
 Unregister timer IRQ handler. More...
 

Variables

const uint16_t _twr_timer_prescaler_lut [3]
 

Detailed Description

Driver for timer.

Function Documentation

◆ twr_timer_clear_irq_handler()

void twr_timer_clear_irq_handler ( TIM_TypeDef *  tim)

Unregister timer IRQ handler.

Parameters
[in]timTimer, e.g. TIM3

Definition at line 74 of file twr_timer.c.

◆ twr_timer_delay()

void twr_timer_delay ( uint16_t  microseconds)
inline

Relative delay.

Parameters
[in]ticktick to delay in us

Definition at line 59 of file twr_timer.c.

Referenced by twr_delay_us(), twr_module_battery_is_present(), twr_module_encoder_is_present(), twr_spi_async_transfer(), twr_spi_transfer(), twr_spirit1_sleep(), twr_switch_set_pull_advance_time(), twr_tag_nfc_init(), twr_zssc3123_eeprom_read(), and twr_zssc3123_eeprom_write().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ twr_timer_get_microseconds()

uint16_t twr_timer_get_microseconds ( void  )
inline

Get actual tick of timer.

Returns
Actual state of timer counter (microseconds from start)

Definition at line 54 of file twr_timer.c.

Referenced by twr_pyq1648_set_blank_period(), twr_spirit1_sleep(), and twr_timer_delay().

Here is the caller graph for this function:

◆ twr_timer_set_irq_handler()

bool twr_timer_set_irq_handler ( TIM_TypeDef *  tim,
void(*)(void *)  irq_handler,
void *  irq_param 
)

Register timer IRQ handler.

Parameters
[in]timTimer, e.g. TIM3
[in]irq_handlerpointer to IRQ handler function
[in]irq_paramparameter

Definition at line 86 of file twr_timer.c.

Referenced by twr_rf_ook_send().

Here is the caller graph for this function: