[][src]Trait embedded_ccs811::Ccs811BootMode

pub trait Ccs811BootMode: Sealed {
    type Error;
    type ModeChangeError;
    type TargetType;
    fn start_application(
        self
    ) -> Result<Self::TargetType, Self::ModeChangeError>;
fn update_application<D: DelayMs<u16>>(
        &mut self,
        bin: &[u8],
        delay: &mut D
    ) -> Result<(), Self::Error>;
fn verify_application(&mut self) -> Result<(), Self::Error>;
fn erase_application(&mut self) -> Result<(), Self::Error>;
fn download_application<D: DelayMs<u16>>(
        &mut self,
        bin: &[u8],
        delay: &mut D
    ) -> Result<(), Self::Error>;
fn software_reset(&mut self) -> Result<(), Self::Error>; }

Methods available when on boot mode

Associated Types

type Error

Error type

type ModeChangeError

Boot/App mode change error

type TargetType

Application mode type

Loading content...

Required methods

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

Start application mode

NOTE: after this call 1ms must be waited before sending application commands.

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

Reset, erase, download new application and verify it in one step.

This resets the device via a software reset, erases the current application, flashes the new binary and verifies it. This takes at least 572ms + 50ms * (bin_size/8). Returns Error::InvalidInputData if the input binary lengh is not multiple of 8.

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

Verify application.

NOTE: After the first call, 70ms must be waited before calling again to poll until completion.

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

Erase application.

NOTE: After the first call, 500ms must be waited before calling again to poll until completion.

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

Download new application.

Returns Error::InvalidInputData if the input binary lengh is not multiple of 8. This takes at least 50ms * (bin_size/8).

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

Restart the device in boot mode.

2ms should be waited before doing any other operation.

Loading content...

Implementors

impl<I2C, CommE, PinE, NWAKE, WAKEDELAY> Ccs811BootMode for Ccs811<I2C, NWAKE, WAKEDELAY, Boot> where
    I2C: Write<Error = CommE> + WriteRead<Error = CommE>,
    NWAKE: OutputPin<Error = PinE>,
    WAKEDELAY: DelayUs<u8>, 
[src]

type Error = Error<CommE, PinE>

type ModeChangeError = ModeChangeError<Self::Error, Self>

type TargetType = Ccs811<I2C, NWAKE, WAKEDELAY, App>

impl<I2C, E> Ccs811BootMode for Ccs811Awake<I2C, Boot> where
    I2C: Write<Error = E> + WriteRead<Error = E>, 
[src]

type Error = ErrorAwake<E>

type ModeChangeError = ModeChangeError<Self::Error, Self>

type TargetType = Ccs811Awake<I2C, App>

Loading content...