Giter Club home page Giter Club logo

ni2c's Introduction

nI2C

A non-blocking I2C library for Arduino/AVR without limitations!

|___FEATURE_____________________________|__Wire_|__nI2C_|
|                                       |       |       |
| Non-blocking Read & Write.            |  NO   |  YES  |
|                                       |       |       |
| Can Read/Write more than 32 bytes     |  NO   |  YES  |
| with single command.                  |       |       |
|                                       |       |       |
| User configurable timeout.            |  NO   |  YES  |
|                                       |       |       |
| Uses less than 50 bytes of SRAM       |  NO   |  YES  |
| when idle.                            |       |       |
|                                       |       |       |
| Interrupt safe.                       |  NO   |  YES  |
| (can be used in interrupts)           |       |       |
|                                       |       |       |
| Provides support for slave device     |  NO   |  YES  |
| register addresses.                   |       |       |
|                                       |       |       |
| Provides ability to delay between     |  NO   |  YES  |
| writes (required for many EEPROMs)    |       |       |
|                                       |       |       |
| Adjusts slave device communication    |  NO   |  YES  |
| speed automatically.                  |       |       |
|_______________________________________|_______|_______|

Introduction:

As you are probably aware, the default Arduino I2C library named 'Wire' has a few setbacks. Wire lacks the ability to read/write more than 16 bytes at a time. Wire consumes precious SRAM with redundant buffers. Wire was not designed to be interrupt safe. And the biggest problem of all, Wire is a blocking implementation that freezes the main process during I2C transactions.

nI2C is a solution to Wire's problems. With nI2C, you can read and write as many bytes as you like without needing to perform some convoluted reassembly. nI2C is non-blocking I2C access, so there's minimal penalty to the main process. nI2C takes care of all the bothersome intricacies and gives you back your development time! And with all those clock cycles saved, there's even more room to be more amazing!

Description:

This example is aimed at demonstrating some of the more advanced features of nI2C and what really sets it apart from Wire and other libraries out there.

Here are some of the features this example is demonstrating

  • Write 100 bytes with a single command
  • Read 100 bytes and wait until completion
  • Read 100 bytes and allow a callback to signal completion
  • Write with specified delay after completion
  • Interrupt safety
  • User configurable timeout
  • Automatic handling of slave device register address

ni2c's People

Contributors

phoenixxl avatar

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.