1
0
forked from me/IronOS

Rework _all_ of the I2C

This moves all of the I2C code to IRQ based (not DMA _yet_).
But it does drastically improve reliability, especially of reads.
This commit is contained in:
Ben V. Brown
2020-09-22 21:03:09 +10:00
parent 42f643c40f
commit e38da13306
20 changed files with 978 additions and 1260 deletions

View File

@@ -26,8 +26,8 @@ static const FRToSI2C::I2C_REG i2c_registers[] = { { CTRL_REG2, 0, 0 }, //Nor
{ CTRL_REG1, 0x19, 0 } // ODR=12 Hz, Active mode
};
void MMA8652FC::initalize() {
FRToSI2C::writeRegistersBulk(MMA8652FC_I2C_ADDRESS, i2c_registers, sizeof(i2c_registers) / sizeof(i2c_registers[0]));
bool MMA8652FC::initalize() {
return FRToSI2C::writeRegistersBulk(MMA8652FC_I2C_ADDRESS, i2c_registers, sizeof(i2c_registers) / sizeof(i2c_registers[0]));
}