[][src]Trait kernel::hil::sensors::NineDof

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

    fn read_accelerometer(&self) -> ReturnCode { ... }
fn read_magnetometer(&self) -> ReturnCode { ... }
fn read_gyroscope(&self) -> ReturnCode { ... } }

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

fn set_client(&self, client: &'a dyn NineDofClient)

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 main.rs and is set to the virtual_ninedof.rs driver.

Loading content...

Provided methods

fn read_accelerometer(&self) -> ReturnCode

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

fn read_magnetometer(&self) -> ReturnCode

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

fn read_gyroscope(&self) -> ReturnCode

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

Loading content...

Implementors

Loading content...