Skip to main content

Lsm6dsv16x

Struct Lsm6dsv16x 

Source
pub struct Lsm6dsv16x { /* private fields */ }
Expand description

LSM6DSV16X driver. Does not own the SPI bus or CS line — they are passed in per-call so that SPI4 can be shared with other devices (DWM tag on CS1).

Implementations§

Source§

impl Lsm6dsv16x

Source

pub fn new<I, PINS, CS>( spi: &mut SpiBus<I, PINS>, cs: &mut CS, ) -> Result<Self, Error>
where I: Instance, PINS: Pins<I>, CS: CsControl,

Probe WHO_AM_I, soft-reset, and configure accel + gyro for ±2 g / ±2000 dps at 120 Hz ODR in high-performance mode.

Source

pub fn read_sample<I, PINS, CS>( &mut self, spi: &mut SpiBus<I, PINS>, cs: &mut CS, ) -> Result<ImuSample, Error>
where I: Instance, PINS: Pins<I>, CS: CsControl,

Burst-read gyro XYZ and accel XYZ (12 bytes starting at OUTX_L_G) and convert to SI units. Gyro comes first in the register map, then accel.

Auto Trait Implementations§

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.