Linux GPIO and I2C IR module interface demo

My IR module was designed for use with an embedded Linux system. I chose the Olimex A10-OLinuXino-LIME as it looked powerful and a good starting point for an Internet Radio project that I wanted to do.

A10-OLinuXino-LIME-1

It is more of a challenge for hobbyists and for experimenters like me than say a Raspberry PiĀ  because the interface pins are small but it packs an awful lot of functionality into a neat package. You will need adapter cables to connect a breadboard. (Olimex do have easier units to work with that have “normal” pins). I’m using it with the 4.3 inch touch screen LCD which will be great as a bedside clock/Internet Radio interface.

While I assemble the components for the project I have been developing some throw away code based on snippets from many internet sources.

The demo C++/C code is glib based and communicates with the IR module using i2c library with gpio interrupt event handling.

I have chosen to use gpio65_pi10 for the interrupt line and I2C communication via /dev/i2c-0. If you try to use my code on another system your choices may be very different.

 

I’m using a Hauppauge remote that was for a now dead TV capture card. By running the demo code in debug mode I was able to see the remote control’s address is 0x1E and it uses the RC5 protocol. So I have configured the IR module using I2C write commands:

When the IR module generates an interrupt, the event handling routine must read the data from the gpio channel otherwise the event will not reset and it will keep firing.

The demo code just dumps all 128 bytes of the module available data. A real application would probably just read the first 6 or so bytes.

The second block above shows that code 65 is generated when the ‘OK’ button is pressed on my remote.

The working code can be found here: irdemo