Roadrunner technical documentation Buy

Manage the GPIO lines using the Microchip Peripheral I/O Python Package

MPIO is a package that provides easy access to various hardware peripherals found on Microchip AT91/SAMA5 processors. The API is clean, consistent, flexible, documented, and well tested to make navigating and exercising even the most complex hardware peripherals a trivial task.

This article explains how to install it on Raspbian distribution on RoadRunner

Installing MPIO

sudo apt update
sudo apt install python-pip
pip install mpio


Set hi PA25 line for 1 sec

import mpio
import time

gpio = mpio.GPIO(25, mpio.GPIO.OUT)

Read PA25 line state

import mpio

gpio = mpio.GPIO(25, mpio.GPIO.IN)
print gpio.get()

Pin name to Kernel GPIO ID conversion table

// 0  ~ 31  PA0 -> PA31
// 32 ~ 63  PB0 -> PB31
// 33 ~ 95  PC0 -> PC31
// 96 ~ 127 PD0 -> PD31

to convert the MCU pin name to Kernen GPIO id use this function:

def pin2id(pinname):

    Return the Kernel ID of any Pin using the MCU name
    or the board name

    if pinname[0:2]=="PA":
    if pinname[0:2]=="PB":
    if pinname[0:2]=="PC":
    if pinname[0:2]=="PD":

    if offset==None:
        return None
        return offset+int(pinname[2:4])

example of use (add pin2id function in the following code):

import mpio
import time

gpio = mpio.GPIO(pin2id("PA25"), mpio.GPIO.OUT)

Prepare RoadRunner for Suspend To Ram

import mpio


then to enter in Suspend To Ram for 5s:

sudo rtcwake -m mem -s 5


Related products

RoadRunner D2

Info Doc Buy

  • CPU Microchip SAMA5D27
  • Cortex A5 @ 500 MHz
  • Very low power consumption:
    396mW in full speed mode
    198mW at Linux prompt
    17mW in standby mode
    10mW in suspend to RAM mode
  • Armhf architecture
  • DDR3L RAM 256 MB
  • QuadSPI 0/16/64/128MB
  • Size: 40x30 mm
  • Plug-in module
  • 200 pins 0.4 mm pitch
  • TFT parallel interface
  • Boot from internal Quad SPI or external uSD/eMMC
  • Linux Kernel 5.15 LTS
  • Debian, Buildroot and Yocto
  • Open source drivers

Info Doc Buy

  • Single Board Computer based on RoadRunner Linux SOM (Included)
  • Classic "Credit Card" form factor
  • Two USB Host 2.0 ports (one configurable as USB client on the USB-C connector)
  • One 10/100 Mbit/s Lan port
  • Two AcmeSensor ports
  • Double placements for 2.54mm pitch 20x2 pinstrips (not soldered) for GPIOS, SPI, I2C, Serial etc ports
  • Credit Card footprint

Info Buy

  • All the circuitries you need to test the RoadRunner SOM
  • USB host, USB device, Ethernet port, MicroSD socket
  • Test points for power consumption measurements
  • All the Roadrunner signals exposed on 2.54mm pitch pins
  • On-board supercap for RTC and backup memory circuit

Home page Roadrunner technical documentation Buy