Firmware SDK
twr_module_pir

Driver for PIR Module. More...

Typedefs

typedef struct twr_pyq1648_t twr_module_pir_t
 HARDWARIO PIR Module instance.
 

Enumerations

enum  twr_module_pir_sensitivity_t {
  TWR_MODULE_PIR_SENSITIVITY_LOW = TWR_PYQ1648_SENSITIVITY_LOW ,
  TWR_MODULE_PIR_SENSITIVITY_MEDIUM = TWR_PYQ1648_SENSITIVITY_MEDIUM ,
  TWR_MODULE_PIR_SENSITIVITY_HIGH = TWR_PYQ1648_SENSITIVITY_HIGH ,
  TWR_MODULE_PIR_SENSITIVITY_VERY_HIGH = TWR_PYQ1648_SENSITIVITY_VERY_HIGH
}
 Motion detection sensitivity. More...
 
enum  twr_module_pir_event_t {
  TWR_MODULE_PIR_EVENT_ERROR = TWR_PYQ1648_EVENT_ERROR ,
  TWR_MODULE_PIR_EVENT_MOTION = TWR_PYQ1648_EVENT_MOTION
}
 Callback events. More...
 

Functions

void twr_module_pir_init (twr_module_pir_t *self)
 Initialize PIR Module. More...
 
void twr_module_pir_set_event_handler (twr_module_pir_t *self, void(*event_handler)(twr_module_pir_t *, twr_module_pir_event_t, void *), void *event_param)
 Set callback function. More...
 
void twr_module_pir_set_sensitivity (twr_module_pir_t *self, twr_module_pir_sensitivity_t sensitivity)
 Set sensor sensitivity. More...
 

Detailed Description

Driver for PIR Module.

Enumeration Type Documentation

◆ twr_module_pir_event_t

Callback events.

Enumerator
TWR_MODULE_PIR_EVENT_ERROR 

Error event.

TWR_MODULE_PIR_EVENT_MOTION 

Motion event.

Definition at line 30 of file twr_module_pir.h.

◆ twr_module_pir_sensitivity_t

Motion detection sensitivity.

Enumerator
TWR_MODULE_PIR_SENSITIVITY_LOW 

Low sensitivity.

TWR_MODULE_PIR_SENSITIVITY_MEDIUM 

Medium sensitivity.

TWR_MODULE_PIR_SENSITIVITY_HIGH 

High sensitivity.

TWR_MODULE_PIR_SENSITIVITY_VERY_HIGH 

Very high sensitivity.

Definition at line 12 of file twr_module_pir.h.

Function Documentation

◆ twr_module_pir_init()

void twr_module_pir_init ( twr_module_pir_t self)

Initialize PIR Module.

Parameters
[in]selfInstance

Definition at line 3 of file twr_module_pir.c.

Here is the call graph for this function:

◆ twr_module_pir_set_event_handler()

void twr_module_pir_set_event_handler ( twr_module_pir_t self,
void(*)(twr_module_pir_t *, twr_module_pir_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 8 of file twr_module_pir.c.

Here is the call graph for this function:

◆ twr_module_pir_set_sensitivity()

void twr_module_pir_set_sensitivity ( twr_module_pir_t self,
twr_module_pir_sensitivity_t  sensitivity 
)

Set sensor sensitivity.

Parameters
[in]selfInstance
[in]sensitivityDesired sensitivity

Definition at line 13 of file twr_module_pir.c.

Here is the call graph for this function: