pub struct Pms7003Sensor<Serial>{ /* private fields */ }Expand description
Sensor interface
Implementations§
Source§impl<Serial> Pms7003Sensor<Serial>
impl<Serial> Pms7003Sensor<Serial>
Sourcepub fn new(serial: Serial) -> Self
pub fn new(serial: Serial) -> Self
Creates a new sensor instance
serial- single object implementing embedded hal serial traits
Sourcepub fn read(&mut self) -> Result<OutputFrame, Error>
pub fn read(&mut self) -> Result<OutputFrame, Error>
Reads sensor status. Blocks until status is available.
Sourcepub fn sleep(&mut self) -> Result<(), Error>
pub fn sleep(&mut self) -> Result<(), Error>
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>
Sourcepub fn passive(&mut self) -> Result<(), Error>
pub fn passive(&mut self) -> Result<(), Error>
Passive mode - sensor reports air quality on request
Auto Trait Implementations§
impl<Serial> Freeze for Pms7003Sensor<Serial>where
Serial: Freeze,
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> UnsafeUnpin for Pms7003Sensor<Serial>where
Serial: UnsafeUnpin,
impl<Serial> UnwindSafe for Pms7003Sensor<Serial>where
Serial: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more