Skyward boardcore
|
Driver for NXP's MPX5010 pressure sensor. More...
#include <MPX5010.h>
Public Member Functions | |
MPX5010 (std::function< ADCData()> getVoltage, const float supplyVoltage=5.0) | |
![]() | |
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 Data | getLastSample () |
![]() | |
virtual | ~AbstractSensor () |
SensorErrors | getLastError () |
Get last error for debugging purposes. Avoid silent fails. | |
Additional Inherited Members | |
![]() | |
using | DataType = Data |
![]() | |
MPX5010Data | sampleImpl () override |
Conversion function from volts to pascals. | |
![]() | |
std::function< ADCData()> | getVoltage |
miosix::FastMutex | offsetMutex |
float | offset |
const float | supplyVoltage |
const float | maxPressure |
const float | minPressure |
![]() | |
DataType | lastSample |
miosix::FastMutex | mutex |
![]() | |
SensorErrors | lastError = SensorErrors::NO_ERRORS |
|
inline |