I2C SDA should properly register the ACK bit from some slaves

This commit is contained in:
me-no-dev 2016-10-10 13:53:55 +03:00
parent cc3c55bbb1
commit f3af437774

View File

@ -26,7 +26,7 @@
void i2cAttachSCL(i2c_t * i2c, int8_t scl) void i2cAttachSCL(i2c_t * i2c, int8_t scl)
{ {
pinMode(scl, INPUT); pinMode(scl, OUTPUT_OPEN_DRAIN);
pinMatrixOutAttach(scl, I2C_SCL_IDX(i2c->num), false, false); pinMatrixOutAttach(scl, I2C_SCL_IDX(i2c->num), false, false);
pinMatrixInAttach(scl, I2C_SCL_IDX(i2c->num), false); pinMatrixInAttach(scl, I2C_SCL_IDX(i2c->num), false);
} }
@ -40,7 +40,7 @@ void i2cDetachSCL(i2c_t * i2c, int8_t scl)
void i2cAttachSDA(i2c_t * i2c, int8_t sda) void i2cAttachSDA(i2c_t * i2c, int8_t sda)
{ {
pinMode(sda, INPUT); pinMode(sda, OUTPUT_OPEN_DRAIN);
pinMatrixOutAttach(sda, I2C_SDA_IDX(i2c->num), false, false); pinMatrixOutAttach(sda, I2C_SDA_IDX(i2c->num), false, false);
pinMatrixInAttach(sda, I2C_SDA_IDX(i2c->num), false); pinMatrixInAttach(sda, I2C_SDA_IDX(i2c->num), false);
} }