![]() |
semf
|
Base class for sensor hardware like analog sensor. By calling update()
, a measurement cycle gets triggered and the dataAvailable
signal will be emitted after completion. The buffer()
function provides the raw sensor data to the Sensor
class. By using the LastInBuffer
class the access is thread save. Multiple Sensor
respectively SensorConverter
objects can be connected to one HardwareSensor
.
More...
#include <hardwaresensor.h>
Public Member Functions | |
virtual | ~HardwareSensor ()=default |
virtual void | update ()=0 |
virtual LastInBuffer< T_RAW > & | buffer (size_t index)=0 |
Returns the buffer, where the measurement data is stored in. More... | |
Public Attributes | |
Signal< size_t > | dataAvailable |
Base class for sensor hardware like analog sensor. By calling update()
, a measurement cycle gets triggered and the dataAvailable
signal will be emitted after completion. The buffer()
function provides the raw sensor data to the Sensor
class. By using the LastInBuffer
class the access is thread save. Multiple Sensor
respectively SensorConverter
objects can be connected to one HardwareSensor
.
T_RAW | Type of a raw sensor value, e.g. uint16_t for a 16-bit ADC value. |
AnalogSensor
AnalogDmaSensor
Sensor
Definition at line 30 of file hardwaresensor.h.
|
virtualdefault |
|
pure virtual |
Returns the buffer, where the measurement data is stored in.
index | Index of a specific sensor. |
Implemented in semf::AnalogDmaSensor< T, N_CHANNELS >, and semf::AnalogSensor< T, N_CHANNELS >.
|
pure virtual |
Starts a measurement cycle and will emit dataAvailable
afterwards.
Implemented in semf::AnalogDmaSensor< T, N_CHANNELS >, and semf::AnalogSensor< T, N_CHANNELS >.
Signal<size_t> semf::HardwareSensor< T_RAW >::dataAvailable |
Will be emitted after a measurement cycle finished.
Definition at line 45 of file hardwaresensor.h.