1 #ifndef BCL_INC_TWR_PULSE_COUNTER_H_
2 #define BCL_INC_TWR_PULSE_COUNTER_H_
5 #include <twr_scheduler.h>
7 #include <twr_module_sensor.h>
@ TWR_EXTI_EDGE_FALLING
EXTI line is configured to falling edge sensitivity.
@ TWR_EXTI_EDGE_RISING_AND_FALLING
EXTI line is configured to both rising and falling edge sensitivity.
@ TWR_EXTI_EDGE_RISING
EXTI line is configured to rising edge sensitivity.
twr_module_sensor_channel_t
Sensor Module channels.
void twr_pulse_counter_init(twr_module_sensor_channel_t channel, twr_pulse_counter_edge_t edge)
Initialize pulse counter.
void twr_pulse_counter_set_event_handler(twr_module_sensor_channel_t channel, void(*event_handler)(twr_module_sensor_channel_t, twr_pulse_counter_event_t, void *), void *event_param)
Set callback function.
void twr_pulse_counter_reset(twr_module_sensor_channel_t channel)
Set count to zero.
unsigned int twr_pulse_counter_get(twr_module_sensor_channel_t channel)
Get count.
void twr_pulse_counter_set(twr_module_sensor_channel_t channel, unsigned int count)
Set count.
twr_pulse_counter_edge_t
Pulse counter active edges.
void twr_pulse_counter_set_update_interval(twr_module_sensor_channel_t channel, twr_tick_t interval)
Set update interval.
twr_pulse_counter_event_t
Pulse counter event.
@ TWR_PULSE_COUNTER_EDGE_RISE
Rise edge is active.
@ TWR_PULSE_COUNTER_EDGE_FALL
Fall edge is active.
@ TWR_PULSE_COUNTER_EDGE_RISE_FALL
Rise and fall edges are active.
@ TWR_PULSE_COUNTER_EVENT_UPDATE
Update event.
@ TWR_PULSE_COUNTER_EVENT_OVERFLOW
Overflow.
uint64_t twr_tick_t
Timestamp data type.