Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/maarten-pennings/I2Cbus
Arduino library that implements "bus clear" for an I2C bus
https://github.com/maarten-pennings/I2Cbus
arduino arduino-library i2c i2c-bus i2c-protocol
Last synced: 28 days ago
JSON representation
Arduino library that implements "bus clear" for an I2C bus
- Host: GitHub
- URL: https://github.com/maarten-pennings/I2Cbus
- Owner: maarten-pennings
- Created: 2018-08-15T20:48:39.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-01-27T23:23:14.000Z (11 months ago)
- Last Synced: 2024-08-07T18:27:29.480Z (5 months ago)
- Topics: arduino, arduino-library, i2c, i2c-bus, i2c-protocol
- Language: C++
- Size: 8.79 KB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# I2C bus clear
Arduino library library that implements "bus clear" for an I2C bus.Based on the work at http://www.forward.com.au/pfod/ArduinoProgramming/I2C_ClearBus/index.html
## Introduction
In rare occasions, an I2C bus can deadlock.
One such occasion is when a master is reading a byte from a slave,
the slave is pulling the SDA line low, and then the master is reset.
The slave waits for an SCL pulse (from the master), but the master does not send clock pulses,
because it sees the bus busy: SDA is low.To get out of this deadlock, this library implements a bus clear feature.
This is based on the procedure described in the
[NXP I2C manual section 3.1.16 Bus clear](https://www.nxp.com/docs/en/user-guide/UM10204.pdf#page=19).
Note that `I2cbus_clear()` returns a status code: negative for not being able to clear the bus, or positive for success.
Note also that `I2cbus_clear()` must be followed by `Wire.begin()` to assign the Arduino pins from GPIO to I2C.(end of doc)