45 double factor_a{9.81 / 16384}, factor_g{3.14 / 180 / 16.4};
47 void writeReg(uint8_t reg, uint8_t val) {
60 auto view = (int16_t*)rq.
data.buf;
62 .x = view[0] * factor_g,
63 .y = view[1] * factor_g,
64 .z = view[2] * factor_g,
67 .x = view[3] * factor_a,
68 .y = view[4] * factor_a,
69 .z = view[5] * factor_a,
Implementation of the BMI160 6axis Inertial Measurement Unit.
Definition BMI160.h:11
void measure()
start async read-out of sensor data
Definition BMI160.h:33
void callback(const I2C::Request &rq) override
callback.
Definition BMI160.h:58
size_t size
total capacity of buffer
Definition buffer.h:23
generic I2C device wrapper.
Definition i2c.h:21
struct defining an I2C request.
Definition i2c.h:37
Buffer< uint8_t > data
transfer data
Definition i2c.h:39
generic object sink, i.e.
Definition streams.h:15
void trypush(T &&t)
use this if you don't care if it's going to be successful. data gets discarded if sink is full.
Definition streams.h:28