35 #include "lib/sensors.h"
36 #include "dev/sky-sensors.h"
37 #include "dev/light-sensor.h"
38 #include "dev/potentiometer-sensor.h"
44 #define INPUT_CHANNEL (1 << INCH_4)
47 #ifndef INPUT_REFERENCE
48 #define INPUT_REFERENCE SREF_0
51 #ifdef POTENTIOMETER_MEM
52 #define PHOTOSYNTHETIC_MEM POTENTIOMETER_MEM
53 #define TOTAL_SOLAR_MEM POTENTIOMETER_MEM
55 #define PHOTOSYNTHETIC_MEM ADC12MEM4
56 #define TOTAL_SOLAR_MEM ADC12MEM4
60 const struct sensors_sensor light_sensor;
68 case LIGHT_SENSOR_PHOTOSYNTHETIC:
69 return PHOTOSYNTHETIC_MEM;
72 case LIGHT_SENSOR_TOTAL_SOLAR:
73 return TOTAL_SOLAR_MEM;
81 return sky_sensors_status(INPUT_CHANNEL, type);
85 configure(
int type,
int c)
87 return sky_sensors_configure(INPUT_CHANNEL, INPUT_REFERENCE, type, c);
90 SENSORS_SENSOR(light_sensor,
"Light", value, configure, status);