[][src]Struct lsm9ds1::mag::MagSettings

pub struct MagSettings {
    pub sample_rate: ODR,
    pub temp_compensation: TempComp,
    pub x_y_performance: OpModeXY,
    pub scale: Scale,
    pub i2c_mode: I2cMode,
    pub system_op: SysOpMode,
    pub low_power: LowPowerMode,
    pub spi_mode: SpiMode,
    pub z_performance: OpModeZ,
}

Magnetometer settings. Use this struct to configure the sensor.

Fields

sample_rate: ODR

Output data rate selection

temp_compensation: TempComp

Temperature compensation

x_y_performance: OpModeXY

X & Y axes op mode selection

scale: Scale

Full-scale configuration

i2c_mode: I2cMode

Enable/Disable I2C interace

system_op: SysOpMode

Operating mode. See page 64.

low_power: LowPowerMode

Low-power mode cofiguration. See page 64.

spi_mode: SpiMode

SPI mode selection

z_performance: OpModeZ

Z-axis operative mode selection

Methods

impl MagSettings[src]

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

Returns u8 to write to CTRL_REG1_M. See page 63.

CTRL_REG1_M: [TEMP_COMP][OM1][OM0][DO2][DO1][DO0][0][ST]

  • TEMP_COMP - Temperature compensation
  • OM[1:0] - X & Y axes op mode selection
    • 00:low-power
    • 01:medium performance
    • 10: high performance
    • 11:ultra-high performance
  • DO[2:0] - Output data rate selection
  • ST - Self-test enable // TODO

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

Returns u8 to write to CTRL_REG2_M. See page 64.

CTRL_REG2_M: [0][FS1][FS0][0][REBOOT][SOFT_RST][0][0]

  • FS[1:0] - Full-scale configuration
  • REBOOT - Reboot memory content (0:normal, 1:reboot) // TODO
  • SOFT_RST - Reset config and user registers (0:default, 1:reset) // TODO

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

Returns u8 to write to CTRL_REG3_M. See page 64.

CTRL_REG3_M: [I2C_DISABLE][0][LP][0][0][SIM][MD1][MD0]

  • I2C_DISABLE - Disable I2C interace (0:enable, 1:disable)
  • LP - Low-power mode cofiguration (1:enable)
  • SIM - SPI mode selection (0:read/write enable, 1:write-only)
  • MD[1:0] - Operating mode
    • 00:continuous conversion
    • 01:single-conversion,
    • 10,11: Power-down

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

Returns u8 to write to CTRL_REG4_M. See page 65.

CTRL_REG4_M: [0][0][0][0][OMZ1][OMZ0][BLE][0]

  • OMZ[1:0] - Z-axis operative mode selection
    • 00:low-power mode
    • 01:medium performance
    • 10:high performance
    • 10:ultra-high performance
  • BLE - Big/little endian data // TODO

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

Returns u8 to write to CTRL_REG5_M. See page 65.

CTRL_REG5_M: [0][BDU][0][0][0][0][0][0]

  • BDU - Block data update for magnetic data // TODO
    • 0:continuous
    • 1:not updated until MSB/LSB are read

Trait Implementations

impl Debug for MagSettings[src]

impl Default for MagSettings[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.