Outils pour utilisateurs

Outils du site


Panneau latéral

Tips

Divers

Projets

Ham Radio

Machines

Research

Privé

Études

projets:mudrublic:gpio

Using GPIOs for Fun and Profit

Soekris Pinouts

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.

Some of the net4511's GPIOs are accessible on the JP3 header

SC520 Pin Function Pin Pin Function SC520 Pin
+3.3V12+5V
PIO 5GPIO 034GPIO 1PIO 6
PIO 7GPIO 256GPIO 3PIO 8
PIO 21GPIO 478GPIO 5PIO 22
PIO 11GPIO 6910GPIO 7PIO 12
GND1112GND
GND1314n-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 and GPIOs

OpenBSD supports GPIOs since 3.6. gpioctl is the command-line tool to manipulate them.

The net4511's GPIO is detected as gpio0.

dmesg
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. FIXME Work in progress, not tested yet.

/etc/rc.securelevel
[...]
#
# 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.

Sensors

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.

References

projets/mudrublic/gpio.txt · Dernière modification: 2013-11-15 05:06 (modification externe)