Enum SensorData

Source
pub enum SensorData {
    SystemClockFrequency(SystemClockFrequency),
    AccelerometerI16(AccelerometerI16),
    MagnetometerI16(MagnetometerI16),
    TemperatureI16(TemperatureI16),
    GyroscopeI16(GyroscopeI16),
    HeadingI16(HeadingI16),
    EulerAnglesF32(EulerAnglesF32),
    OrientationQuaternionF32(OrientationQuaternionF32),
    LinearRanges(LinearRangeInfo),
    Identification(Identification),
}
Expand description

Data formats.

Variants§

§

SystemClockFrequency(SystemClockFrequency)

The system clock frequency, expressed in Hertz (Hz).

§

AccelerometerI16(AccelerometerI16)

A sensor that measures the gravity vector, typically expressed in “g”.

§

MagnetometerI16(MagnetometerI16)

A sensor that measures magnetic field strength, typically expressed in units auf Milli-Gauss (mG).

§

TemperatureI16(TemperatureI16)

A sensor that measures temperature, typically expressed in °C.

§

GyroscopeI16(GyroscopeI16)

A sensor that measures angular acceleration, typically expressed in degrees/second.

§

HeadingI16(HeadingI16)

A sensor that measures heading, i.e. degrees towards magnetic north (0..360).

§

EulerAnglesF32(EulerAnglesF32)

Euler angles, in radians.

§

OrientationQuaternionF32(OrientationQuaternionF32)

An orientation quaternion.

§

LinearRanges(LinearRangeInfo)

Identification data.

§

Identification(Identification)

Identification data.

Implementations§

Source§

impl SensorData

Source

pub const fn sensor_type_id(&self) -> u8

Provides the sensor type ID.

Source

pub const fn value_type(&self) -> ValueType

Provides the value type.

Source

pub const fn num_components(&self) -> u8

Provides the number of components of the data type.

Source

pub const fn components( sensor_id: u8, value_type: ValueType, ) -> Result<u8, ComponentLookupError>

Provides the number of components of the data type.

Source§

impl SensorData

Source

pub fn is_meta(&self) -> bool

Indicates whether the data resembles metadata.

Source

pub fn meta_target(&self) -> Option<&SensorId>

Gets the embedded SensorId target of a metadata frame.

Trait Implementations§

Source§

impl Clone for SensorData

Source§

fn clone(&self) -> SensorData

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 Debug for SensorData

Source§

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

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

impl Decode for SensorData

Source§

fn decode<__D: Decoder>(decoder: &mut __D) -> Result<Self, DecodeError>

Attempt to decode this type with the given Decode.
Source§

impl Encode for SensorData

Source§

fn encode<__E: Encoder>(&self, encoder: &mut __E) -> Result<(), EncodeError>

Encode a given type.
Source§

impl Format for SensorData

Source§

fn format(&self, f: Formatter<'_>)

Writes the defmt representation of self to fmt.
Source§

impl From<AccelerometerI16> for SensorData

Source§

fn from(value: AccelerometerI16) -> SensorData

Converts to this type from the input type.
Source§

impl From<EulerAnglesF32> for SensorData

Source§

fn from(value: EulerAnglesF32) -> SensorData

Converts to this type from the input type.
Source§

impl From<GyroscopeI16> for SensorData

Source§

fn from(value: GyroscopeI16) -> SensorData

Converts to this type from the input type.
Source§

impl From<HeadingI16> for SensorData

Source§

fn from(value: HeadingI16) -> SensorData

Converts to this type from the input type.
Source§

impl From<Identification> for SensorData

Source§

fn from(value: Identification) -> SensorData

Converts to this type from the input type.
Source§

impl From<LinearRangeInfo> for SensorData

Source§

fn from(value: LinearRangeInfo) -> SensorData

Converts to this type from the input type.
Source§

impl From<MagnetometerI16> for SensorData

Source§

fn from(value: MagnetometerI16) -> SensorData

Converts to this type from the input type.
Source§

impl From<OrientationQuaternionF32> for SensorData

Source§

fn from(value: OrientationQuaternionF32) -> SensorData

Converts to this type from the input type.
Source§

impl From<SystemClockFrequency> for SensorData

Source§

fn from(value: SystemClockFrequency) -> SensorData

Converts to this type from the input type.
Source§

impl From<TemperatureI16> for SensorData

Source§

fn from(value: TemperatureI16) -> SensorData

Converts to this type from the input type.
Source§

impl PartialEq for SensorData

Source§

fn eq(&self, other: &SensorData) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for SensorData

Source§

fn partial_cmp(&self, other: &SensorData) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl RuntimeTypeInformation for SensorData

Source§

fn sensor_type_id(&self) -> u8

Returns the sensor type ID.
Source§

fn value_type(&self) -> ValueType

Returns the field value type.
Source§

fn num_components(&self) -> u8

The number of components
Source§

impl TryFrom<SensorData> for AccelerometerI16

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: SensorData) -> Result<AccelerometerI16, Self::Error>

Performs the conversion.
Source§

impl TryFrom<SensorData> for EulerAnglesF32

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: SensorData) -> Result<EulerAnglesF32, Self::Error>

Performs the conversion.
Source§

impl TryFrom<SensorData> for GyroscopeI16

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: SensorData) -> Result<GyroscopeI16, Self::Error>

Performs the conversion.
Source§

impl TryFrom<SensorData> for HeadingI16

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: SensorData) -> Result<HeadingI16, Self::Error>

Performs the conversion.
Source§

impl TryFrom<SensorData> for Identification

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: SensorData) -> Result<Identification, Self::Error>

Performs the conversion.
Source§

impl TryFrom<SensorData> for LinearRangeInfo

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: SensorData) -> Result<LinearRangeInfo, Self::Error>

Performs the conversion.
Source§

impl TryFrom<SensorData> for MagnetometerI16

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: SensorData) -> Result<MagnetometerI16, Self::Error>

Performs the conversion.
Source§

impl TryFrom<SensorData> for OrientationQuaternionF32

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: SensorData) -> Result<OrientationQuaternionF32, Self::Error>

Performs the conversion.
Source§

impl TryFrom<SensorData> for SystemClockFrequency

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: SensorData) -> Result<SystemClockFrequency, Self::Error>

Performs the conversion.
Source§

impl TryFrom<SensorData> for TemperatureI16

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: SensorData) -> Result<TemperatureI16, Self::Error>

Performs the conversion.
Source§

impl StructuralPartialEq for SensorData

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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> ToOwned for T
where T: Clone,

Source§

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 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.