One of the major projects I’ve worked on while at the University of Michigan has been HiJack, a peripheral that plugs into the audio port of a mobile phone, harvests energy, and provides a channel of bidirectional digital communication between the phone and a microcontroller.
When I started working on the project, the original implementation was written in a embedded operating system called TinyOS. It’s research-oriented and extremely elegant. Unfortunately it has such a high concept count that ramping up to become productive in it takes a significant amount of time. We’ve wanted to see HiJack reach wide-spread adoption, which means making the code accessible to people who don’t have a few weeks to spare to setup the build environment we use to create applications for it. It has been available from Seeed Studio for quite some time, and I really want to see these things enabling cool new projects.
To that end I’ve taken some time and reimplemented the platform in raw C, while taking the time to clean up the abstractions and make things a little more accessible, easier to modify, and portable. The results of this effort are available on my GitHub here.
Included is an Android application as well that presents a simple RPC interface. This allows you to toggle and read some digital IO pins out of the box. Please notice that I haven’t fully implemented the ADC portion of the code, but it’s all pretty well templated. The Android application has a mirror of the abstractions you’ll find in the C code, which makes it ideal for testing out new interfaces.
Feel free to fork it, make it better, and tailor it to your purposes.