42 #define LPS22HB_ADDRESS 0x5D 52 virtual int read(
unsigned address,
void *
data,
unsigned count);
53 virtual int write(
unsigned address,
void *data,
unsigned count);
98 if (
sizeof(buf) < (count + 1)) {
103 memcpy(&buf[1], data, count);
105 return transfer(&buf[0], count + 1,
nullptr, 0);
111 uint8_t cmd = address;
112 return transfer(&cmd, 1, (uint8_t *)data, count);
static constexpr uint8_t LPS22HB_ID_WHO_AM_I
device::Device * LPS22HB_I2C_interface(int bus)
virtual int write(unsigned address, void *data, unsigned count)
virtual int read(unsigned address, void *data, unsigned count)
virtual ~LPS22HB_I2C()=default
Fundamental base class for all physical drivers (I2C, SPI).
#define DEVICE_DEBUG(FMT,...)