Struct hts221::device::AvConf
[−]
[src]
pub struct AvConf(_);
The AV_CONF register. Controls humidity and temperature resolution modes.
Methods
impl AvConf
[src]
pub fn new<Comm>(comm: &mut Comm) -> Result<Self, Comm::Error> where
Comm: I2C,
[src]
Comm: I2C,
Blocking read of the AV_CONF register over comm
.
pub fn modify<Comm, F>(
&mut self,
comm: &mut Comm,
f: F
) -> Result<(), Comm::Error> where
Comm: I2C,
F: FnOnce(&mut Self),
[src]
&mut self,
comm: &mut Comm,
f: F
) -> Result<(), Comm::Error> where
Comm: I2C,
F: FnOnce(&mut Self),
Updates the register using f
, then writes the new value out to the chip.
pub fn humidity_samples_averaged(&self) -> u16
[src]
Returns the number of internal humidity samples averaged together to generate one sample. Note that this is an interpretation of the bit pattern, not the bit pattern itself.
pub fn set_humidity_samples_averaged(&mut self, samples: AvgH)
[src]
Sets the number of internal humidity samples that are averaged together to generate one
sample. Use inside a modify
function to actually set the value on the chip.
Do this:
let av_conf = hts221.av_conf()?; av_conf.modify(|w| w.set_humidity_samples_averaged(AvgH::Avg8))?;
Instead of this:
let av_conf = hts221.av_conf()?; av_conf.set_humidity_samples_averaged(AvgH::Avg8)?; // not written to chip
pub fn temperature_samples_averaged(&self) -> u16
[src]
Returns the number of internal temperature samples averaged together to generate one sample. Note that this is an interpretation of the bit pattern, not the bit pattern itself.
pub fn set_temperature_samples_averaged(&mut self, samples: AvgT)
[src]
Sets the number of internal temperature samples that are averaged together to generate one
sample. Use inside a modify
function to actually set the value on the chip.