Contiki 2.5
acc-sensor.c
1 /* Acceleration sensor interface
2  * Author : Georg von Zengen
3  * Created : 2011/10/17
4  */
5 #include "contiki.h"
6 #include "lib/sensors.h"
8 #include "dev/acc-sensor.h"
9 const struct sensors_sensor acc_sensor;
10 uint8_t acc_state=0;
11 /*---------------------------------------------------------------------------*/
12 static int
13 value(int type)
14 {
15  switch(type) {
16  case X_ACC:
18 
19  case Y_ACC:
21 
22  case Z_ACC:
24  }
25  return 0;
26 }
27 /*---------------------------------------------------------------------------*/
28 static int
29 status(int type)
30 {
31  return acc_state;
32 }
33 /*---------------------------------------------------------------------------*/
34 static int
35 configure(int type, int c)
36 {
37  acc_state=1;
38  return adxl345_init();
39 }
40 /*---------------------------------------------------------------------------*/
41 SENSORS_SENSOR(acc_sensor, "ACCELERATION", value, configure, status);