[PD] [gpio] i2c & bi-directionality

Julian Brooks jbeezez at gmail.com
Fri Apr 19 15:38:38 CEST 2013

Hey all,

It seems, and please correct me if I'm wrong on this, that it's currently
impossible to use[gpio] and i2c as [gpio] can only set the gpio pins to
'in' or 'out' (high/low).

You can check this using wiringpi's 'gpio readall' command which gives the
current mode of each pin.

Via [gpio] we can currently set the gpio pin 0 (SDA) to either 'out' (low)
or 'in' (high) but not to ALT0 (high) which is what we need for i2c as the
i2c line is bi-directional.

My understanding is that [gpio] is based on wiringpi so is it
possible/trivial to add i2c support into [gpio] with the magic ALT mode?

I wrote to the author of wiringpi to ask what the ALT0 mode meant (I
actually thought it was ALTO) and got this response:

"Each pin has a number of modes it can be in – Input or output are generic
digital modes – then there are ALTernative modes – up to 6 alternative
modes for each pin – ALT0 through ALT5. For I2C mode the internal plumbing
connects the pins to the I2C drivers – this is ALT0 mode for that
particular pin.

If you want to know more, seatch for the Broadcom ARM Peripherals manual.


Best wishes to all,

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20130419/2f48ca44/attachment.htm>

More information about the Pd-list mailing list