40 #define SENSORS_HW_INIT 128
41 #define SENSORS_ACTIVE 129
42 #define SENSORS_READY 130
44 #define SENSORS_ACTIVATE(sensor) (sensor).configure(SENSORS_ACTIVE, 1)
45 #define SENSORS_DEACTIVATE(sensor) (sensor).configure(SENSORS_ACTIVE, 0)
47 #define SENSORS_SENSOR(name, type, value, configure, status) \
48 const struct sensors_sensor name = { type, value, configure, status }
50 #define SENSORS_NUM (sizeof(sensors) / sizeof(struct sensors_sensor *))
52 #define SENSORS(...) \
53 const struct sensors_sensor *sensors[] = {__VA_ARGS__, NULL}; \
54 unsigned char sensors_flags[SENSORS_NUM]
56 struct sensors_sensor {
58 int (* value) (
int type);
59 int (* configure) (
int type,
int value);
60 int (* status) (
int type);
63 struct sensors_sensor *sensors_find(
const char *type);
64 struct sensors_sensor *sensors_next(
const struct sensors_sensor *s);
65 struct sensors_sensor *sensors_first(
void);
67 void sensors_changed(
const struct sensors_sensor *s);
69 extern process_event_t sensors_event;