Struct mh_z19c::MhZ19C [−][src]
Driver for the MH-Z19C sensor.
Implementations
impl<'a, U, E> MhZ19C<'a, U, E> where
U: Read<u8, Error = E> + Write<u8, Error = E>,
[src]
U: Read<u8, Error = E> + Write<u8, Error = E>,
pub fn new(uart: U) -> Self
[src]
Create a new instance.
uart
: Serial (UART) interface for communication with the sensor.
pub fn into_inner(self) -> U
[src]
Returns the owned UART interface.vec!
Note that this might leave the interface with partially written or read
bytes on the UART interface if not all MH-Z19C commands have been polled
to completion (i.e. the last command call did not return
nb::Error::WouldBlock
).
pub fn read_co2_ppm(&mut self) -> Result<u16, Error<E>>
[src]
Reads and returns the CO₂ concentration in parts-per-million (ppm).
pub fn set_self_calibrate(&mut self, enabled: bool) -> Result<(), Error<E>>
[src]
Activates or deactivates the sensor’s self-calibration mode.
See the sensor’s data sheet for more information on self-calibration and hand-operated mode.
Trait Implementations
impl<'a, U: Debug, E: Debug> Debug for MhZ19C<'a, U, E> where
U: Read<u8, Error = E> + Write<u8, Error = E>,
[src]
U: Read<u8, Error = E> + Write<u8, Error = E>,
Auto Trait Implementations
impl<'a, U, E> RefUnwindSafe for MhZ19C<'a, U, E> where
U: RefUnwindSafe,
U: RefUnwindSafe,
impl<'a, U, E> Send for MhZ19C<'a, U, E> where
U: Send,
U: Send,
impl<'a, U, E> Sync for MhZ19C<'a, U, E> where
U: Sync,
U: Sync,
impl<'a, U, E> Unpin for MhZ19C<'a, U, E> where
U: Unpin,
U: Unpin,
impl<'a, U, E> UnwindSafe for MhZ19C<'a, U, E> where
U: UnwindSafe,
U: UnwindSafe,
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,
pub 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.
pub 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>,