Struct Ccs811Awake

Source
pub struct Ccs811Awake<I2C, MODE> { /* private fields */ }
Expand description

Already awake CCS811 device driver

This can be used when the nWAKE pin is connected directly to GND or when handling the device waking manually instead of using the Ccs811 wrapper type.

Implementations§

Source§

impl<I2C> Ccs811Awake<I2C, Boot>

Source

pub fn new(i2c: I2C, address: SlaveAddr) -> Self

Create new instance of an already awake CCS811 device.

Source§

impl<I2C, E, MODE> Ccs811Awake<I2C, MODE>
where I2C: I2c<Error = E>,

Source

pub fn destroy(self) -> I2C

Destroy driver instance, return I²C bus instance.

Trait Implementations§

Source§

impl<I2C, E> Ccs811AppMode for Ccs811Awake<I2C, App>
where I2C: I2c<Error = E>,

Source§

type Error = ErrorAwake<E>

Error type
Source§

type ModeChangeError = ModeChangeError<ErrorAwake<E>, Ccs811Awake<I2C, App>>

Boot/App mode change error
Source§

type BootModeType = Ccs811Awake<I2C, Boot>

Boot mode type
Source§

fn set_mode(&mut self, mode: MeasurementMode) -> Result<(), Self::Error>

Set the measurement mode Read more
Source§

fn has_data_ready(&mut self) -> Result<bool, Self::Error>

Check if there is a new data sample ready.
Source§

fn raw_data(&mut self) -> Result<(u8, u16), Self::Error>

Get the raw sensor data. Read more
Source§

fn data(&mut self) -> Result<AlgorithmResult, Self::Error>

Get the algorithm results data. Read more
Source§

fn set_environment( &mut self, humidity_percentage: f32, temperature_celsius: f32, ) -> Result<(), Self::Error>

Set the environment temperature and relative humidity. Read more
Source§

fn baseline(&mut self) -> Result<[u8; 2], Self::Error>

Get the current baseline
Source§

fn set_baseline(&mut self, baseline: [u8; 2]) -> Result<(), Self::Error>

Set the baseline
Source§

fn set_eco2_thresholds( &mut self, low_to_medium: u16, medium_to_high: u16, ) -> Result<(), Self::Error>

Set the eCO2 threshold values for interrupt generation (in ppm). Read more
Source§

fn set_interrupt_mode(&mut self, mode: InterruptMode) -> Result<(), Self::Error>

Configure the interrupt generation.
Source§

fn software_reset(self) -> Result<Self::BootModeType, Self::ModeChangeError>

Restart the device in boot mode. Read more
Source§

impl<I2C, E> Ccs811BootMode for Ccs811Awake<I2C, Boot>
where I2C: I2c<Error = E>,

Source§

type Error = ErrorAwake<E>

Error type
Source§

type ModeChangeError = ModeChangeError<<Ccs811Awake<I2C, Boot> as Ccs811BootMode>::Error, Ccs811Awake<I2C, Boot>>

Boot/App mode change error
Source§

type TargetType = Ccs811Awake<I2C, App>

Application mode type
Source§

fn start_application(self) -> Result<Self::TargetType, Self::ModeChangeError>

Start application mode Read more
Source§

fn verify_application(&mut self) -> Result<(), Self::Error>

Verify application. Read more
Source§

fn erase_application(&mut self) -> Result<(), Self::Error>

Erase application. Read more
Source§

fn download_application<D: DelayNs>( &mut self, bin: &[u8], delay: &mut D, ) -> Result<(), Self::Error>

Download new application. Read more
Source§

fn update_application<D: DelayNs>( &mut self, bin: &[u8], delay: &mut D, ) -> Result<(), Self::Error>

Reset, erase, download new application and verify it in one step. Read more
Source§

fn software_reset(&mut self) -> Result<(), Self::Error>

Restart the device in boot mode. Read more
Source§

impl<I2C, E, MODE> Ccs811Device for Ccs811Awake<I2C, MODE>
where I2C: I2c<Error = E>,

Source§

type Error = ErrorAwake<E>

Error type
Source§

fn firmware_mode(&mut self) -> Result<FirmwareMode, Self::Error>

Get the firmware mode.
Source§

fn has_valid_app(&mut self) -> Result<bool, Self::Error>

Check if a valid application firmware is loaded.
Source§

fn hardware_id(&mut self) -> Result<u8, Self::Error>

Get the hardware ID (0x81 for the CCS81x family of devices)
Source§

fn hardware_version(&mut self) -> Result<(u8, u8), Self::Error>

Get the hardware version (major, minor) ((1,X) for the CCS81x family of devices)
Source§

fn firmware_bootloader_version(&mut self) -> Result<(u8, u8, u8), Self::Error>

Get the firmware bootloader verion (major, minor, trivial)
Source§

fn firmware_application_version(&mut self) -> Result<(u8, u8, u8), Self::Error>

Get the firmware application verion (major, minor, trivial)
Source§

impl<I2C: Debug, MODE: Debug> Debug for Ccs811Awake<I2C, MODE>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<I2C, MODE> Freeze for Ccs811Awake<I2C, MODE>
where I2C: Freeze,

§

impl<I2C, MODE> RefUnwindSafe for Ccs811Awake<I2C, MODE>
where I2C: RefUnwindSafe, MODE: RefUnwindSafe,

§

impl<I2C, MODE> Send for Ccs811Awake<I2C, MODE>
where I2C: Send, MODE: Send,

§

impl<I2C, MODE> Sync for Ccs811Awake<I2C, MODE>
where I2C: Sync, MODE: Sync,

§

impl<I2C, MODE> Unpin for Ccs811Awake<I2C, MODE>
where I2C: Unpin, MODE: Unpin,

§

impl<I2C, MODE> UnwindSafe for Ccs811Awake<I2C, MODE>
where I2C: UnwindSafe, MODE: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.