[][src]Struct hts221::device::CtrlReg1

pub struct 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]

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]

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

impl Debug for CtrlReg1[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.