pub trait Ccs811BootMode: Sealed {
type Error;
type ModeChangeError;
type TargetType;
// Required methods
fn start_application(
self,
) -> Result<Self::TargetType, Self::ModeChangeError>;
fn update_application<D: DelayNs>(
&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: DelayNs>(
&mut self,
bin: &[u8],
delay: &mut D,
) -> Result<(), Self::Error>;
fn software_reset(&mut self) -> Result<(), Self::Error>;
}
Expand description
Methods available when on boot mode
Required Associated Types§
Sourcetype ModeChangeError
type ModeChangeError
Boot/App mode change error
Sourcetype TargetType
type TargetType
Application mode type
Required Methods§
Sourcefn start_application(self) -> Result<Self::TargetType, Self::ModeChangeError>
fn start_application(self) -> Result<Self::TargetType, Self::ModeChangeError>
Start application mode
NOTE: after this call 1ms must be waited before sending application commands.
Sourcefn update_application<D: DelayNs>(
&mut self,
bin: &[u8],
delay: &mut D,
) -> Result<(), Self::Error>
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.
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.
Sourcefn verify_application(&mut self) -> Result<(), Self::Error>
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.
Sourcefn erase_application(&mut self) -> Result<(), Self::Error>
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.
Sourcefn download_application<D: DelayNs>(
&mut self,
bin: &[u8],
delay: &mut D,
) -> Result<(), Self::Error>
fn download_application<D: DelayNs>( &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).
Sourcefn software_reset(&mut self) -> Result<(), Self::Error>
fn software_reset(&mut self) -> Result<(), Self::Error>
Restart the device in boot mode.
2ms should be waited before doing any other operation.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.