Firmware SDK
twr_flood_detector

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
}
 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...
 

Detailed Description

Driver flood detector.

Function Documentation

◆ twr_flood_detector_init()

void twr_flood_detector_init ( twr_flood_detector_t self,
twr_flood_detector_type_t  type 
)

Initialize flood detector.

Parameters
[in]selfInstance
[in]typesenzor

Definition at line 9 of file twr_flood_detector.c.

Here is the call graph for this function:

◆ twr_flood_detector_is_alarm()

bool twr_flood_detector_is_alarm ( twr_flood_detector_t self)

Is alarm.

Parameters
[in]selfInstance
Returns
true
false

Definition at line 51 of file twr_flood_detector.c.

Here is the call graph for this function:

◆ twr_flood_detector_measure()

bool twr_flood_detector_measure ( twr_flood_detector_t self)

Start measurement manually.

Parameters
[in]selfInstance
Returns
true On success
false When other measurement is in progress

Definition at line 37 of file twr_flood_detector.c.

Referenced by twr_flood_detector_is_alarm().

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

◆ twr_flood_detector_set_event_handler()

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.

Parameters
[in]selfInstance
[in]event_handlerFunction address
[in]event_paramOptional event parameter (can be NULL)

Definition at line 17 of file twr_flood_detector.c.

◆ twr_flood_detector_set_update_interval()

void twr_flood_detector_set_update_interval ( twr_flood_detector_t self,
twr_tick_t  interval 
)

Set measurement interval.

Parameters
[in]selfInstance
[in]intervalMeasurement interval

Definition at line 23 of file twr_flood_detector.c.

Here is the call graph for this function: