capsules_extra

Module fxos8700cq

Source
Expand description

SyscallDriver for the FXOS8700CQ accelerometer.

https://www.nxp.com/docs/en/data-sheet/FXOS8700CQ.pdf

The driver provides x, y, and z acceleration data to a callback function. It implements the hil::sensors::NineDof trait.

§Usage


let fxos8700_i2c = static_init!(I2CDevice, I2CDevice::new(i2c_bus, 0x1e));
let fxos8700 = static_init!(
    capsules::fxos8700cq::Fxos8700cq<'static>,
    capsules::fxos8700cq::Fxos8700cq::new(fxos8700_i2c,
                                          &sam4l::gpio::PA[9], // Interrupt pin
                                          &mut capsules::fxos8700cq::BUF));
fxos8700_i2c.set_client(fxos8700);
sam4l::gpio::PA[9].set_client(fxos8700);

Structs§

Constants§

  • Recommended buffer length for this driver.