Skyward boardcore
|
Sensor class for a Trafag pressure sensor. More...
#include <TrafagPressureSensor.h>
Public Member Functions | |
TrafagPressureSensor (std::function< ADCData()> getVoltage, float shuntResistance, float maxPressure, float minCurrent=4, float maxCurrent=20) | |
Construct a TrafagPressureSensor. | |
bool | init () override |
Initialize the sensor. | |
bool | selfTest () override |
Check if the sensor is working. | |
![]() | |
Sensor () | |
Sensor (Sensor &&other) | |
virtual | ~Sensor () |
void | sample () override |
Sample the sensor. | |
virtual PressureData | getLastSample () |
![]() | |
virtual | ~AbstractSensor () |
SensorErrors | getLastError () |
Get last error for debugging purposes. Avoid silent fails. | |
Protected Member Functions | |
PressureData | sampleImpl () override |
Read a data sample from the sensor. In case of errors, the method should return the last available correct sample. | |
Additional Inherited Members | |
![]() | |
using | DataType |
![]() | |
DataType | lastSample |
miosix::FastMutex | mutex |
![]() | |
SensorErrors | lastError = SensorErrors::NO_ERRORS |
Sensor class for a Trafag pressure sensor.
Definition at line 36 of file TrafagPressureSensor.h.
|
inline |
Construct a TrafagPressureSensor.
getVoltage | lambda to retrieve current voltage. |
shuntResistance | shunt resistance value. |
maxPressure | maximum pressure of this sensor. |
minCurrent | current at the 0 pressure point. |
maxCurrent | current at the maximum pressure point. |
Definition at line 48 of file TrafagPressureSensor.h.
|
inlineoverridevirtual |
Initialize the sensor.
Implements Boardcore::AbstractSensor.
Definition at line 57 of file TrafagPressureSensor.h.
|
inlineoverrideprotectedvirtual |
Read a data sample from the sensor. In case of errors, the method should return the last available correct sample.
Implements Boardcore::Sensor< PressureData >.
Definition at line 62 of file TrafagPressureSensor.h.
|
inlineoverridevirtual |
Check if the sensor is working.
Implements Boardcore::AbstractSensor.
Definition at line 59 of file TrafagPressureSensor.h.