User's Manual

Table Of Contents
AI7688H User Manual
-44-
Copyright@2016 AcSiP
8.2 Basic Concepts of MRAA
Libmraa is a C/C++ library to interface with the peripheral on AI7688H. Libmraa is
pre-installed in the system image of AI7688H and supports C++, Python and Node.js
bindings.
Installing MRAA:
Libmraa is already installed in the system image of AI7688H, so you don't need to install it
again.
Basic Concepts :
The majority of hardware modules such as GPIO, UART, SPI, and PWM are represented as
objects created by mraa's factory function.
These modules are initialized on certain pins that are identified by pin numbers.
The pin numbers in the libmraa on AI7688H are identical to the GPIO number in the data
sheet and in the Linux GPIO subsystem. The following Python example creates GPIO object
on GPIO 2:
This maps to P10 of AI7688H and it’s the IS2_WS pin in data sheet, as shown in table below.
8.3 Using MRAA in Python
To use libmraa in Python, you need to import it. In the below example, libmraa is imported
and the output is the build version of the mraa:
GPIO and Interupts
To control GPIO pins, initialize the pin as GPIO pin and set its mode. The simplest operation
mode is OUTPUT - set the pin to HIGH or LOW to enable and disable external switches or to
form signal patterns.