class PortI2C

The PortI2C class is a special version of class Port implementing the I2C / Two-Wire Interface (TWI) protocol. It allows using any port as I2C bus master. When used for I2C, DIO is used as SDA and AIO as SCL.

Unlike the Wire library for the Arduino, which is a more advanced solution for the hardware I2C lines of an ATmega, the PortI2C class is implemented entirely in software using "bit-banging". Another difference is that PortI2C does not use interrupts and will keep the microcontroller occupied while it is performing I/O transfers.

See also the class DeviceI2C documentation for an example of use.

#include <Ports.h> 
#include <RF12.h> // needed to avoid a linker error :(

class PortI2C;

Public API