Skip to main content
Help the Python Software Foundation raise $60,000 USD by December 31st!  Building the PSF Q4 Fundraiser

Control GPIO ports on A64-OLinuXino

Project description

Build Status


The package provide methods for controlling GPIO pins via memory access. It’s written for A64-OLinuXino, but it can be used with other boards. In this case proper operation is not guaranteed.


  • When using GPIO make sure that the desired gpio is not used by another periphery.
  • Using this library requires root access.
  • Currently (0.1.0) port L is not supported, because the memory cannot be accessed from userspace.

GPIO methods

The following methods are available:

  • init() - Make initialization of the module. Must be called first.
  • getcfg() - Read current configuration of gpio.
  • setcfg() - Write configuration to gpio.
  • input() - Return current value of gpio.
  • output() - Set output value.
  • pullup() - Set pull-up/pull-down.

The available constants are:

  • HIGH - 1
  • LOW - 0
  • INPUT - 0
  • OUPTUT - 1
  • PULLUP - 1
  • PULLDOWN - 2

The gpio are named two ways:

  • By port name: PH0, PG2, PE10, etc. These can be imported from port module:
>>> from pyA64.gpio import port
>>> dir(port)
  • By connector name and pin number: gpio2p12, gpio3p8, lcdp18, uext1p3 and etc:
>>> from pyA64.gpio import connector
>>> dir(connector)

Generally these constants are just an offset in the memory from the base GPIO address, so they can be assigned to a number type variable.

>>> led = port.PE17
>>> print led


  • pyA64 0.1.0 (21 NOV 2017)

    • Initial release

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pyA64, version 0.1.0
Filename, size File type Python version Upload date Hashes
Filename, size pyA64-0.1.0.tar.gz (7.3 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page