xmos / lib_i2c

I²C library
Other
3 stars 25 forks source link

Drive sda in open drain mode #98

Closed shuchitak closed 1 week ago

shuchitak commented 1 month ago

https://github.com/xmos/lib_i2c/issues/89

xross commented 2 weeks ago

@shuchitak is this something that can be merged now?

shuchitak commented 2 weeks ago

@shuchitak is this something that can be merged now?

Hi @Ross, this PR changes SDA to be driven in open drain mode for i2c master, master async and slave. It doesn't change the i2c master single port where both SDA and SCL and on the same port. The fix I've made wouldn't work for single port mode. From what I remember, there was a suggestion to call set_port_pull_up() for the SDA port to configure it to only drive 0 but I didn't get around to testing that.

xross commented 2 weeks ago

Thanks @shuchitak. single port should ready be doing the right thing with

https://github.com/xmos/lib_i2c/blob/1b3e2696610ab44e89de642bb4edf51b936bd1b1/lib_i2c/src/i2c_master_single_port.xc#L226

shuchitak commented 2 weeks ago

Thanks @shuchitak. single port should ready be doing the right thing with

https://github.com/xmos/lib_i2c/blob/1b3e2696610ab44e89de642bb4edf51b936bd1b1/lib_i2c/src/i2c_master_single_port.xc#L226

In that case since the lib_i2c tests are passing I think this can be merged.