Skyward boardcore
Loading...
Searching...
No Matches
Boardcore::MPX5010 Class Reference

Driver for NXP's MPX5010 pressure sensor. More...

#include <MPX5010.h>

Inheritance diagram for Boardcore::MPX5010:
Collaboration diagram for Boardcore::MPX5010:

Public Member Functions

 MPX5010 (std::function< ADCData()> getVoltage, const float supplyVoltage=5.0)
 
- Public Member Functions inherited from Boardcore::AnalogPressureSensor< MPX5010Data >
 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.
 
- Public Member Functions inherited from Boardcore::Sensor< Data >
 Sensor ()
 
 Sensor (Sensor &&other)
 
virtual ~Sensor ()
 
void sample () override
 Sample the sensor.
 
virtual Data getLastSample ()
 
- Public Member Functions inherited from Boardcore::AbstractSensor
virtual ~AbstractSensor ()
 
SensorErrors getLastError ()
 Get last error for debugging purposes. Avoid silent fails.
 

Additional Inherited Members

- Public Types inherited from Boardcore::Sensor< Data >
using DataType = Data
 
- Protected Member Functions inherited from Boardcore::AnalogPressureSensor< MPX5010Data >
MPX5010Data sampleImpl () override
 Conversion function from volts to pascals.
 
- Protected Attributes inherited from Boardcore::AnalogPressureSensor< MPX5010Data >
std::function< ADCData()> getVoltage
 
miosix::FastMutex offsetMutex
 
float offset
 
const float supplyVoltage
 
const float maxPressure
 
const float minPressure
 
- Protected Attributes inherited from Boardcore::Sensor< Data >
DataType lastSample
 
miosix::FastMutex mutex
 
- Protected Attributes inherited from Boardcore::AbstractSensor
SensorErrors lastError = SensorErrors::NO_ERRORS
 

Detailed Description

Driver for NXP's MPX5010 pressure sensor.

Definition at line 35 of file MPX5010.h.

Constructor & Destructor Documentation

◆ MPX5010()

Boardcore::MPX5010::MPX5010 ( std::function< ADCData()> getVoltage,
const float supplyVoltage = 5.0 )
inline

Definition at line 38 of file MPX5010.h.


The documentation for this class was generated from the following file: