Datasheet
Flyport Wi-Fi and Ethernet Programmer's guide framework 2.3 (rev 1.0) www.openpicus.com
I2C Communication Protocol
I2C is a 2 wire serial communication widely used in embedded electronics to connect devices such as
external memory and more.
Unlike the UART, I2C has a Master-Slave architecture, where the Master starts all the requests of
communication. The baud rate is given by the Master, and the most used values are 100kb/s (low
speed) and 400kb/s (high speed).
I2C bus needs pull-up resistors and dedicated open collector pins.
To use the I2C protocol has s a determined sequence of operations for starting, stopping, write, read
and checking if the data was transmitted ok.
For more information see the link:
http://en.wikipedia.org/wiki/I%C2%B2C
OpenPicus framework offers some functions to easily manage the I2C communication, using Flyport
as a Master. In this way it’s possible to communicate with I2C slave devices and read/write their
register. It’ possible to attach more than one device on the bus, since I2C uses addressing. The only
issue is to check that any device connected on the bus must have a different address.
I2C Basic Functions
Initialize I2C → I2CInit(BYTE speed);
This function initializes the I2C at the specified speed of communication.
Parameters:
speed: it can be HIGH_SPEED (400K) or LOW_SPEED (100K)
Send a Start condition → I2CStart();
This function sends a start sequence on the I2C bus.
Parameters:
none
Send a Restart condition → I2CRestart();
This function resends a start sequence on the I2C bus.
Parameters:
none
Send a Stop condition → I2CStop();
This function sends a stop sequence on the I2C bus.
Parameters:
none
25










