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

Driver for PIR Module. More...

Typedefs

typedef struct bc_pyq1648_t bc_module_pir_t
 BigClown PIR Module instance.
 

Enumerations

enum  bc_module_pir_sensitivity_t {
  BC_MODULE_PIR_SENSITIVITY_LOW = BC_PYQ1648_SENSITIVITY_LOW,
  BC_MODULE_PIR_SENSITIVITY_MEDIUM = BC_PYQ1648_SENSITIVITY_MEDIUM,
  BC_MODULE_PIR_SENSITIVITY_HIGH = BC_PYQ1648_SENSITIVITY_HIGH,
  BC_MODULE_PIR_SENSITIVITY_VERY_HIGH = BC_PYQ1648_SENSITIVITY_VERY_HIGH
}
 Motion detection sensitivity. More...
 
enum  bc_module_pir_event_t {
  BC_MODULE_PIR_EVENT_ERROR = BC_PYQ1648_EVENT_ERROR,
  BC_MODULE_PIR_EVENT_MOTION = BC_PYQ1648_EVENT_MOTION
}
 Callback events. More...
 

Functions

void bc_module_pir_init (bc_module_pir_t *self)
 Initialize PIR Module. More...
 
void bc_module_pir_set_event_handler (bc_module_pir_t *self, void(*event_handler)(bc_module_pir_t *, bc_module_pir_event_t, void *), void *event_param)
 Set callback function. More...
 
void bc_module_pir_set_sensitivity (bc_module_pir_t *self, bc_module_pir_sensitivity_t sensitivity)
 Set sensor sensitivity. More...
 

Detailed Description

Driver for PIR Module.

Enumeration Type Documentation

Callback events.

Enumerator
BC_MODULE_PIR_EVENT_ERROR 

Error event.

BC_MODULE_PIR_EVENT_MOTION 

Motion event.

Definition at line 30 of file bc_module_pir.h.

Motion detection sensitivity.

Enumerator
BC_MODULE_PIR_SENSITIVITY_LOW 

Low sensitivity.

BC_MODULE_PIR_SENSITIVITY_MEDIUM 

Medium sensitivity.

BC_MODULE_PIR_SENSITIVITY_HIGH 

High sensitivity.

BC_MODULE_PIR_SENSITIVITY_VERY_HIGH 

Very high sensitivity.

Definition at line 12 of file bc_module_pir.h.

Function Documentation

void bc_module_pir_init ( bc_module_pir_t self)

Initialize PIR Module.

Parameters
[in]selfInstance

Definition at line 3 of file bc_module_pir.c.

Here is the call graph for this function:

void bc_module_pir_set_event_handler ( bc_module_pir_t self,
void(*)(bc_module_pir_t *, bc_module_pir_event_t, void *)  event_handler,
void *  event_param 
)

Set callback function.

Parameters
[in]selfInstance
[in]event_handlerFunction address
[in]event_paramOptional event parameter (can be NULL)

Definition at line 8 of file bc_module_pir.c.

Here is the call graph for this function:

void bc_module_pir_set_sensitivity ( bc_module_pir_t self,
bc_module_pir_sensitivity_t  sensitivity 
)

Set sensor sensitivity.

Parameters
[in]selfInstance
[in]sensitivityDesired sensitivity

Definition at line 13 of file bc_module_pir.c.

Here is the call graph for this function: