11 #define I2C1_REG_OFF 0x10161000 12 #define I2C2_REG_OFF 0x10144000 13 #define I2C3_REG_OFF 0x10148000 15 #define I2C_REG_DATA 0 17 #define I2C_REG_CNTEX 2 21 #define I2C_DEV_GYRO 10 24 uint8_t i2cGetDeviceBusId(uint8_t device_id);
25 uint8_t i2cGetDeviceRegAddr(uint8_t device_id);
27 volatile uint8_t* i2cGetDataReg(uint8_t bus_id);
28 volatile uint8_t* i2cGetCntReg(uint8_t bus_id);
30 void i2cWaitBusy(uint8_t bus_id);
31 bool i2cGetResult(uint8_t bus_id);
32 uint8_t i2cGetData(uint8_t bus_id);
33 void i2cStop(uint8_t bus_id, uint8_t arg0);
35 bool i2cSelectDevice(uint8_t bus_id, uint8_t dev_reg);
36 bool i2cSelectRegister(uint8_t bus_id, uint8_t reg);
38 uint8_t i2cReadRegister(uint8_t dev_id, uint8_t reg);
39 bool i2cWriteRegister(uint8_t dev_id, uint8_t reg, uint8_t data);
41 bool i2cReadRegisterBuffer(uint8_t dev_id, uint8_t reg, uint8_t *buffer,
size_t buf_size);
42 bool i2cWriteRegisterBuffer(uint8_t dev_id, uint8_t reg,
const uint8_t *buffer,
size_t buf_size);