Struct aht20_driver::SensorStatus
source · [−]pub struct SensorStatus(pub u8);
Expand description
SensorStatus is the response from the sensor indicating if it is ready to read from, and if it is calibrated.
This is returned from the check_status
method. It is used both
during initialization, which is when the sensor caibrates itself, and during
measure. During measure the sensor will report itself as busy (not ready)
for a period of 80ms.
Tuple Fields
0: u8
Implementations
sourceimpl SensorStatus
impl SensorStatus
sourcepub fn new(status: u8) -> Self
pub fn new(status: u8) -> Self
Create a new SensorStatus from an AHT20 status byte.
That byte comes from the check_status
method.
sourcepub fn is_ready(self) -> bool
pub fn is_ready(self) -> bool
Check if the sensor is ready to have data read from it. After issuing a sensor read, you must check is_ready before reading the result. The measure function takes care of this wait and check.
sourcepub fn is_calibrated(self) -> bool
pub fn is_calibrated(self) -> bool
Check if the sensor is calibrated. If it is not, you must call init
to initialize the
sensor.
Trait Implementations
sourceimpl Clone for SensorStatus
impl Clone for SensorStatus
sourcefn clone(&self) -> SensorStatus
fn clone(&self) -> SensorStatus
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for SensorStatus
impl Debug for SensorStatus
impl Copy for SensorStatus
Auto Trait Implementations
impl RefUnwindSafe for SensorStatus
impl Send for SensorStatus
impl Sync for SensorStatus
impl Unpin for SensorStatus
impl UnwindSafe for SensorStatus
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more