Skip to content
Snippets Groups Projects
Select Git revision
  • 7d7243f44c68c5c1bfeba160a1650174c744722f
  • wip-bootstrap default
  • dualcore
  • ch3/leds
  • ch3/time
  • master
6 results

machine.I2C.rst

Blame
  • machine.I2C.rst 6.63 KiB

    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.

    Constants