There is some demo code in SVN to exploit this:
http://bifferboard.svn.sourceforge.net/viewvc/bifferboard/slack/files/boot/bb_eth_gpio.py
Run the script with the 'connect' argument, then switch on the board -
it should connect to the board, then you can issue various GPIO
commands (example given to switch the red LED on and off).
An alternative is the GPIO-proxy service I wrote a while back, which
is perhaps a more elegant way of doing this, but this works without
flashing a new kernel, rootfs and so on, so is very quick to setup.
Hope you find it useful,
Biff.
I've just tried this with BiffBoot 2.9 on a 2-port BB...
> There is some demo code in SVN to exploit this:
> http://bifferboard.svn.sourceforge.net/viewvc/bifferboard/slack/files/boot/bb_eth_gpio.py
>
> Run the script with the 'connect' argument, then switch on the board -
> it should connect to the board, then you can issue various GPIO
> commands (example given to switch the red LED on and off).
I can confirm that the sequence:
bb_eth_gpio ..... connect
bb_eth_gpio ..... out_low 16
bb_eth_gpio ..... out_high 16
turns the GPIO-LED on and off, but how do I read the button state?
I tried
bb_eth_gpio ..... read 15
but that prints 'OK 0 0 0' regardless of whether the button is pressed or not.
So I tried
bb_eth_gpio ..... in 15
bb_eth_gpio ..... read 15
(clutching at straws here!) but I still get 'OK 0 0 0' no matter if
the button's pressed or released.
And what's the difference between 'out_low' + 'out_high' and 'low' + 'high' ?
Lurch
...and now on BiffBoot2.1 on a 1-port BB...
>> There is some demo code in SVN to exploit this:
>> http://bifferboard.svn.sourceforge.net/viewvc/bifferboard/slack/files/boot/bb_eth_gpio.py
> I can confirm that the sequence:
> bb_eth_gpio ..... connect
> bb_eth_gpio ..... out_low 16
> bb_eth_gpio ..... out_high 16
> turns the GPIO-LED on and off,
This works on BiffBoot 2.1 too
> but how do I read the button state?
And this now works on BiffBoot2.1!!!
On BB2.9 the second number after the OK is always 0 (for 'out_low'
'out_high' and 'read') but on BB2.1 the second number after the OK is
always 1<<(GPIO number) i.e. 65536 for 'out_low 16' and 32768 for
'read 15'.
The 'in 15' isn't necessary, but it seems the *first* read of GPIO15
is always 0, whether or not the button is pressed. The second and
subsequent GPIO15 reads do work correctly though - "OK 0 32768 1" if
the button is released and "OK 0 32768 0" if the button is pressed.
Lurch