Page 1 of 1

lib_device_control for i2c on raspberry pi

Posted: Mon Oct 09, 2017 10:55 pm
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?

Re: lib_device_control for i2c on raspberry pi

Posted: Tue Oct 10, 2017 1:27 pm
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.

Re: lib_device_control for i2c on raspberry pi

Posted: Wed Oct 25, 2017 10:56 am
by Ross
infiniteimprobability wrote:The voice software (vocalfusion) is at beta now so is not generally available
Now generally available!