RobotSystem-Lite
Loading...
Searching...
No Matches
sensor.h
Go to the documentation of this file.
1
2// //
3// Copyright (c) 2016-2025 Leonardo Consoni <leonardojc@protonmail.com> //
4// //
5// This file is part of RobotSystem-Lite. //
6// //
7// RobotSystem-Lite is free software: you can redistribute it and/or modify //
8// it under the terms of the GNU Lesser General Public License as published //
9// by the Free Software Foundation, either version 3 of the License, or //
10// (at your option) any later version. //
11// //
12// RobotSystem-Lite is distributed in the hope that it will be useful, //
13// but WITHOUT ANY WARRANTY; without even the implied warranty of //
14// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
15// GNU Lesser General Public License for more details. //
16// //
17// You should have received a copy of the GNU Lesser General Public License //
18// along with RobotSystem-Lite. If not, see <http://www.gnu.org/licenses/>. //
19// //
21
22
27
60
61#ifndef SENSOR_H
62#define SENSOR_H
63
64
65#include <stdbool.h>
66
67
68typedef struct _SensorData SensorData;
70
71
75Sensor Sensor_Init( const char* configName );
76
79void Sensor_End( Sensor sensor );
80
84double Sensor_Update( Sensor sensor );
85
89bool Sensor_HasError( Sensor sensor );
90
93void Sensor_Reset( Sensor sensor );
94
97void Sensor_SetOffset( Sensor sensor );
98
102
106
107
108#endif // SENSOR_H
void Sensor_SetOffset(Sensor sensor)
Sets given sensor to offset acquisition mode.
SensorData * Sensor
Opaque reference to sensor internal data structure.
Definition sensor.h:69
double Sensor_Update(Sensor sensor)
Performs single reading and processing of signal measured by given sensor.
void Sensor_Reset(Sensor sensor)
Resets signal processing state and possible sensor device errors.
void Sensor_SetCalibration(Sensor sensor)
Sets given sensor to range calibration mode.
bool Sensor_HasError(Sensor sensor)
Calls underlying signal reading implementation (plugin) to check for errors on given sensor.
void Sensor_End(Sensor sensor)
Deallocates internal data of given sensor.
Sensor Sensor_Init(const char *configName)
Creates and initializes sensor data structure based on given information.
struct _SensorData SensorData
Single sensor internal data structure.
Definition sensor.h:68
void Sensor_SetMeasurement(Sensor sensor)
Sets given sensor to measurement/operation mode.