M5Unit-ENV 1.2.0 git rev:d576302
|
BME688 unit. More...
#include <unit_BME688.hpp>
Classes | |
struct | config_t |
Settings for begin. More... | |
Public Member Functions | |
UnitBME688 (const uint8_t addr=DEFAULT_ADDRESS) | |
virtual bool | begin () override |
virtual void | update (const bool force=false) override |
void | setAambientTemperature (const int8_t temp) |
Sets the ambient temperature. | |
bool | readCalibration (bme688::bme68xCalibration &c) |
Read calibration. | |
bool | writeCalibration (const bme688::bme68xCalibration &c) |
write calibration | |
uint32_t | calculateMeasurementInterval (const bme688::Mode mode, const bme688::bme68xConf &s) |
Calculation of measurement intervals without heater. | |
bool | readUniqueID (uint32_t &id) |
Read unique ID. | |
bool | softReset () |
Software reset. | |
bool | selfTest () |
Self-test. | |
bool | writeMode (const bme688::Mode m) |
Write operation mode. | |
bool | readMode (bme688::Mode &m) |
Read operation mode. | |
Configuration for begin | |
config_t | config () |
Gets the configration. | |
void | config (const config_t &cfg) |
Set the configration. | |
Properties | |
bme688::Mode | mode () const |
Current mode. | |
const bme688::bme68xCalibration & | calibration () const |
Gets the Calibration. | |
const bme688::bme68xConf & | tphSetting () const |
Gets the TPH setting. | |
const bme688::bme68xHeatrConf & | heaterSetting () const |
Gets the heater setiing. | |
int8_t | ambientTemperature () const |
Gets the ambient temperature. | |
Measurement data by periodic | |
float | iaq () const |
Oldest measured IAQ. | |
float | temperature () const |
Oldest measured temperature (Celsius) | |
float | pressure () const |
Oldest measured pressure (Pa) | |
float | humidity () const |
Oldest measured humidity (%) | |
float | gas () const |
Oldest measured gas (Ohm) | |
TPH(Temperature,Pressure,Humidity) | |
bool | readTPHSetting (bme688::bme68xConf &s) |
Read TPH setting. | |
bool | readOversamplingTemperature (bme688::Oversampling &os) |
Read temperature oversampling. | |
bool | readOversamplingPressure (bme688::Oversampling &os) |
Read pressure oversampling. | |
bool | readIIRFilter (bme688::Filter &f) |
Read IIRFilter. | |
bool | readOversamplingHumidity (bme688::Oversampling &os) |
Read humidity oversampling. | |
bool | writeTPHSetting (const bme688::bme68xConf &s) |
Write TPH setting. | |
bool | writeOversampling (const bme688::Oversampling t, const bme688::Oversampling p, const bme688::Oversampling h) |
Wite oversamplings. | |
bool | writeOversamplingTemperature (const bme688::Oversampling os) |
Write temperature oversampling. | |
bool | writeOversamplingPressure (const bme688::Oversampling os) |
Write pressure oversampling. | |
bool | writeOversamplingHumidity (const bme688::Oversampling os) |
Write humidity oversampling. | |
bool | writeIIRFilter (const bme688::Filter f) |
Write IIRFilter. | |
Heater | |
bool | readHeaterSetting (bme688::bme68xHeatrConf &hs) |
Read heater setting. | |
bool | writeHeaterSetting (const bme688::Mode mode, const bme688::bme68xHeatrConf &hs) |
Write heater setting. | |
Periodic measurement | |
bool | startPeriodicMeasurement (const bme688::Mode m) |
Start periodic measurement without BSEC2. | |
bool | startPeriodicMeasurement (const uint32_t subscribe_bits, const bme688::bsec2::SampleRate sr=bme688::bsec2::SampleRate::LowPower) |
Start periodic measurement using BSEC2. | |
bool | startPeriodicMeasurement (const bsec_virtual_sensor_t *ss, const size_t len, const bme688::bsec2::SampleRate sr=bme688::bsec2::SampleRate::LowPower) |
Start periodic measurement using BSEC2. | |
bool | stopPeriodicMeasurement () |
Stop periodic measurement. | |
Single shot measurement | |
bool | measureSingleShot (bme688::bme68xData &data) |
Take a single measurement. | |
Bosch BSEC2 wrapper | |
| |
float | bsec2GetTemperatureOffset () const |
Gets the temperature offset(Celsius) | |
void | bsec2SetTemperatureOffset (const float offset) |
Set the temperature offset(Celsius) | |
const bsec_version_t & | bsec2Version () const |
Gets the BSEC2 library version. | |
bool | bsec2SetConfig (const uint8_t *cfg, const size_t sz=BSEC_MAX_PROPERTY_BLOB_SIZE) |
Update algorithm configuration parameters Update bsec2 configuration settings. | |
bool | bsec2GetConfig (uint8_t *cfg, uint32_t &actualSize) |
Retrieve the current library configuration. | |
bool | bsec2SetState (const uint8_t *state) |
Restore the internal state. | |
bool | bsec2GetState (uint8_t *state, uint32_t &actualSize) |
Retrieve the current internal library state. | |
bool | bsec2UpdateSubscription (const uint32_t sensorBits, const bme688::bsec2::SampleRate sr) |
Subscribe to library virtual sensors outputs. | |
bool | bsec2UpdateSubscription (const bsec_virtual_sensor_t *ss, const size_t len, const bme688::bsec2::SampleRate sr) |
Subscribe to library virtual sensors outputs. | |
bool | bsec2IsSubscribed (const bsec_virtual_sensor_t id) |
is virtual sensor Subscribed? | |
uint32_t | bsec2Subscription () const |
Gets the subscription bits. | |
bool | bsec2Subscribe (const bsec_virtual_sensor_t id) |
Subscribe virtual sensor. | |
bool | bsec2Unsubscribe (const bsec_virtual_sensor_t id) |
Unsubscribe virtual sensor. | |
bool | bsec2UnsubscribeAll () |
Unsubacribe currentt all sensors. | |
Protected Member Functions | |
bool | start_periodic_measurement (const bme688::Mode m) |
bool | stop_periodic_measurement () |
bool | start_periodic_measurement (const uint32_t subscribe_bits, const bme688::bsec2::SampleRate sr) |
bool | write_mode_forced () |
bool | write_mode_parallel () |
bool | fetch_data () |
void | update_bme688 (const bool force) |
bool | read_measurement () |
bool | process_data (bsecOutputs &outouts, const int64_t ns, const bme688::bme68xData &data) |
void | update_bsec2 (const bool force) |
virtual bool | in_periodic () const override |
M5_UNIT_COMPONENT_PERIODIC_MEASUREMENT_ADAPTER_HPP_BUILDER (UnitBME688, bme688::Data) | |
Protected Attributes | |
bme688::Mode | _mode {bme688::Mode::Sleep} |
bme688::bme68xData | _raw_data [3] {} |
uint8_t | _num_of_data {} |
bme688::bme68xDev | _dev {} |
bme688::bme68xConf | _tphConf {} |
bme688::bme68xHeatrConf | _heaterConf {} |
uint32_t | _bsec2_subscription {} |
bsec_version_t | _bsec2_version {} |
std::unique_ptr< uint8_t > | _bsec2_work {} |
bsec_bme_settings_t | _bsec2_settings {} |
bme688::Mode | _bsec2_mode {} |
bme688::bsec2::SampleRate | _bsec2_sr {} |
bsecOutputs | _outputs {} |
float | _temperatureOffset {} |
std::unique_ptr< m5::container::CircularBuffer< bme688::Data > > | _data {} |
bool | _waiting {} |
types::elapsed_time_t | _can_measure_time {} |
config_t | _cfg {} |
BME688 unit.
bool m5::unit::UnitBME688::bsec2GetConfig | ( | uint8_t * | cfg, |
uint32_t & | actualSize ) |
Retrieve the current library configuration.
[out] | cfg | Buffer to hold the serialized config blob |
[out] | actualSize | Actual size of the returned serialized configuration blob |
bool m5::unit::UnitBME688::bsec2GetState | ( | uint8_t * | state, |
uint32_t & | actualSize ) |
Retrieve the current internal library state.
[out] | state | Buffer to hold the serialized state blob |
[out] | actualSize | Actual size of the returned serialized blob |
|
inline |
is virtual sensor Subscribed?
id | virtual sensor (output) |
bool m5::unit::UnitBME688::bsec2SetConfig | ( | const uint8_t * | cfg, |
const size_t | sz = BSEC_MAX_PROPERTY_BLOB_SIZE ) |
Update algorithm configuration parameters Update bsec2 configuration settings.
cfg | Settings serialized to a binary blob |
sz | size of cfg |
bool m5::unit::UnitBME688::bsec2SetState | ( | const uint8_t * | state | ) |
Restore the internal state.
state | pointer of the state array |
|
inline |
Set the temperature offset(Celsius)
offset | offset value |
bool m5::unit::UnitBME688::bsec2Subscribe | ( | const bsec_virtual_sensor_t | id | ) |
Subscribe virtual sensor.
id | virtual sensor (output) |
|
inline |
Gets the subscription bits.
bool m5::unit::UnitBME688::bsec2Unsubscribe | ( | const bsec_virtual_sensor_t | id | ) |
Unsubscribe virtual sensor.
id | virtual sensor (output) |
bool m5::unit::UnitBME688::bsec2UnsubscribeAll | ( | ) |
Unsubacribe currentt all sensors.
|
inline |
Subscribe to library virtual sensors outputs.
ss | Array of requested virtual sensor (output) configurations for the library |
len | Number of array elements |
sr | Sample rate |
bool m5::unit::UnitBME688::bsec2UpdateSubscription | ( | const uint32_t | sensorBits, |
const bme688::bsec2::SampleRate | sr ) |
Subscribe to library virtual sensors outputs.
sensorBits | Requested virtual sensor (output) configurations for the library |
sr | Sample rate |
|
inline |
Gets the BSEC2 library version.
uint32_t m5::unit::UnitBME688::calculateMeasurementInterval | ( | const bme688::Mode | mode, |
const bme688::bme68xConf & | s ) |
Calculation of measurement intervals without heater.
|
inline |
Oldest measured IAQ.
bool m5::unit::UnitBME688::measureSingleShot | ( | bme688::bme68xData & | data | ) |
Take a single measurement.
[out] | data | output value |
bool m5::unit::UnitBME688::readCalibration | ( | bme688::bme68xCalibration & | c | ) |
Read calibration.
[out] | c | output value |
bool m5::unit::UnitBME688::readHeaterSetting | ( | bme688::bme68xHeatrConf & | hs | ) |
Read heater setting.
hs | Setting |
bool m5::unit::UnitBME688::readIIRFilter | ( | bme688::Filter & | f | ) |
Read IIRFilter.
[out] | f | output value |
bool m5::unit::UnitBME688::readMode | ( | bme688::Mode & | m | ) |
Read operation mode.
[out] | m | Mode |
bool m5::unit::UnitBME688::readOversamplingHumidity | ( | bme688::Oversampling & | os | ) |
Read humidity oversampling.
[out] | os | output value |
bool m5::unit::UnitBME688::readOversamplingPressure | ( | bme688::Oversampling & | os | ) |
Read pressure oversampling.
[out] | os | output value |
bool m5::unit::UnitBME688::readOversamplingTemperature | ( | bme688::Oversampling & | os | ) |
Read temperature oversampling.
[out] | os | output value |
bool m5::unit::UnitBME688::readTPHSetting | ( | bme688::bme68xConf & | s | ) |
Read TPH setting.
[out] | s | output value |
bool m5::unit::UnitBME688::readUniqueID | ( | uint32_t & | id | ) |
Read unique ID.
[out] | id | output value |
bool m5::unit::UnitBME688::selfTest | ( | ) |
Self-test.
bool m5::unit::UnitBME688::softReset | ( | ) |
Software reset.
|
inline |
Start periodic measurement without BSEC2.
m | Mode for measurement |
|
inline |
Start periodic measurement using BSEC2.
ss | Array of requested virtual sensor (output) configurations for the library |
len | Number of array elements |
|
inline |
Start periodic measurement using BSEC2.
subscribe_bits | Measurement type bits |
|
inline |
Stop periodic measurement.
bool m5::unit::UnitBME688::writeCalibration | ( | const bme688::bme68xCalibration & | c | ) |
write calibration
c | Calibration parameter |
bool m5::unit::UnitBME688::writeHeaterSetting | ( | const bme688::Mode | mode, |
const bme688::bme68xHeatrConf & | hs ) |
Write heater setting.
mode | Expected operation mode of the sensor |
hs | Setting |
bool m5::unit::UnitBME688::writeIIRFilter | ( | const bme688::Filter | f | ) |
Write IIRFilter.
[out] | f | enum value |
bool m5::unit::UnitBME688::writeMode | ( | const bme688::Mode | m | ) |
Write operation mode.
m | Mode |
bool m5::unit::UnitBME688::writeOversampling | ( | const bme688::Oversampling | t, |
const bme688::Oversampling | p, | ||
const bme688::Oversampling | h ) |
Wite oversamplings.
t | oversampling for temperature |
p | oversampling for pressure |
h | oversampling for humidity |
bool m5::unit::UnitBME688::writeOversamplingHumidity | ( | const bme688::Oversampling | os | ) |
Write humidity oversampling.
os | enum value |
bool m5::unit::UnitBME688::writeOversamplingPressure | ( | const bme688::Oversampling | os | ) |
Write pressure oversampling.
os | enum value |
bool m5::unit::UnitBME688::writeOversamplingTemperature | ( | const bme688::Oversampling | os | ) |
Write temperature oversampling.
os | enum value |
bool m5::unit::UnitBME688::writeTPHSetting | ( | const bme688::bme68xConf & | s | ) |
Write TPH setting.
s | Setting |