Skip to content

Arduino library that implements "bus clear" for an I2C bus

Notifications You must be signed in to change notification settings

maarten-pennings/I2Cbus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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. 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)

About

Arduino library that implements "bus clear" for an I2C bus

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published