Struct mpu9250::MpuConfig

source ·
pub struct MpuConfig<MODE> { /* private fields */ }
Expand description

Configuration of MPU9250

Implementations§

source§

impl MpuConfig<Imu>

source

pub fn imu() -> Self

Creates configuration for Imu driver (accelerometer + gyroscope). with default Accel scale, Gyro scale, [Mag scale], AccelDataRate, GyroTempDataRate, and no sample rate divisor.

source§

impl MpuConfig<Marg>

source

pub fn marg() -> Self

Creates configuration for Marg driver (accelerometer + gyroscope + magnetometer) with default Accel scale, Gyro scale, Mag scale, AccelDataRate, GyroTempDataRate, and no sample rate divisor.

source§

impl<MODE> MpuConfig<MODE>

source

pub fn gyro_scale(&mut self, scale: GyroScale) -> &mut Self

Sets gyroscope full reading scale (Gyro scale).

source

pub fn accel_scale(&mut self, scale: AccelScale) -> &mut Self

Sets accelerometer full reading scale (Accel scale).

source

pub fn accel_data_rate(&mut self, data_rate: AccelDataRate) -> &mut Self

Sets accelerometer data rate config (AccelDataRate).

source

pub fn gyro_temp_data_rate(&mut self, data_rate: GyroTempDataRate) -> &mut Self

Sets gyroscope and temperatures data rate config (GyroTempDataRate).

source

pub fn sample_rate_divisor(&mut self, smplrt_div: u8) -> &mut Self

Sets sample rate divisor. Sample rate divisor divides the internal sample rate to generate the sample rate that controls sensor data output rate, FIFO sample rate. NOTE: This register is only effective when dlpf mode used for GyroTempDataRate see GyroTempDataRate. SampleRate = InternalSampleRate / (1 + SMPLRT_DIV).

source§

impl MpuConfig<Marg>

source

pub fn mag_scale(&mut self, scale: MagScale) -> &mut Self

Sets magnetrometer full reading scale (MagScale)

Trait Implementations§

source§

impl<MODE: Clone> Clone for MpuConfig<MODE>

source§

fn clone(&self) -> MpuConfig<MODE>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<MODE: Debug> Debug for MpuConfig<MODE>

source§

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

Formats the value using the given formatter. Read more
source§

impl<MODE: Copy> Copy for MpuConfig<MODE>

Auto Trait Implementations§

§

impl<MODE> RefUnwindSafe for MpuConfig<MODE>where MODE: RefUnwindSafe,

§

impl<MODE> Send for MpuConfig<MODE>where MODE: Send,

§

impl<MODE> Sync for MpuConfig<MODE>where MODE: Sync,

§

impl<MODE> Unpin for MpuConfig<MODE>where MODE: Unpin,

§

impl<MODE> UnwindSafe for MpuConfig<MODE>where MODE: UnwindSafe,

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

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 Twhere U: TryFrom<T>,

§

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.