Firmware SDK
twr_module_pir.h
1 #ifndef _TWR_MODULE_PIR_H
2 #define _TWR_MODULE_PIR_H
3 
4 #include <twr_pyq1648.h>
5 
9 
11 
12 typedef enum
13 {
16 
19 
22 
25 
27 
29 
30 typedef enum
31 {
34 
37 
39 
41 
42 typedef struct twr_pyq1648_t twr_module_pir_t;
43 
46 
48 
53 
54 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);
55 
59 
62 
63 #endif // _TWR_MODULE_PIR_H
void twr_module_pir_set_sensitivity(twr_module_pir_t *self, twr_module_pir_sensitivity_t sensitivity)
Set sensor sensitivity.
twr_module_pir_event_t
Callback events.
twr_module_pir_sensitivity_t
Motion detection sensitivity.
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.
Definition: twr_module_pir.c:8
void twr_module_pir_init(twr_module_pir_t *self)
Initialize PIR Module.
Definition: twr_module_pir.c:3
struct twr_pyq1648_t twr_module_pir_t
HARDWARIO PIR Module instance.
@ TWR_MODULE_PIR_EVENT_MOTION
Motion event.
@ TWR_MODULE_PIR_EVENT_ERROR
Error event.
@ TWR_MODULE_PIR_SENSITIVITY_LOW
Low sensitivity.
@ TWR_MODULE_PIR_SENSITIVITY_MEDIUM
Medium sensitivity.
@ TWR_MODULE_PIR_SENSITIVITY_VERY_HIGH
Very high sensitivity.
@ TWR_MODULE_PIR_SENSITIVITY_HIGH
High sensitivity.
struct twr_pyq1648_t twr_pyq1648_t
PYQ1648 instance.
Definition: twr_pyq1648.h:44
@ TWR_PYQ1648_SENSITIVITY_HIGH
High sensitivity.
Definition: twr_pyq1648.h:35
@ TWR_PYQ1648_SENSITIVITY_VERY_HIGH
Very high sensitivity.
Definition: twr_pyq1648.h:38
@ TWR_PYQ1648_SENSITIVITY_LOW
Low sensitivity.
Definition: twr_pyq1648.h:29
@ TWR_PYQ1648_SENSITIVITY_MEDIUM
Medium sensitivity.
Definition: twr_pyq1648.h:32
@ TWR_PYQ1648_EVENT_ERROR
Error event.
Definition: twr_pyq1648.h:17
@ TWR_PYQ1648_EVENT_MOTION
Update event.
Definition: twr_pyq1648.h:20