Fully featured I2C driver for Hilcrest's BNO080 and FSM300 Inertial Measurement Units.
The BNO080 is a small-form-factor orientation sensor from Hilcrest Labs. It contains an accelerometer, gyroscope, and a magnetometer in the same package, along with a processor to combine their readings into a fused measure of rotation. It orients itself to world space using gravitational down and magnetic north, and seems to generally be fairly good at sticking to these readings. Unlike its cousin the BNO055, the BNO080 can be calibrated once in a known-good environment and then commanded to retain that calibration in the future, so its calibration won't be disturbed simply by having the sensor in a poor magnetic environment. In addition to rotation, the IMU supports several other useful outputs, such as acceleration and magnetic field readings, and a stability detector that measures whether it is being hand-held or set down.
If soldering LGA packages isn't your thing, Hilcrest also offers the BNO080 in a breakout board called the FSM-300. This board has all the passives needed for the sensor to work, and it's even SMD solderable so you can attach it straight to pads on your own circuit board.
The sensor can communicate over I2C, SPI, and UART, but the MBed driver currently only supports I2C.