lib_device_control for i2c on raspberry pi

New to XMOS and XCore? Get started here.
Post Reply
Mike Cole
Member
Posts: 11
Joined: Tue Oct 03, 2017 1:30 am

lib_device_control for i2c on raspberry pi

Post by Mike Cole »

Hi, on the xmos github, in the examples section for lib_device_control, the example for using an RPi as an i2c host device simply says to "see AN00235". However, as far as i can tell, this application note does not exist. Am I missing something? If in fact it does not yet exist, could someone point me in the right direction for getting started with using this library on a Raspberry Pi?


User avatar
infiniteimprobability
XCore Legend
Posts: 1126
Joined: Thu May 27, 2010 10:08 am
Contact:

Post by infiniteimprobability »

Hi,
apologies - it does reference an un published app note (AN00235). Looking at the git history there wasn't a simple example for raspberry pi published previously. We use lib_device_control extensively in our voice software so the focus was on getting that working. The voice software (vocalfusion) is at beta now so is not generally available. However, I can post a stripped down Makefile which may help you get going..
Archive.zip
(10.61 KiB) Downloaded 189 times
Archive.zip
(10.61 KiB) Downloaded 189 times
This will not necessarily work out of the box but hopefully get you there to port over the example that is provided.

One thing to be aware of however is if you are planning of having the controlled entity not always responsive, then I2C clock stretching will need to be supported. The RPI has a bug (well documented - search for I2C clock stretch bug RPI) which stops that working properly. There is a work-around, which involves using the bit-banged I2S driver. It works well. Let me know if you'd like info on that. You shouldn't need this if the controlled entity is always responsive.
User avatar
Ross
XCore Expert
Posts: 962
Joined: Thu Dec 10, 2009 9:20 pm
Location: Bristol, UK

Post by Ross »

infiniteimprobability wrote:The voice software (vocalfusion) is at beta now so is not generally available
Now generally available!
Post Reply