Python modules for access to GPIO, I2C and SPI to all OLinuXino boards and SOMs on GitHub


We made modules which work same way on all our OLinuXino and SOM boards. The sources are on GitHub.

You can address the GPIOs in two ways – as connector pins and as processor ports.

connector.gpio1p5  means connector GPIO1 pin number 5, same signal can be addressed with port.PG0

Getting started with A13-OLinuXino blog post on element14



We spotted blog post on element14 about Getting started with A13-OLinuXino

pyA10Lime 0.1.0. Python library for GPIO access


We just uploaded pyA10Lime

>>>import A10Lime as lime

# Initialize module

# Read configuration of GPIO
# or you can use

# You can address GPIO either by pin numeration or port name
# For example PG0 pin on GPIO-1 connector can be accessed with lime.PG0 or lime.PIN1_5

# Set configuration
>>>lime.setcfg(lime.PC3, lime.OUTPUT)
>>>lime.setcfg(lime.PC3, lime.INPUT)

# Set output level
>>>lime.output(lime.PC3, lime.HIGH)
>>>lime.output(lime.PC3, lime.LOW)

# Read input state

# Read detailed info about pin

New Product in stock: A10-OLinuXino-LIME-UEXT adapter


A10-OLinuXino-LIME-UEXT is adapter board with Male connector on 0.05″ which can connect to A10-OLinuXino-LIME GPIOs with  0.05″ step ribbon CABLE-40-40-10CM and allow LIME GPIOs to be used with BREADBOARD-1, or with A13-LCD43TS, A13-LCD7TS or A13-LCD10TS.

For the moment A20-LCD15.6 is not supported as LVDS signals got noisy when pass through A10-OLinuXino-LIME-UEXT but we are looking for solution.

UEXT signals can be used only when connected to GPIO1. On the other connectors UEXT signals will be not present.

New A20 Android 4.2.2 image now supports all A20-OLinuXino-MICRO hardware features


We received A20-SDK2.0 from Allwinner few weeks ago and were working to generate image for A20-OLinuXino but our aim was to add support to all hardware features the board offers. The process was pretty slow as the compilation is very heavy and even small change requires hours of waiting the image generation to complete.

Now we are ready, the only two features left unsupported are the SATA and second SD-MMC card on the bottom but we think that we should give it a break for a while or our heads will explode :)

Two images are uploaded on Wiki: one for 7″LCD and one for 10″LCD, the good news is that the Android 4.2.2 with SDK2.0 now support higher resolution as previous SDK for ICS 4.0.3 had hardcoded 800×600 max resolution which made 10″LCD and HDMI useless.

The image have:

  • LCD and HDMI support at same time
  • Touchscreen support
  • GPIO support – we prepare Android application demo code which show how you can access and use GPIOs under Android
  • I2C1 and I2C2 support – we prepare Android application demo code which show how you can access and use I2C under Android
  • 100Mbit Ethernet
  • USB-Ethernet AX88772
  • USB WiFi RTL8188
  • microSD
  • Audio Out, Audio In
  • USB-OTG device and host with Low/Full/High speed
  • USB HOST upper and bottom with Low/Full/High speed
  • UART6 and UART7 support on UEXT connectors  – we prepare Android application demo code which show how you can access and use UART6,7 under Android
  • Buttons

Python GPIOs module for A20-OLinuXino-MICRO


pyA20 GPIO module is uploaded yesterday to Pypi

The use is same as the Python modules for imx233, A10S, A13 OLinuXino:

#!/usr/bin/env python
import A20_GPIO as GPIO
#init module
#configure module
#read the current GPIO configuration
config = GPIO.getcfg(GPIO.PIN#)
#set GPIO high
#set GPIO low
#read input
state = GPIO.input(GPIO.PIN#)

this is initial release so if you find some bugs please report back to us :)

A10S-OLinuXino ANDROID GPIO control LED toggle app


We got lot of requests on our forum how to control GPIOs from Android.

With the new A10S Android image we decided to play a bit and it appear to be not hard to implement.

We found two ways to do GPIO control running Android.

GPIO using ADB

1. Boot android (from nand or sdcard)

2. Connect USB-to-Serial cable on UART1

3. Open terminal at speed 115200

4. When loading is ready in the terminal type “sh” and enter

5. “ls /sys/class/gpio_sw” will give you a list of all accessable GPIOs.

The GPIOs name is according to the chip ports. For example PE3 is LED1.

6. To set PE3 as output:

#echo 1 > /sys/class/gpio_sw/PE3/mul_sel

or as input

#echo 0 > /sys/class/gpio_sw/PE3/mul_sel

7. To turn on LED:

#echo 1 > /sys/class/gpio_sw/PE3/data

and to turn off:

#echo 0 > /sys/class/gpio_sw/PE3/data

8. If GPIO is as input to read state:

#cat /sys/class/gpio_sw/PE3/data

GPIO using Android SDK

Basicly you should read and write to the filesys. Make sure that your app is running as root, or else nothing will happen.

The demo program toggle LED1 on every button press.  The sources are at GitHub:

All read/write methods are realized in file.

The application is with single button and each time you press it it toggles the green LED on the board.


You can see ToggleLED.apk running at this video:

Previous Older Entries


Get every new post delivered to your Inbox.

Join 675 other followers