GPIO-Configuration

GPIO Configuration for BananaPi

Below is an example configuration for connecting two radios (SQL and PTT). Of course you can use other pins as well, but then you have to change your configuration.

Radio 1

PTT1 = Pin 19 = MOSI = PI12 = gpio10
SQL1 = Pin 5 = SCL = PB20 = gpio3

Radio 2

PTT2 = Pin 21 = MISO = PI13 = gpio9
SQL2 = Pin 3 = SDA = PB21 = gpio2

Before the GPIO’s mentioned above can be used, they must first be initialized. You can do this by calling /etc/init.d/boot.local for openSUSE or /etc/init.d/rc.local for Debian/Ubuntu:

echo „9“ >/sys/class/gpio/export
echo „out“ >/sys/class/gpio/gpio9/direction
echo „10“ >/sys/class/gpio/export
echo „out“ >/sys/class/gpio/gpio10/direction
echo „3“ >/sys/class/gpio/export
echo „in“ >/sys/class/gpio/gpio3/direction
echo „2“ >/sys/class/gpio/export
echo „in“ >/sys/class/gpio/gpio2/direction

In the case that the level has to be inverted, you can either enter this in the svxlink.conf or also here in the boot.local or rc.local by e.g.

echo „1“ >/sys/class/gpio/gpio2/active_low

Now the configuration can be done within svxlink.conf.

[Rx1]
SQL_DET=GPIO
GPIO_SQL_PIN=gpio3

[Tx1]
PTT_TYPE=GPIO
GPIO_PTT_PIN=gpio9

[Rx2]
SQL_DET=GPIO
GPIO_PTT_PIN=gpio2

[Tx2]
PTT_TYPE=GPIO
GPIO_SQL_PIN=gpio10