-
Paul Sokolovsky authored
Class designator will be used as is in indexes, so must match actual class name.
Paul Sokolovsky authoredClass designator will be used as is in indexes, so must match actual class name.
class I2C -- a two-wire serial protocol
I2C is a two-wire protocol for communicating between devices. At the physical level it consists of 2 wires: SCL and SDA, the clock and data lines respectively.
I2C objects are created attached to a specific bus. They can be initialised when created, or initialised later on.
Printing the i2c object gives you information about its configuration.
Constructors
General Methods
Primitive I2C operations
The following methods implement the primitive I2C master bus operations and can be combined to make any I2C transaction. They are provided if you need more control over the bus, otherwise the standard methods (see below) can be used.
Standard bus operations
The following methods implement the standard I2C master read and write operations that target a given slave device.
Memory operations
Some I2C devices act as a memory device (or set of registers) that can be read from and written to. In this case there are two addresses associated with an I2C transaction: the slave address and the memory address. The following methods are convenience functions to communicate with such devices.