Firmware SDK
twr_module_pir.c
1 #include <twr_module_pir.h>
2 
4 {
6 }
7 
8 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)
9 {
10  twr_pyq1648_set_event_handler(self, (void (*)(twr_pyq1648_t*, twr_pyq1648_event_t, void*)) event_handler, event_param);
11 }
12 
14 {
16 }
@ TWR_GPIO_P8
GPIO channel P8.
Definition: twr_gpio.h:39
@ TWR_GPIO_P9
GPIO channel P9.
Definition: twr_gpio.h:42
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.
struct twr_pyq1648_t twr_pyq1648_t
PYQ1648 instance.
Definition: twr_pyq1648.h:44
void twr_pyq1648_set_sensitivity(twr_pyq1648_t *self, twr_pyq1648_sensitivity_t sensitivity)
Set PYQ1648 sensitivity.
Definition: twr_pyq1648.c:68
void twr_pyq1648_init(twr_pyq1648_t *self, twr_gpio_channel_t gpio_channel_serin, twr_gpio_channel_t gpio_channel_dl)
Initialize PYQ1648 driver.
Definition: twr_pyq1648.c:37
twr_pyq1648_sensitivity_t
Possible sensitivities.
Definition: twr_pyq1648.h:27
void twr_pyq1648_set_event_handler(twr_pyq1648_t *self, void(*event_handler)(twr_pyq1648_t *, twr_pyq1648_event_t, void *), void *event_param)
Set callback function.
Definition: twr_pyq1648.c:59
twr_pyq1648_event_t
Callback events.
Definition: twr_pyq1648.h:15