M5Unit-TUBE 0.0.2 git rev:56c1d96
Loading...
Searching...
No Matches
m5::unit::UnitMCP_H10 Class Reference

MCP-H10 family unit base class. More...

#include <unit_MCP_H10.hpp>

Inheritance diagram for m5::unit::UnitMCP_H10:
m5::unit::UnitMCP_H10_B200KPPN

Classes

struct  config_t
 Settings for begin. More...
 

Public Member Functions

 UnitMCP_H10 (const float minV, const float maxV, const float coefficient, const float offset)
 Constructor.
 
virtual bool begin () override
 Begin unit, applying config_t settings.
 
virtual void update (const bool force=false) override
 Update periodic measurement.
 
Settings for begin
config_t config ()
 Gets the configuration.
 
void config (const config_t &cfg)
 Set the configuration.
 
Properties
float coefficient () const
 coefficient (K)
 
float offset () const
 offset (B)
 
float minimumVoltage () const
 minimum voltage (OL)
 
float maximumVoltage () const
 maximum voltage (OH)
 
float voltageRange () const
 Voltage range.
 
Measurement data by periodic
float pressure () const
 Oldest measured pressure (kPA)
 
Periodic measurement
bool startPeriodicMeasurement (const uint32_t interval)
 Start periodic measurement.
 
bool stopPeriodicMeasurement ()
 Stop periodic measurement.
 
Single shot measurement
bool measureSingleshot (mcp_h10::Data &d)
 Measurement single shot.
 
Calibration (Software)
bool isCalibrated () const
 Returns true if calibration is set.
 
void setCalibration (const float vzero)
 Set calibration parameter.
 
void clearCalibration ()
 Disable calibration.
 

Protected Member Functions

bool read_measurement (mcp_h10::Data &d)
 
bool read_voltage_millivolts (float &voltage, uint16_t &raw)
 
bool read_voltage_via_pbhub (float &voltage, uint16_t &raw)
 
bool start_periodic_measurement (const uint32_t interval)
 
bool stop_periodic_measurement ()
 
 M5_UNIT_COMPONENT_PERIODIC_MEASUREMENT_ADAPTER_HPP_BUILDER (UnitMCP_H10, mcp_h10::Data)
 

Protected Attributes

std::unique_ptr< m5::container::CircularBuffer< mcp_h10::Data > > _data {}
 

Detailed Description

MCP-H10 family unit base class.

Note
MCP-H10 family spec
Model Po (kPa) Pr (kPa) OL (V) OH (V) k B M5?
MCP-H10-A2KP5P 0 2.5 0.5 4.5 0.625 -0.3125
MCP-H10-A2KP5PN -2.5 2.5 0.5 4.5 1.25 -3.125
MCP-H10-A5KPP 0 5 0.5 4.5 1.25 -0.625
MCP-H10-A5KPPN -5 5 0.5 4.5 2.5 -6.25
MCP-H10-A10KPP 0 10 0.5 4.5 2.5 -1.25
MCP-H10-A10KPPN -10 10 0.5 4.5 5 -12.5
MCP-H10-A40KPP 0 40 0.5 4.5 10 -5
MCP-H10-A40KPPN -40 40 0.5 4.5 20 -20
MCP-H10-A100KPP 0 100 0.5 4.5 25 -12.5
MCP-H10-A100KPPN -100 100 0.5 4.5 50 -25
MCP-H10-A200KPP 0 200 0.5 4.5 50 -12.5
MCP-H10-A200KPPN -100 200 0.5 4.5 75 -137.5
MCP-H10-A500KPP 0 500 0.5 4.5 125 -62.5
MCP-H10-A1000KPP 0 1000 0.5 4.5 250 -125
MCP-H10-A1000KPPN -100 1000 0.5 4.5 275 -237.5
MCP-H10-B2KP5P 0 2.5 0.1 3.1 0.833 -0.083
MCP-H10-B2KP5PN -2.5 2.5 0.1 3.1 1.667 -2.667
MCP-H10-B05KPPN -5 5 0.1 3.1 3.333 -5.333
MCP-H10-B05KPP 0 5 0.1 3.1 1.667 -0.167
MCP-H10-B10KPP 0 10 0.1 3.1 3.333 -0.333
MCP-H10-B10KPPN -10 10 0.1 3.1 6.667 -3.333
MCP-H10-B40KPP 0 40 0.1 3.1 13.333 -1.333
MCP-H10-B40KPPN -40 40 0.1 3.1 26.667 -42.667
MCP-H10-B100KPP 0 100 0.1 3.1 33.333 -3.333
MCP-H10-B100KPPN -100 100 0.1 3.1 66.667 -106.667
MCP-H10-B200KPP 0 200 0.1 3.1 66.667 -6.667
MCP-H10-B200KPPN -100 200 0.1 3.1 100 -110 TubePressure(SKU:U130)
MCP-H10-B500KPP 0 500 0.1 3.1 166.667 -16.667
MCP-H10-B1000KPP 0 1000 0.1 3.1 333.333 -33.333
MCP-H10-B1000KPPN -100 1000 0.1 3.1 366.667 -136.667

Constructor & Destructor Documentation

◆ UnitMCP_H10()

m5::unit::UnitMCP_H10::UnitMCP_H10 ( const float minV,
const float maxV,
const float coefficient,
const float offset )
inlineexplicit

Constructor.

Parameters
minVOL
maxVOH
coefficientk
offsetB

Member Function Documentation

◆ begin()

bool m5::unit::UnitMCP_H10::begin ( )
overridevirtual

Begin unit, applying config_t settings.

Returns
True if successful

◆ measureSingleshot()

bool m5::unit::UnitMCP_H10::measureSingleshot ( mcp_h10::Data & d)

Measurement single shot.

Parameters
[out]dMeasured data
Returns
True if successful
Warning
During periodic detection runs, an error is returned

◆ setCalibration()

void m5::unit::UnitMCP_H10::setCalibration ( const float vzero)
inline

Set calibration parameter.

Parameters
vzeroVoltage value to be considered as pressure 0

◆ startPeriodicMeasurement()

bool m5::unit::UnitMCP_H10::startPeriodicMeasurement ( const uint32_t interval)
inline

Start periodic measurement.

Parameters
intervalMeasurement interval (ms)
Returns
True if successful

◆ stopPeriodicMeasurement()

bool m5::unit::UnitMCP_H10::stopPeriodicMeasurement ( )
inline

Stop periodic measurement.

Returns
True if successful

◆ update()

void m5::unit::UnitMCP_H10::update ( const bool force = false)
overridevirtual

Update periodic measurement.

Parameters
forceForce read regardless of interval