Firmware SDK
|
Driver flood detector. More...
Typedefs | |
typedef struct twr_flood_detector_t | twr_flood_detector_t |
Instance. | |
Enumerations | |
enum | twr_flood_detector_type_t { TWR_FLOOD_DETECTOR_TYPE_LD_81_SENSOR_MODULE_CHANNEL_A , TWR_FLOOD_DETECTOR_TYPE_LD_81_SENSOR_MODULE_CHANNEL_B , TWR_FLOOD_DETECTOR_TYPE_LD_81_SENSOR_MODULE_CHANNEL_C } |
Type sensor. | |
enum | twr_flood_detector_event_t { TWR_FLOOD_DETECTOR_EVENT_ERROR , TWR_FLOOD_DETECTOR_EVENT_UPDATE } |
Callback events. | |
Functions | |
void | twr_flood_detector_init (twr_flood_detector_t *self, twr_flood_detector_type_t type) |
Initialize flood detector. More... | |
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. More... | |
void | twr_flood_detector_set_update_interval (twr_flood_detector_t *self, twr_tick_t interval) |
Set measurement interval. More... | |
bool | twr_flood_detector_measure (twr_flood_detector_t *self) |
Start measurement manually. More... | |
bool | twr_flood_detector_is_alarm (twr_flood_detector_t *self) |
Is alarm. More... | |
Driver flood detector.
void twr_flood_detector_init | ( | twr_flood_detector_t * | self, |
twr_flood_detector_type_t | type | ||
) |
Initialize flood detector.
[in] | self | Instance |
[in] | type | senzor |
Definition at line 9 of file twr_flood_detector.c.
bool twr_flood_detector_is_alarm | ( | twr_flood_detector_t * | self | ) |
Is alarm.
[in] | self | Instance |
Definition at line 51 of file twr_flood_detector.c.
bool twr_flood_detector_measure | ( | twr_flood_detector_t * | self | ) |
Start measurement manually.
[in] | self | Instance |
Definition at line 37 of file twr_flood_detector.c.
void twr_flood_detector_set_event_handler | ( | twr_flood_detector_t * | self, |
void(*)(twr_flood_detector_t *, twr_flood_detector_event_t, void *) | event_handler, | ||
void * | event_param | ||
) |
Set callback function.
[in] | self | Instance |
[in] | event_handler | Function address |
[in] | event_param | Optional event parameter (can be NULL) |
Definition at line 17 of file twr_flood_detector.c.
void twr_flood_detector_set_update_interval | ( | twr_flood_detector_t * | self, |
twr_tick_t | interval | ||
) |
Set measurement interval.
[in] | self | Instance |
[in] | interval | Measurement interval |
Definition at line 23 of file twr_flood_detector.c.