Firmware SDK
twr_pyq1648

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

Detailed Description

Driver for PYQ1648 PIR sensor.

Enumeration Type Documentation

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

◆ twr_pyq1648_sensitivity_t

Possible sensitivities.

Enumerator
TWR_PYQ1648_SENSITIVITY_LOW 

Low sensitivity.

TWR_PYQ1648_SENSITIVITY_MEDIUM 

Medium sensitivity.

TWR_PYQ1648_SENSITIVITY_HIGH 

High sensitivity.

TWR_PYQ1648_SENSITIVITY_VERY_HIGH 

Very high sensitivity.

Definition at line 26 of file twr_pyq1648.h.

Function Documentation

◆ twr_pyq1648_init()

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.

Parameters
[in]selfInstance
[in]gpio_channel_serinGPIO channel for SERIN pin
[in]gpio_channel_dlGPIO channel for DL pin

Definition at line 37 of file twr_pyq1648.c.

Referenced by twr_module_pir_init().

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

◆ twr_pyq1648_set_blank_period()

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)

Parameters
[in]selfInstance
[in]blank_periodBlank period in milliseconds

Definition at line 78 of file twr_pyq1648.c.

◆ twr_pyq1648_set_event_handler()

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.

Parameters
[in]selfInstance
[in]event_handlerCallback function
[in]event_paramOptional event parameter (can be NULL)

Definition at line 59 of file twr_pyq1648.c.

Referenced by twr_module_pir_set_event_handler().

Here is the caller graph for this function:

◆ twr_pyq1648_set_sensitivity()

void twr_pyq1648_set_sensitivity ( twr_pyq1648_t self,
twr_pyq1648_sensitivity_t  sensitivity 
)

Set PYQ1648 sensitivity.

Parameters
[in]selfInstance
[in]sensitivitySensitivity

Definition at line 68 of file twr_pyq1648.c.

Referenced by twr_module_pir_set_sensitivity().

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