Firmware SDK
|
Driver for PYQ1648 PIR sensor. More...
Typedefs | |
typedef struct twr_pyq1648_t | twr_pyq1648_t |
PYQ1648 instance. | |
Enumerations | |
enum | twr_pyq1648_event_t { TWR_PYQ1648_EVENT_ERROR = 0 , TWR_PYQ1648_EVENT_MOTION = 1 } |
Callback events. More... | |
enum | twr_pyq1648_sensitivity_t { TWR_PYQ1648_SENSITIVITY_LOW = 0 , TWR_PYQ1648_SENSITIVITY_MEDIUM = 1 , TWR_PYQ1648_SENSITIVITY_HIGH = 2 , TWR_PYQ1648_SENSITIVITY_VERY_HIGH = 3 } |
Possible sensitivities. More... | |
Functions | |
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. More... | |
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. More... | |
void | twr_pyq1648_set_sensitivity (twr_pyq1648_t *self, twr_pyq1648_sensitivity_t sensitivity) |
Set PYQ1648 sensitivity. More... | |
void | twr_pyq1648_set_blank_period (twr_pyq1648_t *self, twr_tick_t blank_period) |
Set blank period (for how long alarm events will be ignored) More... | |
Driver for PYQ1648 PIR sensor.
enum twr_pyq1648_event_t |
Callback events.
Enumerator | |
---|---|
TWR_PYQ1648_EVENT_ERROR | Error event. |
TWR_PYQ1648_EVENT_MOTION | Update event. |
Definition at line 14 of file twr_pyq1648.h.
Possible sensitivities.
Definition at line 26 of file twr_pyq1648.h.
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.
[in] | self | Instance |
[in] | gpio_channel_serin | GPIO channel for SERIN pin |
[in] | gpio_channel_dl | GPIO channel for DL pin |
Definition at line 37 of file twr_pyq1648.c.
Referenced by twr_module_pir_init().
void twr_pyq1648_set_blank_period | ( | twr_pyq1648_t * | self, |
twr_tick_t | blank_period | ||
) |
Set blank period (for how long alarm events will be ignored)
[in] | self | Instance |
[in] | blank_period | Blank period in milliseconds |
Definition at line 78 of file twr_pyq1648.c.
void twr_pyq1648_set_event_handler | ( | twr_pyq1648_t * | self, |
void(*)(twr_pyq1648_t *, twr_pyq1648_event_t, void *) | event_handler, | ||
void * | event_param | ||
) |
Set callback function.
[in] | self | Instance |
[in] | event_handler | Callback function |
[in] | event_param | Optional event parameter (can be NULL) |
Definition at line 59 of file twr_pyq1648.c.
Referenced by twr_module_pir_set_event_handler().
void twr_pyq1648_set_sensitivity | ( | twr_pyq1648_t * | self, |
twr_pyq1648_sensitivity_t | sensitivity | ||
) |
Set PYQ1648 sensitivity.
[in] | self | Instance |
[in] | sensitivity | Sensitivity |
Definition at line 68 of file twr_pyq1648.c.
Referenced by twr_module_pir_set_sensitivity().