Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

proposal to i2c #19

Merged
merged 2 commits into from
Feb 21, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions cores/esp32/esp32-hal-i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,8 @@ i2c_err_t i2cAttachSCL(i2c_t * i2c, int8_t scl)
if(i2c == NULL){
return I2C_ERROR_DEV;
}
pinMode(scl, OUTPUT_OPEN_DRAIN | PULLUP);
digitalWrite(scl, HIGH);
pinMode(scl, OPEN_DRAIN | PULLUP);
pinMatrixOutAttach(scl, I2C_SCL_IDX(i2c->num), false, false);
pinMatrixInAttach(scl, I2C_SCL_IDX(i2c->num), false);
return I2C_ERROR_OK;
Expand All @@ -197,7 +198,8 @@ i2c_err_t i2cAttachSDA(i2c_t * i2c, int8_t sda)
if(i2c == NULL){
return I2C_ERROR_DEV;
}
pinMode(sda, OUTPUT_OPEN_DRAIN | PULLUP);
digitalWrite(sda, HIGH);
pinMode(sda, OPEN_DRAIN | PULLUP);
pinMatrixOutAttach(sda, I2C_SDA_IDX(i2c->num), false, false);
pinMatrixInAttach(sda, I2C_SDA_IDX(i2c->num), false);
return I2C_ERROR_OK;
Expand Down