M5Unit-METER 0.0.3 git rev:c518ea3
Loading...
Searching...
No Matches
m5::unit::UnitKmeterISO Class Reference

KMeterISO unitis an integrated K-type thermocouple sensor unit that integrates the functions of "acquisition + isolation + communication". More...

#include <unit_KmeterISO.hpp>

Inheritance diagram for m5::unit::UnitKmeterISO:

Classes

struct  config_t
 Settings for begin. More...
 

Public Member Functions

 UnitKmeterISO (const uint8_t addr=DEFAULT_ADDRESS)
 
virtual bool begin () override
 
virtual void update (const bool force=false) override
 
bool readStatus (uint8_t &status)
 Read status.
 
bool isReady ()
 Ready to read data?
 
bool readFirmwareVersion (uint8_t &ver)
 Read firmware version.
 
Settings for begin
config_t config ()
 Gets the configration.
 
void config (const config_t &cfg)
 Set the configration.
 
Properties
kmeterISO::MeasurementUnit measurementUnit () const
 
void setMeasurementUnit (const kmeterISO::MeasurementUnit munit)
 
Measurement data by periodic
float temperature () const
 Oldest temperature.
 
Periodic measurement
bool startPeriodicMeasurement ()
 Start periodic measurement in the current settings.
 
bool startPeriodicMeasurement (const uint32_t interval, const kmeterISO::MeasurementUnit munit=kmeterISO::Celsius)
 Start periodic measurement.
 
bool stopPeriodicMeasurement ()
 Stop periodic measurement.
 
Single shot measurement
bool measureSingleshot (kmeterISO::Data &d, kmeterISO::MeasurementUnit munit=kmeterISO::MeasurementUnit::Celsius, const uint32_t timeoutMs=0)
 Measure temperature single shot.
 
bool measureInternalSingleshot (kmeterISO::Data &d, kmeterISO::MeasurementUnit munit=kmeterISO::MeasurementUnit::Celsius, const uint32_t timeoutMs=0)
 Measure internal temperature single shot.
 
I2C Address
Warning
Handling warning
bool changeI2CAddress (const uint8_t i2c_address)
 Change device I2C address.
 
bool readI2CAddress (uint8_t &i2c_address)
 Read device I2C address.
 

Protected Member Functions

bool start_periodic_measurement ()
 
bool start_periodic_measurement (const uint32_t interval, const kmeterISO::MeasurementUnit munit=kmeterISO::Celsius)
 
bool stop_periodic_measurement ()
 
bool read_measurement (kmeterISO::Data &d, const kmeterISO::MeasurementUnit munit)
 
bool read_internal_measurement (kmeterISO::Data &d, const kmeterISO::MeasurementUnit munit)
 
 M5_UNIT_COMPONENT_PERIODIC_MEASUREMENT_ADAPTER_HPP_BUILDER (UnitKmeterISO, kmeterISO::Data)
 

Protected Attributes

std::unique_ptr< m5::container::CircularBuffer< kmeterISO::Data > > _data {}
 
kmeterISO::MeasurementUnit _munit {kmeterISO::MeasurementUnit::Celsius}
 
config_t _cfg {}
 

Detailed Description

KMeterISO unitis an integrated K-type thermocouple sensor unit that integrates the functions of "acquisition + isolation + communication".

Member Function Documentation

◆ changeI2CAddress()

bool m5::unit::UnitKmeterISO::changeI2CAddress ( const uint8_t i2c_address)

Change device I2C address.

Parameters
i2c_addressI2C address
Returns
True if successful

◆ isReady()

bool m5::unit::UnitKmeterISO::isReady ( )
inline

Ready to read data?

Returns
True if ready to read data

◆ measureInternalSingleshot()

bool m5::unit::UnitKmeterISO::measureInternalSingleshot ( kmeterISO::Data & d,
kmeterISO::MeasurementUnit munit = kmeterISO::MeasurementUnit::Celsius,
const uint32_t timeoutMs = 0 )

Measure internal temperature single shot.

Parameters
[out]dataMeasuerd data
munitmeasurement unit
timeoutMsMeasurement timeout time(ms)
Returns
True if successful

◆ measurementUnit()

kmeterISO::MeasurementUnit m5::unit::UnitKmeterISO::measurementUnit ( ) const
inline

Gets the measurement unit on periodic measurement

◆ measureSingleshot()

bool m5::unit::UnitKmeterISO::measureSingleshot ( kmeterISO::Data & d,
kmeterISO::MeasurementUnit munit = kmeterISO::MeasurementUnit::Celsius,
const uint32_t timeoutMs = 0 )

Measure temperature single shot.

Parameters
[out]dataMeasuerd data
munitmeasurement unit
timeoutMsMeasurement timeout time(ms)
Returns
True if successful

◆ readFirmwareVersion()

bool m5::unit::UnitKmeterISO::readFirmwareVersion ( uint8_t & ver)

Read firmware version.

Parameters
[out]verversion
Returns
True if successful

◆ readI2CAddress()

bool m5::unit::UnitKmeterISO::readI2CAddress ( uint8_t & i2c_address)

Read device I2C address.

Parameters
[out]i2c_addressI2C address
Returns
True if successful

◆ readStatus()

bool m5::unit::UnitKmeterISO::readStatus ( uint8_t & status)

Read status.

Parameters
[out]statusStatus
Returns
True if successful

◆ setMeasurementUnit()

void m5::unit::UnitKmeterISO::setMeasurementUnit ( const kmeterISO::MeasurementUnit munit)
inline

Set the measurement unit on periodic measurement

◆ startPeriodicMeasurement() [1/2]

bool m5::unit::UnitKmeterISO::startPeriodicMeasurement ( )
inline

Start periodic measurement in the current settings.

Returns
True if successful

◆ startPeriodicMeasurement() [2/2]

bool m5::unit::UnitKmeterISO::startPeriodicMeasurement ( const uint32_t interval,
const kmeterISO::MeasurementUnit munit = kmeterISO::Celsius )
inline

Start periodic measurement.

Parameters
intervalPeriodic interval(ms)
munitMeasurement unit
Returns
True if successful

◆ stopPeriodicMeasurement()

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

Stop periodic measurement.

Returns
True if successful