This is a simple SPI driver for the Bosch BMI088 IMU. It was originally created for the ongoing ModuLog Project.
Features include:
- Support for data readout on both accelerometer and gyro including unit conversion.
- Support for first-in, first-out (FIFO) readout and configuration for both sensors.
- Support for modifying most settings, including modifying builtin low-pass filters.
- Ability to perform builtin self-tests for both sensors.
Missing features include:
- Interrupt configuration support.
- Parsing of interrupt data in FIFO streams.
- I2C support.
- Modify lines 9 & 10 of
Accel.handGyro.hto refelt your GPIO chip select ports/pins.
// Set port and pin for accelerometer here
#define ACCEL_CS_PORT YOUR_PORT_HERE
#define ACCEL_CS_PIN YOUR_PIN_HERE-
Pass your SPI handler struct into
IMU_INIT, if you are using both sensors, or intoACCEL/GYRO_INITif you are just using one. -
Call
IMU_ENABLE_ALLor respective gyro/accel enabling functions (see internals ofIMU_ENABLE_ALLinIMU.c). -
(Optional) perform self-tests.
-
Enjoy!