40 #include "dev/acc-sensor.h"
41 #include "dev/sky-sensors.h"
45 #define INPUT_CHANNEL ((1 << INCH_4) | (1 << INCH_5) | (1 << INCH_6))
46 #define INPUT_REFERENCE SREF_1
47 #define ACC_MEM_X ADC12MEM4
48 #define ACC_MEM_Y ADC12MEM5
49 #define ACC_MEM_Z ADC12MEM6
51 const struct sensors_sensor acc_sensor;
69 configure(
int type,
int c)
71 if(type == SENSORS_ACTIVE) {
80 }
else if(type == ACC_SENSOR_SENSITIVITY) {
86 return sky_sensors_configure(INPUT_CHANNEL, INPUT_REFERENCE, type, c);
92 if(type == ACC_SENSOR_SENSITIVITY) {
93 return (P2OUT & P2DIR) & 0x03;
95 return sky_sensors_status(INPUT_CHANNEL, type);
98 SENSORS_SENSOR(acc_sensor, ACC_SENSOR, value, configure, status);