Firmware SDK
twr_pulse_counter.h
1 #ifndef BCL_INC_TWR_PULSE_COUNTER_H_
2 #define BCL_INC_TWR_PULSE_COUNTER_H_
3 
4 #include <twr_gpio.h>
5 #include <twr_scheduler.h>
6 #include <twr_exti.h>
7 #include <twr_module_sensor.h>
8 
12 
14 
15 typedef enum
16 {
19 
22 
25 
27 
29 
30 typedef enum
31 {
34 
37 
39 
43 
45 
50 
52 
56 
58 
62 
63 void twr_pulse_counter_set(twr_module_sensor_channel_t channel, unsigned int count);
64 
68 
70 
73 
75 
77 
78 #endif // BCL_INC_TWR_PULSE_COUNTER_H_
@ TWR_EXTI_EDGE_FALLING
EXTI line is configured to falling edge sensitivity.
Definition: twr_exti.h:201
@ TWR_EXTI_EDGE_RISING_AND_FALLING
EXTI line is configured to both rising and falling edge sensitivity.
Definition: twr_exti.h:204
@ TWR_EXTI_EDGE_RISING
EXTI line is configured to rising edge sensitivity.
Definition: twr_exti.h:198
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.
Definition: twr_tick.h:16