Digital outputs

Pigeon computer RB700 has 8 open drain digital outputs. Fig. 1 shows recommended connection of LED (a) and relays (b,c) to open drain outputs. The internal diodes protect the output transistors from transient voltage peaks (b). In the case of long cables to relay, connection with an external diode (c) is recommended.

digital-outputs

Fig. 1. Example digital outputs connections

Table 1. Digital outputs parameters

PARAMETER VALUE
Quantity of outputs 8
Maximum current 500 mA
Maximum voltage 28 V DC

Linux kernel GPIO user space interface

gpiod

Installation of the gpiod tools:

apt install gpiod

Change state of output O1:

gpioset gpiochip2 0=1
gpioset gpiochip2 0=0

Change state of output O8:

gpioset gpiochip2 7=1
gpioset gpiochip2 7=0

Table 2. Digital outputs - gpiod

SIGNAL GPIOD
O1 gpiochip2 0
O2 gpiochip2 1
O3 gpiochip2 2
O4 gpiochip2 3
O5 gpiochip2 4
O6 gpiochip2 5
O7 gpiochip2 6
O8 gpiochip2 7

GPIO Sysfs Interface for Userspace

Sysfs ABI is deprecated. This old sysfs ABI will not be developed (no new features), it will just be maintained.

Change state of output O1:

echo "578" > /sys/class/gpio/export
echo "out" > /sys/class/gpio/gpio578/direction
echo "1" > /sys/class/gpio/gpio578/value
echo "0" > /sys/class/gpio/gpio578/value
echo "578" > /sys/class/gpio/unexport

Table 3. Digital outputs - Sysfs

SIGNAL GPIO SYSFS GPIO SYSFS kernel below 6.6
O1 GPIO578 GPIO488
O2 GPIO579 GPIO489
O3 GPIO580 GPIO490
O4 GPIO581 GPIO491
O5 GPIO582 GPIO492
O6 GPIO583 GPIO493
O7 GPIO584 GPIO494
O8 GPIO585 GPIO495

Links