[][src]Struct ccs811_rs::Ccs811

pub struct Ccs811<I2C> { /* fields omitted */ }

Ccs811 device driver.

Methods

impl<I2C, E> Ccs811<I2C> where
    I2C: Write<Error = E> + WriteRead<Error = E> + Read<Error = E>, 
[src]

pub fn new(i2c: I2C, address: u8) -> Self[src]

Create new instance of the Ccs811 device.

pub fn destroy(self) -> I2C[src]

Destroy driver instance, return I²C bus instance.

pub fn app_start(&mut self) -> Result<(), E>[src]

Enter App mode

pub fn set_meas_mode(
    &mut self,
    drive_mode: DriveMode,
    interrupt: InterruptDataReady,
    threshold: InterruptThreshold
) -> Result<(), E>
[src]

Set MEAS_MODE Register

pub fn get_meas_mode(&mut self, data: &mut [u8; 1]) -> Result<(), E>[src]

Get MEAS_MODE Register

pub fn reset(&mut self) -> Result<(), E>[src]

Perform a SwReset, which brings firmware in Boot Mode.

pub fn hw_info(&mut self) -> Result<[u8; 2], E>[src]

Returns [HwId;HwVersion]

pub fn fw_info(&mut self) -> Result<[u8; 4], E>[src]

Returns [FwBootVersion;FwAppVersion]

pub fn raw_data(&mut self) -> Result<[u8; 2], E>[src]

Returns RAW_DATA

pub fn set_baseline(&mut self, baseline: [u8; 2]) -> Result<(), E>[src]

Set a previosuly retrieved baseline

"A previously stored value may be written back to this two byte register and the Algorithms will use the new value in its calculations (until it adjusts it as part of its internal Automatic Baseline Correction). For more information, refer to ams application note AN000370: CCS811 Clean Air Baseline Save and Restore."

pub fn get_baseline(&mut self, baseline: &mut [u8; 2]) -> Result<(), E>[src]

Retrieves Baseline

pub fn get_status(&mut self, status: &mut [u8; 1]) -> Result<(), E>[src]

Retrieves Status register

pub fn get_error_id(&mut self) -> Result<u8, E>[src]

Retrieves Error_Id register

pub fn get_results(&mut self) -> Result<SensorData, E>[src]

Get result

Trait Implementations

impl<I2C: Debug> Debug for Ccs811<I2C>[src]

impl<I2C: Default> Default for Ccs811<I2C>[src]

Auto Trait Implementations

impl<I2C> RefUnwindSafe for Ccs811<I2C> where
    I2C: RefUnwindSafe

impl<I2C> Send for Ccs811<I2C> where
    I2C: Send

impl<I2C> Sync for Ccs811<I2C> where
    I2C: Sync

impl<I2C> Unpin for Ccs811<I2C> where
    I2C: Unpin

impl<I2C> UnwindSafe for Ccs811<I2C> where
    I2C: 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.