Device driver interface for the PIR motion sensor. More...

Detailed Description

Device driver interface for the PIR motion sensor.

Author
Ludwig Knüpfer ludwi.nosp@m.g.kn.nosp@m.uepfe.nosp@m.r@fu.nosp@m.-berl.nosp@m.in.d.nosp@m.e
Hyung-Sin Kim hs.ki.nosp@m.m@cs.nosp@m..berk.nosp@m.eley.nosp@m..edu

Definition in file pir.h.

#include "kernel_types.h"
#include "periph/gpio.h"
#include "stdbool.h"
+ Include dependency graph for pir.h:

Go to the source code of this file.

Data Structures

struct  pir_params_t
 Parameters needed for device initialization. More...
 
struct  pir_t
 device descriptor for a PIR sensor More...
 

Macros

#define PIR_MSG_T_STATUS_START   150
 value to configure sensitivity of sensore
 

Enumerations

enum  { PIR_OK = 0, PIR_NOGPIO = -1, PIR_NOTHREAD = -2, PIR_TIMEERR = -3 }
 PIR specific return values. More...
 
enum  pir_event_t { PIR_STATUS_ACTIVE = PIR_MSG_T_STATUS_START, PIR_STATUS_INACTIVE }
 event type for a PIR sensor More...
 

Functions

int pir_init (pir_t *dev, const pir_params_t *params)
 Initialize a PIR motion sensor. More...
 
pir_event_t pir_get_status (const pir_t *dev)
 Read the current status of the motion sensor. More...
 
int pir_get_occupancy (pir_t *dev, int16_t *occup)
 Read OCCUPANCY value. More...
 
int pir_register_thread (pir_t *dev)
 Register a thread for notification whan state changes on the motion sensor. More...