Skyward boardcore
|
Common class for all analog pressure sensors. More...
#include <AnalogPressureSensor.h>
Public Member Functions | |
AnalogPressureSensor (std::function< ADCData()> getVoltage, const float supplyVoltage=5.0, const float maxPressure=0, const float minPressure=0) | |
AnalogPressureSensor (AnalogPressureSensor &&other) | |
bool | init () override |
Initialize the sensor. | |
bool | selfTest () override |
Check if the sensor is working. | |
void | setOffset (float value) |
Set the current analog pressure sensor offset. Ignores any previous offsets. | |
void | updateOffset (float value) |
Update the current analog pressure sensor offset. Adds the new value to the old offset. | |
float | getOffset () |
Retrieve the current offset. | |
![]() | |
Sensor () | |
Sensor (Sensor &&other) | |
virtual | ~Sensor () |
void | sample () override |
Sample the sensor. | |
virtual AnalogPressureData | getLastSample () |
![]() | |
virtual | ~AbstractSensor () |
SensorErrors | getLastError () |
Get last error for debugging purposes. Avoid silent fails. | |
Protected Member Functions | |
AnalogPressureData | sampleImpl () override |
Conversion function from volts to pascals. | |
virtual float | voltageToPressure (float voltage)=0 |
Function that returns the sensor voltage. | |
Protected Attributes | |
std::function< ADCData()> | getVoltage |
miosix::FastMutex | offsetMutex |
float | offset = 0 |
const float | supplyVoltage |
const float | maxPressure |
const float | minPressure |
![]() | |
DataType | lastSample |
miosix::FastMutex | mutex |
![]() | |
SensorErrors | lastError = SensorErrors::NO_ERRORS |
Additional Inherited Members | |
![]() | |
using | DataType |
Common class for all analog pressure sensors.
All analog pressure sensors have a transfer function to convert the read voltage into pressure and a range within which they operate.
Definition at line 39 of file AnalogPressureSensor.h.
|
inline |
Definition at line 42 of file AnalogPressureSensor.h.
|
inline |
Definition at line 51 of file AnalogPressureSensor.h.
|
inline |
Retrieve the current offset.
Definition at line 85 of file AnalogPressureSensor.h.
|
inlineoverridevirtual |
Initialize the sensor.
Implements Boardcore::AbstractSensor.
Definition at line 58 of file AnalogPressureSensor.h.
|
inlineoverrideprotectedvirtual |
Conversion function from volts to pascals.
Implements Boardcore::Sensor< AnalogPressureData >.
Definition at line 92 of file AnalogPressureSensor.h.
|
inlineoverridevirtual |
Check if the sensor is working.
Implements Boardcore::AbstractSensor.
Definition at line 60 of file AnalogPressureSensor.h.
|
inline |
Set the current analog pressure sensor offset. Ignores any previous offsets.
Definition at line 66 of file AnalogPressureSensor.h.
|
inline |
Update the current analog pressure sensor offset. Adds the new value to the old offset.
Definition at line 76 of file AnalogPressureSensor.h.
|
protectedpure virtual |
Function that returns the sensor voltage.
Implemented in Boardcore::HoneywellPressureSensor< HoneywellPressureData >, Boardcore::HoneywellPressureSensor< HSCMAND015PAData >, Boardcore::HoneywellPressureSensor< HSCMRNN015PAData >, Boardcore::HoneywellPressureSensor< HSCMRNN030PAData >, Boardcore::HoneywellPressureSensor< HSCMRNN160KAData >, Boardcore::HoneywellPressureSensor< SSCDANN030PAAData >, Boardcore::HoneywellPressureSensor< SSCDRRN015PDAData >, and Boardcore::HoneywellPressureSensor< SSCMRNN030PAData >.
|
protected |
Definition at line 122 of file AnalogPressureSensor.h.
|
protected |
Definition at line 129 of file AnalogPressureSensor.h.
|
protected |
Definition at line 130 of file AnalogPressureSensor.h.
|
protected |
Definition at line 126 of file AnalogPressureSensor.h.
|
protected |
Definition at line 125 of file AnalogPressureSensor.h.
|
protected |
Definition at line 128 of file AnalogPressureSensor.h.