[][src]Struct hts221::device::CtrlReg2

pub struct CtrlReg2(_);

The CTRL_REG2 register.

Methods

impl CtrlReg2[src]

pub fn new<Comm>(dev: &mut Device<Comm>) -> Result<Self, Comm::Error> where
    Comm: WriteRead
[src]

Blocking read of the CTRL_REG2 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_booting(&self) -> bool[src]

Returns true if the chip is booting.

pub fn boot(&mut self)[src]

Sets the boot bit. From the datasheet:

The BOOT bit is used to refresh the content of the internal registers stored in the Flash memory block. At device power-up, the content of the Flash memory block is transferred to the internal registers related to trimming functions to permit good behavior of the device itself. If, for any reason, the content of the trimming registers is modified, it is sufficient to use this bit to restore the correct values. When the BOOT bit is set to ‘1’ the content of the internal Flash is copied inside the corresponding internal registers and is used to calibrate the device. These values are factory trimmed and are different for every device. They permit good behavior of the device and normally they should not be changed. At the end of the boot process, the BOOT bit is set again to ‘0’.

pub fn is_heater_on(&self) -> bool[src]

Returns true if the heating element is on.

pub fn set_heater_on(&mut self)[src]

Enables the heating element.

pub fn set_heater_off(&mut self)[src]

Disables the heating element.

pub fn is_one_shot(&self) -> bool[src]

Returns true if a one-shot conversion is pending.

pub fn set_one_shot(&mut self)[src]

Initiates a one-shot conversion. The bit will be cleared by hardware after the conversion is complete.

Trait Implementations

impl Debug for CtrlReg2[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.