[−][src]Struct hts221::device::CtrlReg1
The CTRL_REG1 register. Contains power on, data transfer mode, and data rate configuration.
Methods
impl CtrlReg1
[src]
pub fn new<Comm>(dev: &mut Device<Comm>) -> Result<Self, Comm::Error> where
Comm: WriteRead,
[src]
Comm: WriteRead,
Blocking read of the CTRL_REG1 register from dev
.
pub fn modify<Comm, F>(
&mut self,
dev: &mut Device<Comm>,
f: F
) -> Result<(), Comm::Error> where
Comm: Write,
F: FnOnce(&mut Self),
[src]
&mut self,
dev: &mut Device<Comm>,
f: F
) -> Result<(), Comm::Error> where
Comm: Write,
F: FnOnce(&mut Self),
Updates the register using f
, then writes the new value out to the chip.
pub fn is_powered_up(&self) -> bool
[src]
Returns true if the chip is active.
pub fn power_down(&mut self)
[src]
Clears the power-down bit. The device is in power-down mode when PD = 0.
pub fn power_up(&mut self)
[src]
Sets the power-down bit. The device is active when PD = 1.
pub fn is_block_update(&self) -> bool
[src]
Returns true if the chip is using block-update mode.
pub fn set_continuous_update(&mut self)
[src]
Clears the block-update mode bit. In default (continuous) mode, the lower and upper parts of the output registers are updated continuously. If it is not certain whether the read will be faster than output data rate, it is recommended to use block-update mode.
pub fn set_block_update(&mut self)
[src]
Sets the block-update mode bit. In block-update mode, after the reading of the lower (upper) register part, the content of that output register is not updated until the upper (lower) part is read also. This feature prevents the reading of LSB and MSB related to different samples.
pub fn data_rate(&self) -> DataRate
[src]
Returns the configured data rate.
pub fn set_data_rate(&mut self, rate: DataRate)
[src]
Sets the output data rates of humidity and temperature samples.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for CtrlReg1
impl Send for CtrlReg1
impl Sync for CtrlReg1
impl Unpin for CtrlReg1
impl UnwindSafe for CtrlReg1
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,