Alvar Kusma kirjutas:

> So question remains: How to access SW1 (reset) button state as input pin 
> from user software? I have some doubts, that 4801 manual here doesn't apply.

Allright, some progress.

Reset button in "Soft" mode is connected over LPC903 MCU to CS5536 GPIO 
25. Latch can be controlled via CS5536 GPIO 24.

Following works under linux (cs5535_gpio mask enables only 3 GPIOs in /dev):

modprobe cs5535_gpio.ko major=253 mask=0x03000040
[ -c /dev/led-error ] || mknod /dev/led-error c 253 6
[ -c /dev/btn-reset ] || mknod /dev/btn-reset c 253 25
[ -c /dev/reset-latch ] || mknod /dev/reset-latch c 253 24

# Set up btn-reset GPIO as input
cat /dev/btn-reset | sed -e 's/i/I/g;s/O/o/g' > /dev/btn-reset
# Set up reset-latch as output and to LOW (disable latch)
cat /dev/reset-latch | sed -e 's/I/i/g;s/o/O/g;s/H/L/g' > /dev/reset-latch

Reset button state can be now controlled from userspace by

cat /dev/btn-reset | cut -c 1

Returns 1 if button is down, otherwise 0.

-- 
=<Alvar>=
_______________________________________________
Soekris-tech mailing list
[email protected]
http://lists.soekris.com/mailman/listinfo/soekris-tech

Reply via email to