nrfcxx
0.1.0
C++-17 Framework for Nordic nRF5 Devices
|
Go to the documentation of this file. 8 #ifndef NRFCXX_SENSOR_BME280_HPP 9 #define NRFCXX_SENSOR_BME280_HPP 97 bool addr_sec =
false);
126 return ::bme280_set_sensor_mode(BME280_FORCED_MODE, &dev);
135 int fetch (observations_type& obs);
141 return observations_;
146 void init_dev_ (
bool spi,
bool addr_sec =
false);
155 static uint8_t csn_psel_;
159 static int8_t spi_read (uint8_t dev_id,
164 static int8_t spi_write (uint8_t dev_id,
169 static int8_t twi_read (uint8_t dev_id,
174 static int8_t twi_write (uint8_t dev_id,
180 struct bme280_dev dev;
182 int lpsm_process_ (
int& delay,
183 process_flags_type& pf)
override;
186 observations_type observations_;
static constexpr unsigned int SAMPLE_DELAY_utt
Lower bound for wait after sample() before get_sensor_data().
Definition: bme280.hpp:48
const observations_type & observations() const
Retrieve the most recent observations calculated through the LPM infrastructure.
Definition: bme280.hpp:139
int sample()
Request a new sample from the device.
Definition: bme280.hpp:124
unsigned int pressure_cPa
A recently retrieved valid pressure or INVALID_PRESSURE.
Definition: bme280.hpp:70
Wrapper around the nRF51 SPI peripheral.
Definition: periph.hpp:1748
Material supporting low-power-mode operations.
Wrapper around the nRF51 TWI peripheral.
Definition: periph.hpp:1528
Structure used to return sampled values.
Definition: bme280.hpp:60
int fetch(observations_type &obs)
Retrieve the results from the most recent observation.
bme280(notifier_type notify, nrfcxx::periph::SPI &spi, int csn_psel)
Construct an instance that controls through the SPI interface.
static constexpr unsigned int INVALID_PRESSURE
Value used for invalid pressure observations.
Definition: bme280.hpp:57
Abstraction around BME280 temperature/humidity/pressure sensor.
Definition: bme280.hpp:40
static constexpr uint16_t INVALID_TEMPHUMID
Value used for invalid temperature and humidity observations.
Definition: bme280.hpp:51
int initialize()
Initialize the BME280.
std::function< void()> notifier_type
Type used to hold a notifier.
Definition: core.hpp:514
uint16_t humidity_pptt
A recently retrieved valid relative humidity or INVALID_TEMPHUMID.
Definition: bme280.hpp:67
Base (or mixin) class for anything that supports a state_machine.
Definition: lpm.hpp:426
constexpr static int64_t from_ms(int64_t ms)
Convert integral milliseconds to uptime ticks (rounding down).
Definition: clock.hpp:422
int16_t temperature_cCel
A recently retrieved valid temperature or INVALID_TEMPHUMID.
Definition: bme280.hpp:63
Abstraction of Nordic device peripherals.
Primary namespace for nrfcxx functionality.
Definition: clock.hpp:17