SingingCat 0
application
|
code to call all the sensors in the right frequency, with the correct configuration modify this file if you have new sensors! More...
#include <sensors/sensor.h>
#include <platform-header.h>
Go to the source code of this file.
Data Structures | |
struct | sensorconfig |
definition of variable stuff for any one sensor this is seperate from runtime, because a copy will live in flash (cnw: err, no, not with a volatile pointer (*sensor)!!) More... | |
Macros | |
#define | isNewStyleEnabled (sensors_enabled & (1 << 1)) |
#define | isOldStyleEnabled (sensors_enabled & (1 << 0)) |
#define | isProbing (sensors_enabled & (1 << 2)) |
#define | SENSOR_FLAG_ACTIVATED 4 |
#define | SENSOR_FLAG_DETECTED 2 |
#define | SENSOR_FLAG_ENABLED 0 |
#define | SENSOR_FLAG_ISDUE 1 |
#define | SENSOR_FLAG_PROBED 3 |
#define | SENSOR_TIMER 4 |
timer to use More... | |
#define | SENSOR_TIMER_FREQUENCY 1000 |
frequency our timer runs on More... | |
Typedefs | |
typedef struct sensorconfig | _sensorconfig |
definition of variable stuff for any one sensor this is seperate from runtime, because a copy will live in flash (cnw: err, no, not with a volatile pointer (*sensor)!!) | |
Functions | |
int | all_sensors_probed () |
struct sensorruntime * | get_runtime (int idx) |
void | sensor_activation (struct sensorruntime *sr, int activation) |
void | sensor_deregister (struct sensordev *sensor) |
void | sensor_info () |
int | sensor_loop () |
called periodically. this will either query sensors when they are due or will set the isdue flag for them to be picked up during IRQ returns true if new sensor data needs to be sent More... | |
void | sensor_probe () |
struct sensordev * | sensor_register (struct sensordev *sensor) |
register a sensor, e.g. from userhook. The sensordev struct is COPIED, so it may be reused by the caller. the RETURN value is a pointer to the new sensordev, or NULL More... | |
void | sensor_run_str (const char *str) |
int | sensor_submit_request (const long nodeid, int idx, const int readmillis, const int submitsec, const int max_values) |
int | sensor_update_config (const long nodeid, int idx, const int readmillis, const int submitsec, const int max_values) |
void | sensors_init () |
initialize sensors, runtime, config, powerup each sensor in turn etc.. More... | |
uint8_t | sensors_inited () |
void | sensors_newstyle () |
enable new-style sensors (and disable old) More... | |
void | sensors_off () |
disable sensors More... | |
int | update_all_runtimes () |
update runtimes (recalculate buffer positions). return 0 if ok (5 otherwise) More... | |
Variables | |
struct sensordev | sensors [] |
list of sensors... More... | |
code to call all the sensors in the right frequency, with the correct configuration modify this file if you have new sensors!
TODO: adjust timer frequency to be called less frequently (in the frequency of the most frequently called sensor, but not more) IDEA: submit result of some (simple) formula, e.g. MAX() or MIN() or AVG() or so instead of raw values IDEA: add triggers (e.g. voltage below 190V, or, in case of a binary sensor (such as a button), high detected)
Definition in file sensor.c.