Firmware SDK
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
bc_pyq1648

Driver for PYQ1648 PIR sensor. More...

Typedefs

typedef struct bc_pyq1648_t bc_pyq1648_t
 PYQ1648 instance.
 

Enumerations

enum  bc_pyq1648_event_t {
  BC_PYQ1648_EVENT_ERROR = 0,
  BC_PYQ1648_EVENT_MOTION = 1
}
 Callback events. More...
 
enum  bc_pyq1648_sensitivity_t {
  BC_PYQ1648_SENSITIVITY_LOW = 0,
  BC_PYQ1648_SENSITIVITY_MEDIUM = 1,
  BC_PYQ1648_SENSITIVITY_HIGH = 2,
  BC_PYQ1648_SENSITIVITY_VERY_HIGH = 3
}
 Possible sensitivities. More...
 

Functions

void bc_pyq1648_init (bc_pyq1648_t *self, bc_gpio_channel_t gpio_channel_serin, bc_gpio_channel_t gpio_channel_dl)
 Initialize PYQ1648 driver. More...
 
void bc_pyq1648_set_event_handler (bc_pyq1648_t *self, void(*event_handler)(bc_pyq1648_t *, bc_pyq1648_event_t, void *), void *event_param)
 Set callback function. More...
 
void bc_pyq1648_set_sensitivity (bc_pyq1648_t *self, bc_pyq1648_sensitivity_t sensitivity)
 Set PYQ1648 sensitivity. More...
 
void bc_pyq1648_set_blank_period (bc_pyq1648_t *self, bc_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

Callback events.

Enumerator
BC_PYQ1648_EVENT_ERROR 

Error event.

BC_PYQ1648_EVENT_MOTION 

Update event.

Definition at line 14 of file bc_pyq1648.h.

Possible sensitivities.

Enumerator
BC_PYQ1648_SENSITIVITY_LOW 

Low sensitivity.

BC_PYQ1648_SENSITIVITY_MEDIUM 

Medium sensitivity.

BC_PYQ1648_SENSITIVITY_HIGH 

High sensitivity.

BC_PYQ1648_SENSITIVITY_VERY_HIGH 

Very high sensitivity.

Definition at line 26 of file bc_pyq1648.h.

Function Documentation

void bc_pyq1648_init ( bc_pyq1648_t self,
bc_gpio_channel_t  gpio_channel_serin,
bc_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 bc_pyq1648.c.

Referenced by bc_module_pir_init().

Here is the call graph for this function:

Here is the caller graph for this function:

void bc_pyq1648_set_blank_period ( bc_pyq1648_t self,
bc_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 bc_pyq1648.c.

void bc_pyq1648_set_event_handler ( bc_pyq1648_t self,
void(*)(bc_pyq1648_t *, bc_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 bc_pyq1648.c.

Referenced by bc_module_pir_set_event_handler().

Here is the caller graph for this function:

void bc_pyq1648_set_sensitivity ( bc_pyq1648_t self,
bc_pyq1648_sensitivity_t  sensitivity 
)

Set PYQ1648 sensitivity.

Parameters
[in]selfInstance
[in]sensitivitySensitivity

Definition at line 68 of file bc_pyq1648.c.

Referenced by bc_module_pir_set_sensitivity().

Here is the call graph for this function:

Here is the caller graph for this function: