40 #include <px4_platform_common/px4_config.h> 51 class AK8963_I2C :
public device::I2C
55 ~AK8963_I2C()
override =
default;
57 int read(
unsigned address,
void *
data,
unsigned count)
override;
58 int write(
unsigned address,
void *
data,
unsigned count)
override;
68 return new AK8963_I2C(bus);
71 AK8963_I2C::AK8963_I2C(
int bus) : I2C(
"AK8963_I2C", nullptr, bus,
AK8963_I2C_ADDR, 400000)
81 if (
sizeof(cmd) < (count + 1)) {
86 cmd[1] = *(uint8_t *)data;
87 return transfer(&cmd[0], count + 1,
nullptr, 0);
94 return transfer(&cmd, 1, (uint8_t *)data, count);
107 if (whoami != expected) {
device::Device * AK8963_I2C_interface(int bus)
static void read(bootloader_app_shared_t *pshared)
Generic device / sensor interface.
static void write(bootloader_app_shared_t *pshared)
#define DRV_MAG_DEVTYPE_MPU9250
Fundamental base class for all physical drivers (I2C, SPI).
Base class for devices connected via I2C.