pub trait NineDof<'a> {
    fn set_client(&self, client: &'a dyn NineDofClient);

    fn read_accelerometer(&self) -> Result<(), ErrorCode> { ... }
    fn read_magnetometer(&self) -> Result<(), ErrorCode> { ... }
    fn read_gyroscope(&self) -> Result<(), ErrorCode> { ... }
Expand description

A basic interface for a 9-DOF compatible chip.

This trait provides a standard interface for chips that implement some or all of a nine degrees of freedom (accelerometer, magnetometer, gyroscope) sensor. Any interface functions that a chip cannot implement can be ignored by the chip capsule and an error will automatically be returned.

Required Methods

Set the client to be notified when the capsule has data ready or has finished some command. This is likely called in a board’s and is set to the driver.

Provided Methods

Get a single instantaneous reading of the acceleration in the X,Y,Z directions.

Get a single instantaneous reading from the magnetometer in all three directions.

Get a single instantaneous reading from the gyroscope of the rotation around all three axes.