nrfcxx
0.1.0
C++-17 Framework for Nordic nRF5 Devices
|
Go to the documentation of this file. 8 #ifndef NRFCXX_SENSOR_HTS221_HPP 9 #define NRFCXX_SENSOR_HTS221_HPP 167 return observations_;
210 int odr (uint8_t dr);
220 iface_config_type& ifc);
225 return nrf5::GPIO->IN & (1U << iface_config_.
drdy_psel);
240 int lpsm_process_ (
int& delay,
241 process_flags_type& pf)
override;
245 iface_config_type& iface_config_;
246 calibration_type calibration_{};
247 observations_type observations_{};
248 periph::GPIOTE::sense_listener drdy_listener_;
250 uint16_t lost_drdy_ = 0;
uint16_t conv_pptt(int16_t h_out) const
Convert a measured raw relative humidity value to parts-per-ten-thousand.
Definition: hts221.hpp:115
int16_t hd_out
Pre-calculated two-point raw relative humidity measurement difference.
Definition: hts221.hpp:106
int16_t t0_out
Raw measurement corresponding to cal_cCel[0].
Definition: hts221.hpp:96
int status() const
Return the value of the STATUS register.
STATUS_REG_e
Bit fields in the HTS221 STATUS_REG register.
Definition: hts221.hpp:130
Bit set to indicate that new humidity data is available.
Definition: hts221.hpp:136
Material supporting low-power-mode operations.
int lpsm_sample() override
Post-extend to signal machine if start failed due to undetected drdy.
const iface_config_type & iface_config() const
Access the interface configuration for the sensor.
Definition: hts221.hpp:69
Wrapper around the nRF51 TWI peripheral.
Definition: periph.hpp:1528
static constexpr uint16_t INVALID_OBSERVATION
Value used to indicate that observations are not valid.
Definition: hts221.hpp:146
hts221(notifier_type notify, iface_config_type &ifc)
Instantiate the device.
uint16_t lost_drdy() const
Count of the number of times a DRDY signal was detected to be lost.
Definition: hts221.hpp:234
const observations_type & observations() const
Access the most recent completed observation.
Definition: hts221.hpp:165
int16_t cal_cCel[2]
Temperatures used for two-point calibration.
Definition: hts221.hpp:84
uint8_t odr() const
Retrieve the configured output data rate.
Definition: hts221.hpp:199
periph::TWI & twi
Reference to TWI device used to communicate with sensor.
Definition: hts221.hpp:47
Value when all expected data is available.
Definition: hts221.hpp:139
int16_t hd_pptt
Pre-calculated two-point relative humidity difference.
Definition: hts221.hpp:93
int16_t td_out
Pre-calculated two-point raw temperature measurement difference.
Definition: hts221.hpp:102
uint8_t address
The I2C address used to communicate with the device.
Definition: hts221.hpp:60
Interface to the ST HTS221 capacitive digital sensor for relative humidity and temperature.
Definition: hts221.hpp:36
Observations generated at 12.5 Hz.
Definition: hts221.hpp:188
bool drdy_asserted() const
Programmatic test for whether DRDY is asserted.
Definition: hts221.hpp:223
int16_t conv_cCel(int16_t t_out) const
Convert a measured raw temperature value to centi-Celsius.
Definition: hts221.hpp:109
On-demand observations.
Definition: hts221.hpp:179
Observations generated at 1 Hz.
Definition: hts221.hpp:182
Structure used to convey information about pin levels to sense_listener callbacks.
Definition: periph.hpp:672
std::function< void()> notifier_type
Type used to hold a notifier.
Definition: core.hpp:514
static constexpr auto ODR_DEFAULT
The default output data rate.
Definition: hts221.hpp:192
int16_t temperature_cCel
A measured temperature in centi-Celsius.
Definition: hts221.hpp:155
Base (or mixin) class for anything that supports a state_machine.
Definition: lpm.hpp:426
int16_t h0_out
Raw measurement corresponding to cal_pptt[0].
Definition: hts221.hpp:99
int16_t td_cCel
Pre-calculated two-point temperature difference.
Definition: hts221.hpp:90
Structure for calibration information.
Definition: hts221.hpp:81
Structure used to return sampled values.
Definition: hts221.hpp:149
int8_t drdy_psel
GPIO pin selector usable for interrupt-driven notification of available measurements.
Definition: hts221.hpp:54
Information required to communicate with a sensor instance.
Definition: hts221.hpp:44
uint16_t humidity_pptt
A measured relative humidity in parts-per-ten-thousand (c%).
Definition: hts221.hpp:161
const calibration_type & calibration() const
Access the calibration constants.
Definition: hts221.hpp:124
ODR_e
Bit field values in CTRL_REG1 for observation data rate.
Definition: hts221.hpp:174
Observations generated at 7 Hz.
Definition: hts221.hpp:185
Primary namespace for nrfcxx functionality.
Definition: clock.hpp:17
uint16_t cal_pptt[2]
Relative humidity measures used for two-point calibration.
Definition: hts221.hpp:87
Bit set to indicate that new temperature data is available.
Definition: hts221.hpp:133