aaronranard / i2c_base

Base to write blocks that communicate with chips over I2C

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

I2CBase

This base block is to help write blocks that communicate with chips over I2C. It provides functionality so that your blocks work on a variety of platforms.

Properties

  • platform: The Platform used for i2c communication (e.g. RaspberryPi|Edison|FT232H|...)
  • I2C_address: I2C address to communicate with (e.g. '0x40')

Dependencies

Not all dependencies are required for all uses of the block. It matters what Platform you are using.

FT232H

Communicate I2C over USB with a FT232H chip.

  1. This block uses the Adafuit_Python_GPIO package for I2C communication but it requires a special branch that supports python 3.

  2. Also required is the libftdi library for communicating with the FT232H chip. Follow the Adafruit install instructions with two slight modifications.

    1. Replace the step cmake -DCMAKE_INSTALL_PREFIX="/usr/" ../ with cmake -DCMAKE_INSTALL_PREFIX="/usr/" -DPYTHON_EXECUTABLE="/usr/bin/python3.4" ../.
    2. After the cmake ... step and before the make step. Modify the file build/python/ftdi1PYTHON_wrap.c. In line 3161, replace PyUnicode_AsUTF8String with PyUnicode_AsLatin1String. Otherwise the library won't work completely with python3. A bug has reported to the libftdi mailing list.

Commands

None

Input

Any list of signals.

Output

None

About

Base to write blocks that communicate with chips over I2C


Languages

Language:Python 100.0%