[][src]Struct pms_7003::Pms7003Sensor

pub struct Pms7003Sensor<Serial> where
    Serial: Read<u8> + Write<u8>, 
{ /* fields omitted */ }

Sensor interface

Methods

impl<Serial> Pms7003Sensor<Serial> where
    Serial: Read<u8> + Write<u8>, 
[src]

pub fn new(serial: Serial) -> Self[src]

Creates a new sensor instance

  • serial - single object implementing embedded hal serial traits

pub fn read(&mut self) -> Result<OutputFrame, Error>[src]

Reads sensor status. Blocks until status is available.

pub fn sleep(&mut self) -> Result<(), Error>[src]

Sleep mode. May fail because of incorrect reposnse because of race condition between response and air quality status

pub fn wake(&mut self) -> Result<(), Error>[src]

pub fn passive(&mut self) -> Result<(), Error>[src]

Passive mode - sensor reports air quality on request

pub fn active(&mut self) -> Result<(), Error>[src]

Active mode - sensor reports air quality continuously

pub fn request(&mut self) -> Result<(), Error>[src]

Requests status in passive mode

impl<TX, RX> Pms7003Sensor<Wrapper<TX, RX>> where
    TX: Write<u8>,
    RX: Read<u8>, 
[src]

pub fn new_tx_rx(tx: TX, rx: RX) -> Self[src]

Creates a new sensor instance

  • tx - embedded hal serial Write
  • rx - embedded hal serial Read

Auto Trait Implementations

impl<Serial> RefUnwindSafe for Pms7003Sensor<Serial> where
    Serial: RefUnwindSafe

impl<Serial> Send for Pms7003Sensor<Serial> where
    Serial: Send

impl<Serial> Sync for Pms7003Sensor<Serial> where
    Serial: Sync

impl<Serial> Unpin for Pms7003Sensor<Serial> where
    Serial: Unpin

impl<Serial> UnwindSafe for Pms7003Sensor<Serial> where
    Serial: UnwindSafe

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.