Two Wire Interface Controller Register guide

I²C, also called IIC (Inter-Integrated Circuit) or TWI (Two-Wire-Interface) is a multi-master serial bus natively supported by sunxi SoCs. Uses only two bidirectional lines, SDA (serial data) and SCL serial clock.

Controller Overview
This 2-Wire Controller is designed to be used as an interface between CPU host and the serial 2-Wire bus. It can support all the standard 2-Wire transfer, including Slave and Master. The communication to the 2-Wire bus is carried out on a byte-wise basis using interrupt or polled handshaking. This 2-Wire Controller can be operated in standard mode (100Kbps) or fast-mode, supporting data rate up to 400Kbps. Multiple Masters and 10-bit addressing Mode are supported for this specified application. General Call Addressing is also supported in Slave mode.

The 2-Wire Controller includes the following features:
 * Software-programmable for Slave or Master
 * Support Repeated START signal
 * Support Multi-master systems
 * Support 10-bit addressing with 2-Wire bus
 * Performs arbitration and clock synchronization
 * Own address and General Call address detection
 * Interrupt on address detection
 * Supports speeds up to 400Kbits/s ("fast mode")
 * Support operation from a wide range of input clock frequencies