Skip to main content

How to use I2C library


this is a legacy library and thus not supported by Toradex anymore. We recommend that you use the new libraries for all Toradex modules. Please see the Toradex CE Libraries and Code Samples for up-to-date information.

I2C Library provides easy access to I2C interface on Toradex module.

Use cases:

  • Digital to Analog converter
  • Real Time Clock
  • I/O expander
  • Touch screen LCD
  • Audio codec
  • and many more..

I2C Library

We provide free I2CLib including demo source code.

NOTE: Please use compatible I2C channel if you want to maintain compatibility between different Colibri modules.

Download project

VS2008 ProjectVS2013 ProjectVS2015 ProjectModule compatibilityLanguage
I2C--PXA / TegraC
I2CI2CI2CTegra /VFxx / iMX6C
I2C--PXA / TegraC#
I2C--VFxx / iMX6C#

It is always recommended to update the libraries first before compiling the demo project. Click on this link to get latest libraries.

Demo application showing how to read time and date from the Real Time Clock

This application demonstrates the use of I2C library to read time, day of the week and date from the external Real Time Clock (available on Iris Carrier Board V1.1 , Colibri Evaluation Board V3.1 and Colibri Evaluation Board V3.2).

A schematic diagram of the setup can be seen here.

Demo application to show read and write operations on EEPROM

This demo explains how to use I2C library to perform read and write operations to an EEPROM chip. In this demo EEPROM 24C256 has been interfaced with Iris Carrier Board V1.1A.

The connections can be seen in the following schematic diagram.

NOTE: Pull-up resistors are already available on the Iris carrier board, so pull-up in the schematic of the EEPROM chip are not required, if used, will have no effect on performance.

Output of VC++ Demo

Output of VCSharp Demo

Send Feedback!