Linino GPIO configuration

  • To setup the GPIO on the YUN and Yun Mini please follow the following example:
 
 
//SS 
echo 26 > /sys/class/gpio/export;
echo out > /sys/class/gpio/gpio26/direction;
// SS high
echo 1 > /sys/class/gpio/gpio26/value
// SS low
echo 0 > /sys/class/gpio/gpio26/value
// unexport
echo 26 > /sys/class/gpio/unexport
 
 
GPIO # Function
gpio18 Reset 32u4
gpio21 Level shifter SPI
gpio22 Level shifter handshake
gpio23 Level shifter UART
gpio26 Level SPI - SS
gpio27 Level SPI - MOSI
gpio8 Level SPI - MISO
gpio11 Level SPI - SCK
gpio6 AR_GP6
gpio7 AR_GP7

  
Note: 
The gpio 20, 21, 22 are reserved for the correct working of Linino OS system while gpio AR_GP6 and AR_GP7 are gpio MIPS side available from user space. 
For unexport AR_GP6 follow this example:

 
 
//AR_GP6
echo 6 > /sys/class/gpio/export;
echo out > /sys/class/gpio/gpio6/direction;
// AR_GP6 high
echo 1 > /sys/class/gpio/gpio6/value
// AR_GP6 low
echo 0 > /sys/class/gpio/gpio6/value
// unexport
echo 6 > /sys/class/gpio/unexport