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
impl SensorData
Sourcepub const fn sensor_type_id(&self) -> u8
pub const fn sensor_type_id(&self) -> u8
Provides the sensor type ID.
Sourcepub const fn value_type(&self) -> ValueType
pub const fn value_type(&self) -> ValueType
Provides the value type.
Sourcepub const fn num_components(&self) -> u8
pub const fn num_components(&self) -> u8
Provides the number of components of the data type.
Sourcepub const fn components(
sensor_id: u8,
value_type: ValueType,
) -> Result<u8, ComponentLookupError>
pub const fn components( sensor_id: u8, value_type: ValueType, ) -> Result<u8, ComponentLookupError>
Provides the number of components of the data type.
Trait Implementations§
Source§impl Clone for SensorData
impl Clone for SensorData
Source§fn clone(&self) -> SensorData
fn clone(&self) -> SensorData
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for SensorData
impl Debug for SensorData
Source§impl Decode for SensorData
impl Decode for SensorData
Source§impl Encode for SensorData
impl Encode for SensorData
Source§impl Format for SensorData
impl Format for SensorData
Source§impl From<AccelerometerI16> for SensorData
impl From<AccelerometerI16> for SensorData
Source§fn from(value: AccelerometerI16) -> SensorData
fn from(value: AccelerometerI16) -> SensorData
Converts to this type from the input type.
Source§impl From<EulerAnglesF32> for SensorData
impl From<EulerAnglesF32> for SensorData
Source§fn from(value: EulerAnglesF32) -> SensorData
fn from(value: EulerAnglesF32) -> SensorData
Converts to this type from the input type.
Source§impl From<GyroscopeI16> for SensorData
impl From<GyroscopeI16> for SensorData
Source§fn from(value: GyroscopeI16) -> SensorData
fn from(value: GyroscopeI16) -> SensorData
Converts to this type from the input type.
Source§impl From<HeadingI16> for SensorData
impl From<HeadingI16> for SensorData
Source§fn from(value: HeadingI16) -> SensorData
fn from(value: HeadingI16) -> SensorData
Converts to this type from the input type.
Source§impl From<Identification> for SensorData
impl From<Identification> for SensorData
Source§fn from(value: Identification) -> SensorData
fn from(value: Identification) -> SensorData
Converts to this type from the input type.
Source§impl From<LinearRangeInfo> for SensorData
impl From<LinearRangeInfo> for SensorData
Source§fn from(value: LinearRangeInfo) -> SensorData
fn from(value: LinearRangeInfo) -> SensorData
Converts to this type from the input type.
Source§impl From<MagnetometerI16> for SensorData
impl From<MagnetometerI16> for SensorData
Source§fn from(value: MagnetometerI16) -> SensorData
fn from(value: MagnetometerI16) -> SensorData
Converts to this type from the input type.
Source§impl From<OrientationQuaternionF32> for SensorData
impl From<OrientationQuaternionF32> for SensorData
Source§fn from(value: OrientationQuaternionF32) -> SensorData
fn from(value: OrientationQuaternionF32) -> SensorData
Converts to this type from the input type.
Source§impl From<SystemClockFrequency> for SensorData
impl From<SystemClockFrequency> for SensorData
Source§fn from(value: SystemClockFrequency) -> SensorData
fn from(value: SystemClockFrequency) -> SensorData
Converts to this type from the input type.
Source§impl From<TemperatureI16> for SensorData
impl From<TemperatureI16> for SensorData
Source§fn from(value: TemperatureI16) -> SensorData
fn from(value: TemperatureI16) -> SensorData
Converts to this type from the input type.
Source§impl PartialEq for SensorData
impl PartialEq for SensorData
Source§impl PartialOrd for SensorData
impl PartialOrd for SensorData
Source§impl RuntimeTypeInformation for SensorData
impl RuntimeTypeInformation for SensorData
Source§fn sensor_type_id(&self) -> u8
fn sensor_type_id(&self) -> u8
Returns the sensor type ID.
Source§fn value_type(&self) -> ValueType
fn value_type(&self) -> ValueType
Returns the field value type.
Source§fn num_components(&self) -> u8
fn num_components(&self) -> u8
The number of components
Source§impl TryFrom<SensorData> for AccelerometerI16
impl TryFrom<SensorData> for AccelerometerI16
Source§impl TryFrom<SensorData> for EulerAnglesF32
impl TryFrom<SensorData> for EulerAnglesF32
Source§impl TryFrom<SensorData> for GyroscopeI16
impl TryFrom<SensorData> for GyroscopeI16
Source§impl TryFrom<SensorData> for HeadingI16
impl TryFrom<SensorData> for HeadingI16
Source§impl TryFrom<SensorData> for Identification
impl TryFrom<SensorData> for Identification
Source§impl TryFrom<SensorData> for LinearRangeInfo
impl TryFrom<SensorData> for LinearRangeInfo
Source§impl TryFrom<SensorData> for MagnetometerI16
impl TryFrom<SensorData> for MagnetometerI16
Source§impl TryFrom<SensorData> for OrientationQuaternionF32
impl TryFrom<SensorData> for OrientationQuaternionF32
Source§impl TryFrom<SensorData> for SystemClockFrequency
impl TryFrom<SensorData> for SystemClockFrequency
Source§impl TryFrom<SensorData> for TemperatureI16
impl TryFrom<SensorData> for TemperatureI16
impl StructuralPartialEq for SensorData
Auto Trait Implementations§
impl Freeze for SensorData
impl RefUnwindSafe for SensorData
impl Send for SensorData
impl Sync for SensorData
impl Unpin for SensorData
impl UnwindSafe for SensorData
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more