[][src]Struct lsm9ds1::accel::AccelSettings

pub struct AccelSettings {
    pub enable_x: bool,
    pub enable_y: bool,
    pub enable_z: bool,
    pub sample_rate: ODR,
    pub scale: Scale,
    pub bandwidth_selection: BandwidthSelection,
    pub bandwidth: Bandwidth,
    pub high_res_bandwidth: HighRes,
}

Accelerometer settings. Use this struct to configure the sensor.

Fields

enable_x: bool

X-axis output enabled

enable_y: bool

Y-axis output enabled

enable_z: bool

Z-axis output enabled

sample_rate: ODR

Output data rate & power mode selection

scale: Scale

Full-scale selection

bandwidth_selection: BandwidthSelection

Bandwidth selection

bandwidth: Bandwidth

Anti-aliasing filter bandwidth selection

high_res_bandwidth: HighRes

High resolution mode

Methods

impl AccelSettings[src]

pub fn ctrl_reg5_xl(&self) -> u8[src]

Returns u8 to write to CTRL_REG5_XL (0x1F)

CTRL_REG5_XL: [DEC_1][DEC_0][Zen_XL][Yen_XL][Xen_XL][0][0][0]

  • DEC[0:1] - Decimation of accel data on OUT REG and FIFO.
    • 00: None
    • 01: 2 samples
    • 10: 4 samples
    • 11: 8 samples
  • Zen_XL - Z-axis output enabled
  • Yen_XL - Y-axis output enabled
  • Xen_XL - X-axis output enabled

pub fn ctrl_reg6_xl(&self) -> u8[src]

Returns u8 to write to CTRL_REG6_XL (0x20)

CTRL_REG6_XL: [ODR_XL2][ODR_XL1][ODR_XL0][FS1_XL][FS0_XL][BW_SCAL_ODR][BW_XL1][BW_XL0]

  • ODR_XL[2:0] - Output data rate & power mode selection
  • FS_XL[1:0] - Full-scale selection
  • BW_SCAL_ODR - Bandwidth selection
  • BW_XL[1:0] - Anti-aliasing filter bandwidth selection

pub fn ctrl_reg7_xl(&self) -> u8[src]

Returns u8 to write to CTRL_REG7_XL (0x21)

CTRL_REG7_XL: [HR][DCF1][DCF0][0][0][FDS][0][HPIS1]

  • HR - High resolution mode (0: disable, 1: enable)
  • DCF[1:0] - Digital filter cutoff frequency
  • FDS - Filtered data selection
  • HPIS1 - HPF enabled for interrupt function

Trait Implementations

impl Debug for AccelSettings[src]

impl Default for AccelSettings[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.