simple FS  v0.1.0
sensor.h
Go to the documentation of this file.
1 
9 #ifndef INC_SENSOR_H_
10 #define INC_SENSOR_H_
11 
12 #include "file_format.h"
13 #include <string.h>
14 
26 #define SENSOR_ID_LENGTH 8
27 
28 
32 typedef struct {
34  uint8_t id[SENSOR_ID_LENGTH];
36  uint8_t size;
37 }SensorID_t;
38 
42 typedef struct {
45  uint8_t *value;
49  uint8_t data_length;
51 
52 
66 typedef struct{
73  void (*Init)(void* hw1, uint16_t hw2);
78  void (*resetSensor)(void);
86  SensorID_t* (*getSensorId)(uint8_t id);
94  RecordDescriptor_t (*getType)();
99  void (*doMeasure)(void);
104  SensorValue_t* (*getValue)(void);
109  uint8_t (*getSensorCount)(void);
111 
118 
127 #endif /* INC_SENSOR_H_ */
SENSOR_ID_LENGTH
#define SENSOR_ID_LENGTH
Length of sensor ID in bytes.
Definition: sensor.h:26
SensorValue_t::value
uint8_t * value
Array, where is stored raw value as array of bytes.
Definition: sensor.h:45
SensorValue_t::type
SensorType_t type
define type of column SensorType_t
Definition: sensor.h:47
RecordDescriptor_t
Describes internal structure of file.
Definition: file_format.h:228
SensorValue_t::data_length
uint8_t data_length
effective length of value (in bytes)
Definition: sensor.h:49
SensorInterface_t
The interface, that defines list of functions, tha have to be implemented for each type of value (or ...
Definition: sensor.h:66
SensorID_t::size
uint8_t size
Effective length of column ID.
Definition: sensor.h:36
SensorValue_t
Sensor value is stored as array of bytes.
Definition: sensor.h:42
ValueFormatMetaLength_t
enum value_format ValueFormatMetaLength_t
Definition data value lengths.
SensorType_t
enum sensor_type SensorType_t
Definition of base types os supported sensors.
SensorID_t
Description of one column (or 1 sensor) in file.
Definition: sensor.h:32
file_format.h
Declarations of FS structures and data types.
get_sensor_data_length
uint8_t get_sensor_data_length(ValueFormatMetaLength_t length_code)
Compute real data length (in bytes) from code length.
Definition: sensor.c:20