Using 2ic Arduino devices on a Beagle

I bought a couple of 8x8 i2c LED matrices [1,2] from adafruit. There are nice instructions [3] showing how to attach them to an Arduino via it’s i2c interface.

Has anyone written a software wrapper that would allow one to take the adafruit code and run in on a Beagle? I think one could just modify the Wire.cpp code [4] to call the Angstrom drivers like i2cget does rather than the twi code.

–Mark

[1] http://adafruit.com/products/902
[2] http://adafruit.com/products/872
[3] http://learn.adafruit.com/adafruit-led-backpack/
[4] git://github.com/arduino/Arduino.git

Or you can write a proper kernel driver for it.

I bought a couple of 8x8 i2c LED matrices [1,2] from adafruit. There
are nice instructions [3] showing how to attach them to an Arduino via
it's i2c interface.

Has anyone written a software wrapper that would allow one to take the
adafruit code and run in on a Beagle?

I'd say the Arduino-for-Userspace-Linux project [1] would ultimately do
that, but I very much doubt that the functionality is all there. It might
be a reasonable approach to look at the gaps in that project, fill them,
then use the result to solve your LED matrix issue.

I think one could just modify the Wire.cpp code [4] to call the
Angstrom drivers like i2cget does rather than the twi code.

Or you can write a proper kernel driver for it.

I sympathize with the thought that writing kernel drivers is too much of a
pain when these hardware interfaces can often be 90% of your app. Using
i2c-dev from userspace C should be easy enough. Either way, the
documentation at [2] should be enough to understand how to write a kernel
driver, convert the Arduino code into i2c-dev accesses or update
Arduino-for-Userspace-Linux to have an I2C library that allows you to
simply run the Arduino code.

Looking over this, I'm wondering how much anyone might have played with
libsensors on Beagle* and how much it covers some other efforts in flight
to make sensor drivers easily reusable. There are so many ways to skin the
I2C cat that I don't know which one to attack first for Bonescript.

[1] https://github.com/prpplague/Arduino-for-Userspace-Linux
[2] https://i2c.wiki.kernel.org/index.php/Main_Page

I’ve had success in getting one of the LED grids working with the bone. I’m able to control the 8 by 8 red LED display[2]. However, the same code doesn’t work the the bi-color display [1].

My code is called myi2ctest.c and it’s here [3].

I can use i2cdump and see that the registers are being changed on the bi-color LED, but bi-color LEDs don’t light up like the red LEDs do.

–Mark

[1] http://adafruit.com/products/902
[2] http://adafruit.com/products/872
[3] https://github.com/MarkAYoder/BeagleBoard-exercises/tree/master/i2c