118 bool init()
override;
164 float convertPressure(uint8_t pressXL, uint8_t pressL, uint8_t pressH);
170 float convertTemperature(uint8_t tempL, uint8_t tempH);
177 uint16_t pressureSensitivity;
High level driver for the I2C peripherals.
Driver for LPS28DFW STMicroelectronics digital pressure sensor working in I2C.
LPS28DFWData sampleImpl() override
Read a data sample from the sensor. In case of errors, the method should return the last available co...
bool setOutputDataRate(ODR odr)
Sets and saves the output data rate.
bool setAverage(AVG avg)
Sets and saves the oversampling on the sensor.
ODR
Enumeration for Output Data Rate Configuration.
FullScaleRange
Enumeration for the full scale range to set on the sensor. Available are 1260 hPa or 4060 hPa.
AVG
Enumeration for the oversampling to set on the sensor.
bool setConfig(const SensorConfig &config)
Sets and saves the configurations passed on the parameters.
bool setDRDYInterrupt(bool drdy)
Sets and saves the full scale range.
LPS28DFW(I2C &i2c, SensorConfig sensorConfig)
Constructor that stores the initial settings (without applying them to the sensor).
bool selfTest() override
The self test method returns true if we read the right whoami value. We can't make a better self test...
bool setFullScaleRange(FullScaleRange fs)
Sets and saves the full scale range.
bool init() override
Initializes the sensor with the current settings.
static PrintLogger getLogger(const string &name)
Base sensor class with has to be extended by any sensor driver.
This file includes all the types the logdecoder script will decode.
Configuration struct for a slave device. This will be used for configuring the bus in order to commun...
Struct that sums up all the settings of the sensor.
AVG avg
Average avg samples.
bool drdy
Enable Interrupt for Data Ready.
FullScaleRange fsr
Full scale range.
Struct for the LPS28DFW barometer data. Pressures stored in Pa and Temperature in °C.