Search by Tags

How to use I2C library

 
Applicable for

Article updated at 22 Dec 2017
Compare with Revision




Attention: 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
  • EEPROM
  • 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 Project VS2013 Project VS2015 Project Module compatibility Language Library Version
I2C - - PXA / Tegra C Toradex CE Library (Old)
I2C I2C I2C Tegra /VFxx / iMX6 C Toradex CE Library (New)
I2C - - PXA / Tegra C# Toradex CE Library (Old)
I2C - - VFxx / iMX6 C# Toradex CE Library (New)

Note: 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