[][src]Struct bno055::Bno055

pub struct Bno055<I, D> {
    pub mode: BNO055OperationMode,
    // some fields omitted
}

Fields

mode: BNO055OperationMode

Methods

impl<I, D, E> Bno055<I, D> where
    I: WriteRead<Error = E> + Write<Error = E>,
    D: DelayMs<u8>, 
[src]

pub fn new(i2c: I, delay: D) -> Self[src]

Side-effect-free constructor. Nothing will be read or written before init() call.

pub fn with_alternative_address(self) -> Self[src]

Enables use of alternative I2C address BNO055_ALTERNATE_ADDR.

pub fn init(&mut self) -> Result<(), Error<E>>[src]

Initializes the BNO055 device.

Side-effects:

  • Software reset of BNO055
  • Sets BNO055 to CONFIG mode
  • Sets BNO055's power mode to NORMAL
  • Clears SYS_TRIGGER register

pub fn soft_reset(&mut self) -> Result<(), Error<E>>[src]

Resets the BNO055, initializing the register map to default values. More in section 3.2.

pub fn set_mode(&mut self, mode: BNO055OperationMode) -> Result<(), Error<E>>[src]

Sets the operating mode, see BNO055OperationMode. See section 3.3.

pub fn set_power_mode(&mut self, mode: BNO055PowerMode) -> Result<(), Error<E>>[src]

Sets the power mode, see BNO055PowerMode See section 3.2

pub fn power_mode(&mut self) -> Result<BNO055PowerMode, Error<E>>[src]

Returns BNO055's power mode.

pub fn set_external_crystal(&mut self, ext: bool) -> Result<(), Error<E>>[src]

Enables/Disables usage of external 32k crystal.

pub fn set_axis_remap(&mut self, remap: AxisRemap) -> Result<(), Error<E>>[src]

Configures axis remap of the device.

pub fn axis_remap(&mut self) -> Result<AxisRemap, Error<E>>[src]

Returns axis remap of the device.

pub fn set_axis_sign(&mut self, sign: BNO055AxisSign) -> Result<(), Error<E>>[src]

Configures device's axes sign: positive or negative.

pub fn axis_sign(&mut self) -> Result<BNO055AxisSign, Error<E>>[src]

Return device's axes sign.

pub fn get_revision(&mut self) -> Result<BNO055Revision, Error<E>>[src]

Gets the revision of software, bootloader, accelerometer, magnetometer, and gyroscope of the BNO055 device.

pub fn get_system_status(
    &mut self,
    do_selftest: bool
) -> Result<BNO055SystemStatus, Error<E>>
[src]

Returns device's system status.

pub fn quaternion(&mut self) -> Result<Quaternion<f32>, Error<E>>[src]

Gets a quaternion (nalgebra::Quaternion<f32>) reading from the BNO055. Must be in a sensor fusion (IMU) operating mode.

pub fn euler_angles(&mut self) -> Result<Rotation3<f32>, Error<E>>[src]

Get Euler angles representation of heading in degrees. Euler angles is represented as (roll, pitch, yaw/heading).

pub fn get_calibration_status(
    &mut self
) -> Result<BNO055CalibrationStatus, Error<E>>
[src]

Get calibration status

pub fn is_fully_calibrated(&mut self) -> Result<bool, Error<E>>[src]

Checks whether device is fully calibrated or not.

pub fn calibration_profile(&mut self) -> Result<BNO055Calibration, Error<E>>[src]

Reads current calibration profile of the device.

pub fn set_calibration_profile(
    &mut self,
    calib: BNO055Calibration
) -> Result<(), Error<E>>
[src]

Sets current calibration profile.

pub fn id(&mut self) -> Result<u8, Error<E>>[src]

Returns device's factory-programmed and constant chip ID. This ID is device model ID and not a BNO055's unique ID, whic is stored in different register.

pub fn get_mode(&mut self) -> Result<BNO055OperationMode, Error<E>>[src]

Returns device's operation mode.

pub fn is_in_fusion_mode(&mut self) -> Result<bool, Error<E>>[src]

Checks whether the device is in Sensor Fusion mode or not.

pub fn linear_acceleration(&mut self) -> Result<Vector3<f32>, Error<E>>[src]

Returns linear acceleration vector in m/s^2 units. Available only in sensor fusion modes.

pub fn gravity(&mut self) -> Result<Vector3<f32>, Error<E>>[src]

Returns gravity vector in m/s^2 units. Available only in sensor fusion modes.

pub fn accel_data(&mut self) -> Result<Vector3<f32>, Error<E>>[src]

Returns current accelerometer data in m/s^2 units. Available only in modes in which accelerometer is enabled.

pub fn gyro_data(&mut self) -> Result<Vector3<f32>, Error<E>>[src]

Returns current gyroscope data in deg/s units. Available only in modes in which gyroscope is enabled.

pub fn mag_data(&mut self) -> Result<Vector3<f32>, Error<E>>[src]

Returns current magnetometer data in uT units. Available only in modes in which magnetometer is enabled.

pub fn temperature(&mut self) -> Result<i8, Error<E>>[src]

Returns current temperature of the chip (in degrees Celsius).

Auto Trait Implementations

impl<I, D> Send for Bno055<I, D> where
    D: Send,
    I: Send

impl<I, D> Sync for Bno055<I, D> where
    D: Sync,
    I: Sync

Blanket Implementations

impl<T> From for T[src]

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

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

impl<T> Same for T

type Output = T

Should always be Self

impl<SS, SP> SupersetOf for SP where
    SS: SubsetOf<SP>,