1 #ifndef _TWR_FLOOD_DETECTOR_H
2 #define _TWR_FLOOD_DETECTOR_H
5 #include <twr_module_sensor.h>
6 #include <twr_scheduler.h>
17 TWR_FLOOD_DETECTOR_TYPE_LD_81_SENSOR_MODULE_CHANNEL_A,
18 TWR_FLOOD_DETECTOR_TYPE_LD_81_SENSOR_MODULE_CHANNEL_B,
19 TWR_FLOOD_DETECTOR_TYPE_LD_81_SENSOR_MODULE_CHANNEL_C
27 TWR_FLOOD_DETECTOR_EVENT_ERROR,
28 TWR_FLOOD_DETECTOR_EVENT_UPDATE,
40 TWR_FLOOD_DETECTOR_STATE_ERROR = -1,
41 TWR_FLOOD_DETECTOR_STATE_INITIALIZE = 0,
42 TWR_FLOOD_DETECTOR_STATE_READY = 1,
43 TWR_FLOOD_DETECTOR_STATE_MEASURE = 2,
45 } twr_flood_detector_state_t;
53 twr_flood_detector_state_t _state;
56 bool _measurement_active;
struct twr_flood_detector_t twr_flood_detector_t
Instance.
void twr_flood_detector_init(twr_flood_detector_t *self, twr_flood_detector_type_t type)
Initialize flood detector.
bool twr_flood_detector_is_alarm(twr_flood_detector_t *self)
Is alarm.
bool twr_flood_detector_measure(twr_flood_detector_t *self)
Start measurement manually.
twr_flood_detector_type_t
Type sensor.
twr_flood_detector_event_t
Callback events.
void twr_flood_detector_set_update_interval(twr_flood_detector_t *self, twr_tick_t interval)
Set measurement interval.
void twr_flood_detector_set_event_handler(twr_flood_detector_t *self, void(*event_handler)(twr_flood_detector_t *, twr_flood_detector_event_t, void *), void *event_param)
Set callback function.
size_t twr_scheduler_task_id_t
Task ID assigned by scheduler.
uint64_t twr_tick_t
Timestamp data type.