Skip to main content

Bmi088Source

Struct Bmi088Source 

Source
pub struct Bmi088Source<SPI, ACC, GYR, D> { /* private fields */ }
Expand description

Copper source task for the BMI088 IMU.

This task reads accelerometer and gyroscope data from the BMI088 and outputs an ImuPayload with measurements in SI units (m/s² for acceleration, rad/s for angular velocity, °C for temperature).

§Type Parameters

  • SPI: SPI bus type implementing embedded_hal::blocking::spi::Transfer<u8>
  • ACC: Accelerometer chip-select GPIO implementing OutputPin
  • GYR: Gyroscope chip-select GPIO implementing OutputPin
  • D: Delay provider implementing DelayMs<u32>

Trait Implementations§

Source§

impl<SPI, ACC, GYR, D> CuSrcTask for Bmi088Source<SPI, ACC, GYR, D>
where SPI: Transfer<u8> + Send + Sync + 'static, SPI::Error: Debug + Send + 'static, ACC: OutputPin + Send + Sync + 'static, ACC::Error: Debug + Send + 'static, GYR: OutputPin + Send + Sync + 'static, GYR::Error: Debug + Send + 'static, D: DelayMs<u32> + Send + Sync + 'static,

Source§

type Resources<'r> = Resources<SPI, ACC, GYR, D>

Resources required by the task.
Source§

type Output<'m> = CuStampedData<ImuPayload, CuMsgMetadata>

Source§

fn new( _config: Option<&ComponentConfig>, resources: Self::Resources<'_>, ) -> CuResult<Self>
where Self: Sized,

Here you need to initialize everything your task will need for the duration of its lifetime. The config allows you to access the configuration of the task.
Source§

fn start(&mut self, _clock: &RobotClock) -> CuResult<()>

Start is called between the creation of the task and the first call to pre/process.
Source§

fn process<'o>( &mut self, clock: &RobotClock, output: &mut Self::Output<'o>, ) -> CuResult<()>

Process is the most critical execution of the task. The goal will be to produce the output message as soon as possible. Use preprocess to prepare the task to make this method as short as possible.
Source§

fn preprocess(&mut self, _clock: &RobotClock) -> Result<(), CuError>

This is a method called by the runtime before “process”. This is a kind of best effort, as soon as possible call to give a chance for the task to do some work before to prepare to make “process” as short as possible.
Source§

fn postprocess(&mut self, _clock: &RobotClock) -> Result<(), CuError>

This is a method called by the runtime after “process”. It is best effort a chance for the task to update some state after process is out of the way. It can be use for example to maintain statistics etc. that are not time-critical for the robot.
Source§

fn stop(&mut self, _clock: &RobotClock) -> Result<(), CuError>

Called to stop the task. It signals that the *process method won’t be called until start is called again.
Source§

impl<SPI, ACC, GYR, D> Freezable for Bmi088Source<SPI, ACC, GYR, D>
where SPI: Transfer<u8> + Send + Sync + 'static, SPI::Error: Debug + Send + 'static, ACC: OutputPin + Send + Sync + 'static, ACC::Error: Debug + Send + 'static, GYR: OutputPin + Send + Sync + 'static, GYR::Error: Debug + Send + 'static, D: DelayMs<u32> + Send + Sync + 'static,

Source§

fn freeze<E>(&self, encoder: &mut E) -> Result<(), EncodeError>
where E: Encoder,

This method is called by the framework when it wants to save the task state. The default implementation is to encode nothing (stateless). If you have a state, you need to implement this method.
Source§

fn thaw<D>(&mut self, _decoder: &mut D) -> Result<(), DecodeError>
where D: Decoder,

This method is called by the framework when it wants to restore the task to a specific state. Here it is similar to Decode but the framework will give you a new instance of the task (the new method will be called)
Source§

impl<SPI, ACC, GYR, D> TypePath for Bmi088Source<SPI, ACC, GYR, D>
where SPI: 'static, ACC: 'static, GYR: 'static, D: 'static,

Source§

fn type_path() -> &'static str

Source§

fn short_type_path() -> &'static str

Source§

fn type_ident() -> Option<&'static str>

Source§

fn crate_name() -> Option<&'static str>

Source§

fn module_path() -> Option<&'static str>

Auto Trait Implementations§

§

impl<SPI, ACC, GYR, D> Freeze for Bmi088Source<SPI, ACC, GYR, D>
where SPI: Freeze, ACC: Freeze, GYR: Freeze, D: Freeze,

§

impl<SPI, ACC, GYR, D> RefUnwindSafe for Bmi088Source<SPI, ACC, GYR, D>

§

impl<SPI, ACC, GYR, D> Send for Bmi088Source<SPI, ACC, GYR, D>
where SPI: Send, ACC: Send, GYR: Send, D: Send,

§

impl<SPI, ACC, GYR, D> Sync for Bmi088Source<SPI, ACC, GYR, D>
where SPI: Sync, ACC: Sync, GYR: Sync, D: Sync,

§

impl<SPI, ACC, GYR, D> Unpin for Bmi088Source<SPI, ACC, GYR, D>
where SPI: Unpin, ACC: Unpin, GYR: Unpin, D: Unpin,

§

impl<SPI, ACC, GYR, D> UnsafeUnpin for Bmi088Source<SPI, ACC, GYR, D>
where SPI: UnsafeUnpin, ACC: UnsafeUnpin, GYR: UnsafeUnpin, D: UnsafeUnpin,

§

impl<SPI, ACC, GYR, D> UnwindSafe for Bmi088Source<SPI, ACC, GYR, D>
where SPI: UnwindSafe, ACC: UnwindSafe, GYR: UnwindSafe, D: 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> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<T> GetTypeRegistration for T

Source§

impl<T> Reflect for T
where T: 'static,

Source§

impl<T> ReflectTypePath for T