![]() |
simple FS
v0.1.0
|
The interface, that defines list of functions, tha have to be implemented for each type of value (or sensor), that will be inserted in file. More...
#include <sensor.h>
Public Attributes | |
void(* | Init )(void *hw1, uint16_t hw2) |
Initialization of sensor. More... | |
void(* | resetSensor )(void) |
Reset sensor settings. More... | |
SensorID_t *(* | getSensorId )(uint8_t id) |
Return sensors ID. More... | |
RecordDescriptor_t(* | getType )() |
Return sensor type specification. More... | |
void(* | doMeasure )(void) |
Start data acquisition process on sensor. More... | |
SensorValue_t *(* | getValue )(void) |
Read prepared value from sensor. More... | |
uint8_t(* | getSensorCount )(void) |
Return number of internal sub-sensors if they are defined. More... | |
The interface, that defines list of functions, tha have to be implemented for each type of value (or sensor), that will be inserted in file.
In general, the source for data acquisition is some HW element, e.g. external sensor. These functions provide interface between higl-level aplication and low-level communication with sensors. Meaning of the functions:
void(* SensorInterface_t::doMeasure) (void) |
Start data acquisition process on sensor.
For HW implemented sensors, this function have to be called before getValue() function.
uint8_t(* SensorInterface_t::getSensorCount) (void) |
Return number of internal sub-sensors if they are defined.
SensorID_t*(* SensorInterface_t::getSensorId) (uint8_t id) |
Return sensors ID.
In some cases, this interface can represents more than 1 sensor. In these cases, the first argument identifies that sensor by internal index.
id | internal index of sensor in this interface. If this interface represents only one sensor, this parameter is omitted. |
RecordDescriptor_t(* SensorInterface_t::getType) () |
Return sensor type specification.
In some cases, this interface can represents more than 1 sensor. In these cases, the first argument identifies that sensor by internal index.
id | internal index of sensor in this interface. If this interface represents only one sensor, this parameter is omitted. |
SensorValue_t*(* SensorInterface_t::getValue) (void) |
Read prepared value from sensor.
Before calling this function, the doMeasure() function have to be caled.
void(* SensorInterface_t::Init) (void *hw1, uint16_t hw2) |
Initialization of sensor.
Can be used for setting of real HW interface.
hw1 | pointer to HW structure, that manipulate with sensors. It can represents I2C, SPI or UART interface. For sensors, that dont have that interface (primitive data types) us NULL. |
hw2 | Additional information fo specify HW interface, or type specification. |
void(* SensorInterface_t::resetSensor) (void) |
Reset sensor settings.
It is used in some sensors only. E.g. in one-wire termometers (module_ow_bus.h), where this interface can represent more than 1 sensor.