49 class AK09916_I2C :
public device::I2C
53 ~AK09916_I2C()
override =
default;
55 int read(
unsigned address,
void *
data,
unsigned count)
override;
56 int write(
unsigned address,
void *
data,
unsigned count)
override;
66 return new AK09916_I2C(bus);
69 AK09916_I2C::AK09916_I2C(
int bus) :
80 if (
sizeof(cmd) < (count + 1)) {
85 cmd[1] = *(uint8_t *)data;
86 return transfer(&cmd[0], count + 1,
nullptr, 0);
93 return transfer(&cmd, 1, (uint8_t *)data, count);
106 if (whoami != expected) {
static void read(bootloader_app_shared_t *pshared)
device::Device * AK09916_I2C_interface(int bus)
static void write(bootloader_app_shared_t *pshared)
Fundamental base class for all physical drivers (I2C, SPI).
#define AK09916_DEVICE_ID
#define DRV_DEVTYPE_ICM20948
int read(unsigned address, void *data, unsigned count) override
Base class for devices connected via I2C.