lib_device_control for i2c on raspberry pi

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

lib_device_control for i2c on raspberry pi

Postby Mike Cole » Mon Oct 09, 2017 10:55 pm

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 Expert
Posts: 885
Joined: Thu May 27, 2010 10:08 am
Contact:

Postby infiniteimprobability » Tue Oct 10, 2017 1:27 pm

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 20 times
Archive.zip
(10.61 KiB) Downloaded 20 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: 761
Joined: Thu Dec 10, 2009 9:20 pm

Postby Ross » Wed Oct 25, 2017 10:56 am

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


Now generally available!

Return to “Getting started”

Who is online

Users browsing this forum: No registered users and 10 guests