GithubHelp home page GithubHelp logo

maarten-pennings / i2cbus Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 1.0 9 KB

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

C++ 84.61% C 15.39%
arduino arduino-library i2c i2c-bus i2c-protocol

i2cbus's Introduction

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.