![]() ![]() ![]() In addition to simplifying the user interface compared to Wire, this library also addresses the following shortcomings of some of the other software I2C libraries: The API provides several simple readFrom() and writeTo() methods, while also including low-level signaling functionality to create more complicated communication flows when necessary. This software I2C library was designed so that the I2C device is the object that is instantiated and being acted on by the various methods. ![]() The interface should therefore be modeled with the device as the object instantiated in code, not the hardware interface.From a design standpoint, I would suggest that the actual I2C device is the object that is being acted on.The Wire library abstracts the I2C hardware interface as the object being acted on.The API should provide the hooks necessary to support more complicated communications, but not at the expense of ease-of-use for the most common use cases.The user should not have to string together multiple commands just to perform a simple write to a device register.This implies that simple readFromRegister() and writeToRegister() methods should be a fundamental part of the library API.The vast majority of I2C devices that I have worked with generally have a simple "read from register" or "write to register" interface.I consider the Arduino Wire library needlessly complicated, particularly for beginners, for two key reasons: However, this library provides a much simpler interface than the Wire library, and modifying existing code to use this new library should be relatively straightforward in many cases. You will therefore need to write your own code for sketches that need to use this library. This library is not a drop-in replacement for Wire. It was written without any platform-specific code, and should therefore work on any platform supported by the Arduino or Energia IDEs. This library implements a software I2C controller interface. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |