[−][src]Struct pms_7003::Pms7003Sensor
Sensor interface
Methods
impl<Serial> Pms7003Sensor<Serial> where
Serial: Read<u8> + Write<u8>,
[src]
Serial: Read<u8> + Write<u8>,
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]
TX: Write<u8>,
RX: Read<u8>,
pub fn new_tx_rx(tx: TX, rx: RX) -> Self
[src]
Creates a new sensor instance
tx
- embedded hal serial Writerx
- embedded hal serial Read
Auto Trait Implementations
impl<Serial> RefUnwindSafe for Pms7003Sensor<Serial> where
Serial: RefUnwindSafe,
Serial: RefUnwindSafe,
impl<Serial> Send for Pms7003Sensor<Serial> where
Serial: Send,
Serial: Send,
impl<Serial> Sync for Pms7003Sensor<Serial> where
Serial: Sync,
Serial: Sync,
impl<Serial> Unpin for Pms7003Sensor<Serial> where
Serial: Unpin,
Serial: Unpin,
impl<Serial> UnwindSafe for Pms7003Sensor<Serial> where
Serial: UnwindSafe,
Serial: 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,
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>,