libmraa is a C/C++ library to interface with the peripherals on LinkIt Smart 7688 development board. libmraa is pre-installed in the system image of the board and supports C++, Python and Node.js bindings.
libmraa is already installed in the system image of the LinkIt Smart 7688 development board, so you don't need to install it again. For a list of libmraa APIs, please refer to here.
The majority of hardware modules such as GPIO, UART, SPI and PWM are represented as objects. These modules are initialized on certain pins that are identified by pin numbers. The pin numbers in the libmraa on the board are identical to the GPIO numbers in the data sheet and in the Linux GPIO subsystem.
The following Python example creates GPIO object on GPIO pin 2:
import mraa pin = mraa.Gpio(2) # Initialize GPIO2 (P10 on LinkIt Smart 7688 board)
This maps to P10 of the LinkIt Smart 7688 development board and it corresponds to the IS2_WS pin in datasheet, as shown below.
|GPIO Number||Datasheet||Silk print on LinkIt Smart 7688|
Refer to the Pin-out diagram of the LinkIt Smart 7688 development board for the mapping between the silk print on the board and the GPIO number. This GPIO number also applies to Linux: /sys/class/gpio/2 which maps to exactly the same P10 pin on the LinkIt Smart 7688 development board.