simple FS  v0.1.0
Public Attributes | List of all members
SensorInterface_t Struct Reference

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>

Collaboration diagram for SensorInterface_t:
Collaboration graph
[legend]

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...
 

Detailed Description

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:

Member Data Documentation

◆ doMeasure

void(* SensorInterface_t::doMeasure) (void)

Start data acquisition process on sensor.

For HW implemented sensors, this function have to be called before getValue() function.

◆ getSensorCount

uint8_t(* SensorInterface_t::getSensorCount) (void)

Return number of internal sub-sensors if they are defined.

Returns
number od sensors for this interface.

◆ getSensorId

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.

Parameters
idinternal index of sensor in this interface. If this interface represents only one sensor, this parameter is omitted.
Returns
pointer to structure, that represents sensor ID.

◆ getType

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.

Parameters
idinternal index of sensor in this interface. If this interface represents only one sensor, this parameter is omitted.
Returns
structure, that represents sensor type specification.

◆ getValue

SensorValue_t*(* SensorInterface_t::getValue) (void)

Read prepared value from sensor.

Before calling this function, the doMeasure() function have to be caled.

Returns
pointer to structure, that is stored raw value from sensor.

◆ Init

void(* SensorInterface_t::Init) (void *hw1, uint16_t hw2)

Initialization of sensor.

Can be used for setting of real HW interface.

Parameters
hw1pointer 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.
hw2Additional information fo specify HW interface, or type specification.

◆ resetSensor

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.


The documentation for this struct was generated from the following file: