Back to top

I2C Library

Version: 4.0.0rc3 Date: November 03, 2016Download PDF
VersionReleased
5.0.0rc3Dec 06, 2018 download view
4.0.0rc3Nov 03, 2016 download view

I2C Library

A software defined, industry-standard, I2C library that allows you to control an I2C bus via xCORE ports. I2C is a two-wire hardware serial interface, first developed by Philips. The components in the libary are controlled via C using the XMOS multicore extensions (xC) and can either act as I2C master or slave.

The libary is compatible with multiple slave devices existing on the same bus. The I2C master component can be used by multiple tasks within the xCORE device (each addressing the same or different slave devices).

Features

  • I2C master and I2C slave modes.
  • Supports speed up to 400 Kb/s.
  • Clock stretching suppoirt.
  • Synchronous and asynchronous APIs for efficient usage of processing cores.

Typical Resource Usage

This following table shows typical resource usage in some different configurations. Exact resource usage will depend on the particular use of the library by the application.

Configuration

Pins

Ports

Clocks

Ram

Logical cores

Master

2

2 (1-bit)

0

~1.2K

0

Master (single port)

2

1 (multi-bit)

0

~0.9K

0

Master (asynchronous)

2

2 (1-bit)

0

~3.1K

1

Master (asynchronous, combinable)

2

2 (1-bit)

0

~2.9K

≤ 1

Slave

2

2 (1-bit)

0

~1.5K

≤ 1

Software version and dependencies

This document pertains to version 4.0.0 of this library. It is known to work on version 14.2.3 of the xTIMEcomposer tools suite, it may work on other versions.

This library depends on the following other libraries:

  • lib_xassert (>=3.0.0)
  • lib_logging (>=2.1.0)

The following application notes use this library:

  • AN00181 - xCORE-200 explorer accelerometer demo