#[repr(C)]pub struct LinearRanges {
pub target: SensorId,
pub resolution_bits: u16,
pub scale_op: u8,
pub scale: i32,
pub scale_decimals: u8,
pub offset: i32,
pub offset_decimals: u8,
}
Expand description
Value interpretation information for linear value readings with uniform behavior across all axes.
Fields§
§target: SensorId
Which sensor does this identify?
resolution_bits: u16
Number of bits per axis.
A value could be represented using 16 bits, but only have 12 bit range.
scale_op: u8
The type of scale operation. Currently, it always implies a division.
scale: i32
The amount by which to scale the value.
scale_decimals: u8
The number of decimal points in meas_range_max
and meas_range_min
, used
to express fractional numbers. Used to scale the values by 10^range_decimals
.
offset: i32
The amount by which to offset the value.
offset_decimals: u8
The number of decimal points for the offset
.
Implementations§
Trait Implementations§
Source§impl AsMut<LinearRanges> for LinearRangeInfo
impl AsMut<LinearRanges> for LinearRangeInfo
Source§fn as_mut(&mut self) -> &mut LinearRanges
fn as_mut(&mut self) -> &mut LinearRanges
Converts this type into a mutable reference of the (usually inferred) input type.
Source§impl AsRef<LinearRanges> for LinearRangeInfo
impl AsRef<LinearRanges> for LinearRangeInfo
Source§fn as_ref(&self) -> &LinearRanges
fn as_ref(&self) -> &LinearRanges
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl<'__de> BorrowDecode<'__de> for LinearRanges
impl<'__de> BorrowDecode<'__de> for LinearRanges
Source§fn borrow_decode<__D: BorrowDecoder<'__de>>(
decoder: &mut __D,
) -> Result<Self, DecodeError>
fn borrow_decode<__D: BorrowDecoder<'__de>>( decoder: &mut __D, ) -> Result<Self, DecodeError>
Attempt to decode this type with the given BorrowDecode.
Source§impl Clone for LinearRanges
impl Clone for LinearRanges
Source§fn clone(&self) -> LinearRanges
fn clone(&self) -> LinearRanges
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 LinearRanges
impl Debug for LinearRanges
Source§impl Decode for LinearRanges
impl Decode for LinearRanges
Source§impl Default for LinearRanges
impl Default for LinearRanges
Source§fn default() -> LinearRanges
fn default() -> LinearRanges
Returns the “default value” for a type. Read more
Source§impl Encode for LinearRanges
impl Encode for LinearRanges
Source§impl Format for LinearRanges
impl Format for LinearRanges
Source§impl From<LinearRangeInfo> for LinearRanges
impl From<LinearRangeInfo> for LinearRanges
Source§fn from(value: LinearRangeInfo) -> LinearRanges
fn from(value: LinearRangeInfo) -> LinearRanges
Converts to this type from the input type.
Source§impl From<LinearRanges> for LinearRangeInfo
impl From<LinearRanges> for LinearRangeInfo
Source§fn from(value: LinearRanges) -> LinearRangeInfo
fn from(value: LinearRanges) -> LinearRangeInfo
Converts to this type from the input type.
Source§impl Hash for LinearRanges
impl Hash for LinearRanges
Source§impl Ord for LinearRanges
impl Ord for LinearRanges
Source§fn cmp(&self, other: &LinearRanges) -> Ordering
fn cmp(&self, other: &LinearRanges) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for LinearRanges
impl PartialEq for LinearRanges
Source§impl PartialOrd for LinearRanges
impl PartialOrd for LinearRanges
impl Eq for LinearRanges
impl StructuralPartialEq for LinearRanges
Auto Trait Implementations§
impl Freeze for LinearRanges
impl RefUnwindSafe for LinearRanges
impl Send for LinearRanges
impl Sync for LinearRanges
impl Unpin for LinearRanges
impl UnwindSafe for LinearRanges
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