[−][src]Struct hts221::device::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]
Comm: WriteRead,
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]
&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_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
Auto Trait Implementations
impl RefUnwindSafe for CtrlReg2
impl Send for CtrlReg2
impl Sync for CtrlReg2
impl Unpin for CtrlReg2
impl UnwindSafe for CtrlReg2
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>,