On the net4511, the JP3 pin header is the output of the 8-bit GPIO. According to the manual of the net4501 (which is supposedly close enough), JP3 is mapped as follows.
SC520 Pin | Function | Pin | Pin | Function | SC520 Pin |
---|---|---|---|---|---|
— | +3.3V | 1 | 2 | +5V | — |
PIO 5 | GPIO 0 | 3 | 4 | GPIO 1 | PIO 6 |
PIO 7 | GPIO 2 | 5 | 6 | GPIO 3 | PIO 8 |
PIO 21 | GPIO 4 | 7 | 8 | GPIO 5 | PIO 22 |
PIO 11 | GPIO 6 | 9 | 10 | GPIO 7 | PIO 12 |
— | GND | 11 | 12 | GND | — |
— | GND | 13 | 14 | n-c | — |
The error led is connected to PIO 9. GPIO 0 and 4 (PIO 5 and 21) are also available (resp.) from the JP9 header as pins 6 and 5.
OpenBSD supports GPIOs since 3.6. gpioctl
is the command-line tool to manipulate them.
The net4511's GPIO is detected as gpio0
.
gpio0 at elansc0: 32 pins
GPIOs can only be setup in runlevel 0, before entering securemode. This is done by using gpioctl
in /etc/rc.securelevel
. Work in progress, not tested yet.
[...] # # Place local actions here. # /usr/sbin/gpioctl -q gpio0 5 set out jp3pin03 /usr/sbin/gpioctl -q gpio0 6 set out jp3pin04 /usr/sbin/gpioctl -q gpio0 7 set out jp3pin05 /usr/sbin/gpioctl -q gpio0 8 set out jp3pin06 /usr/sbin/gpioctl -q gpio0 21 set out jp3pin07 /usr/sbin/gpioctl -q gpio0 22 set out jp3pin08 /usr/sbin/gpioctl -q gpio0 11 set out jp3pin09 /usr/sbin/gpioctl -q gpio0 12 set out jp3pin10 /usr/sbin/gpioctl -q gpio0 9 set out errled echo -n ' GPIOs' [...]
The outputs can be set to high
or low
, but this doesn't seem to impact
the behaviour of the error LED.
I'm an idiot. GPIOs are bits, and there is no ADC attached to them. No way to get an analog sensor reading from each pin without a more elaborate multiplexing+conversion system.
The next plan is the Arduino Monitoring Platform.