Contiki 3.x
button-sensor.c
1 /* Dummy sensor routine */
2 
3 #include "lib/sensors.h"
4 #include "dev/button-sensor.h"
5 const struct sensors_sensor button_sensor;
6 static int status(int type);
7 struct sensors_sensor *sensors[1];
8 unsigned char sensors_flags[1];
9 
10 static int
11 value(int type)
12 {
13  return 0;
14 }
15 static int
16 configure(int type, int c)
17 {
18  switch(type) {
19  case SENSORS_ACTIVE:
20  if(c) {
21  if(!status(SENSORS_ACTIVE)) {
22  }
23  } else {
24  }
25  return 1;
26  }
27  return 0;
28 }
29 static int
30 status(int type)
31 {
32  switch(type) {
33  case SENSORS_ACTIVE:
34  case SENSORS_READY:
35  return 1;
36  }
37  return 0;
38 }
39 SENSORS_SENSOR(button_sensor, BUTTON_SENSOR,
40  value, configure, status);
41 
const struct sensors_sensor button_sensor
Copyright (c) 2014, Analog Devices, Inc.
Definition: button-sensor.c:44
static int value(int type, nrf_drv_gpiote_pin_t pin)
Return current state of a button.