[][src]Crate mraa_sys

A crate with bindings generated by bindgen for the Intel mraa library for low-speed IO communication.

Cross compilation

This package uses pkg_config to find the location of mraa headers and libraries, so by setting the appropriate environment variables, it is possible to cross compile this library for other systems.

Example for cross compiling to BeagleBone:

SYSROOT=/path/to/sysroot
export PKG_CONFIG_SYSROOT_DIR="$SYSROOT"
export PKG_CONFIG_LIBDIR="$SYSROOT/usr/lib/arm-linux-gnueabihf/pkgconfig"
export PKG_CONFIG_ALLOW_CROSS=1
export PKG_CONFIG_ALLOW_SYSTEM_LIBS=1
export PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1
cargo build --target=armv7-unknown-linux-gnueabihf

Structs

_aio
_gpio
_i2c
_led
_mraa_uart_ow

for now, we simply use the normal MRAA UART context

_pwm
_spi
_uart
mraa_gpio_event

Gpio event object

Constants

mraa_gpio_dir_t_MRAA_GPIO_IN

< Input

mraa_gpio_dir_t_MRAA_GPIO_OUT

< Output. A Mode can also be set

mraa_gpio_dir_t_MRAA_GPIO_OUT_HIGH

< Output. Init High

mraa_gpio_dir_t_MRAA_GPIO_OUT_LOW

< Output. Init Low

mraa_gpio_edge_t_MRAA_GPIO_EDGE_BOTH

< Interrupt on rising & falling

mraa_gpio_edge_t_MRAA_GPIO_EDGE_FALLING

< Interrupt on falling only

mraa_gpio_edge_t_MRAA_GPIO_EDGE_NONE

< No interrupt on Gpio

mraa_gpio_edge_t_MRAA_GPIO_EDGE_RISING

< Interrupt on rising only

mraa_gpio_input_mode_t_MRAA_GPIO_ACTIVE_HIGH

< Resistive High

mraa_gpio_input_mode_t_MRAA_GPIO_ACTIVE_LOW

< Resistive Low

mraa_gpio_mode_t_MRAA_GPIOD_ACTIVE_LOW
mraa_gpio_mode_t_MRAA_GPIOD_OPEN_DRAIN
mraa_gpio_mode_t_MRAA_GPIOD_OPEN_SOURCE
mraa_gpio_mode_t_MRAA_GPIO_HIZ

< High Z State

mraa_gpio_mode_t_MRAA_GPIO_PULLDOWN

< Resistive Low

mraa_gpio_mode_t_MRAA_GPIO_PULLUP

< Resistive High

mraa_gpio_mode_t_MRAA_GPIO_STRONG

< Default. Strong high and low

mraa_gpio_out_driver_mode_t_MRAA_GPIO_OPEN_DRAIN

< Open Drain Configuration

mraa_gpio_out_driver_mode_t_MRAA_GPIO_PUSH_PULL

< Push Pull Configuration

mraa_i2c_mode_t_MRAA_I2C_STD

< up to 100Khz

mraa_i2c_mode_t_MRAA_I2C_FAST

< up to 400Khz

mraa_i2c_mode_t_MRAA_I2C_HIGH

< up to 3.4Mhz

mraa_intel_edison_miniboard_t_MRAA_INTEL_EDISON_MINIBOARD_J17_1
mraa_intel_edison_miniboard_t_MRAA_INTEL_EDISON_MINIBOARD_J17_5
mraa_intel_edison_miniboard_t_MRAA_INTEL_EDISON_MINIBOARD_J17_7
mraa_intel_edison_miniboard_t_MRAA_INTEL_EDISON_MINIBOARD_J17_8
mraa_intel_edison_miniboard_t_MRAA_INTEL_EDISON_MINIBOARD_J17_9
mraa_intel_edison_miniboard_t_MRAA_INTEL_EDISON_MINIBOARD_J17_10
mraa_intel_edison_miniboard_t_MRAA_INTEL_EDISON_MINIBOARD_J17_11
mraa_intel_edison_miniboard_t_MRAA_INTEL_EDISON_MINIBOARD_J17_12
mraa_intel_edison_miniboard_t_MRAA_INTEL_EDISON_MINIBOARD_J17_14
mraa_intel_edison_miniboard_t_MRAA_INTEL_EDISON_MINIBOARD_J18_1
mraa_intel_edison_miniboard_t_MRAA_INTEL_EDISON_MINIBOARD_J18_2
mraa_intel_edison_miniboard_t_MRAA_INTEL_EDISON_MINIBOARD_J18_6
mraa_intel_edison_miniboard_t_MRAA_INTEL_EDISON_MINIBOARD_J18_7
mraa_intel_edison_miniboard_t_MRAA_INTEL_EDISON_MINIBOARD_J18_8
mraa_intel_edison_miniboard_t_MRAA_INTEL_EDISON_MINIBOARD_J18_10
mraa_intel_edison_miniboard_t_MRAA_INTEL_EDISON_MINIBOARD_J18_11
mraa_intel_edison_miniboard_t_MRAA_INTEL_EDISON_MINIBOARD_J18_12
mraa_intel_edison_miniboard_t_MRAA_INTEL_EDISON_MINIBOARD_J18_13
mraa_intel_edison_miniboard_t_MRAA_INTEL_EDISON_MINIBOARD_J19_4
mraa_intel_edison_miniboard_t_MRAA_INTEL_EDISON_MINIBOARD_J19_5
mraa_intel_edison_miniboard_t_MRAA_INTEL_EDISON_MINIBOARD_J19_6
mraa_intel_edison_miniboard_t_MRAA_INTEL_EDISON_MINIBOARD_J19_8
mraa_intel_edison_miniboard_t_MRAA_INTEL_EDISON_MINIBOARD_J19_9
mraa_intel_edison_miniboard_t_MRAA_INTEL_EDISON_MINIBOARD_J19_10
mraa_intel_edison_miniboard_t_MRAA_INTEL_EDISON_MINIBOARD_J19_11
mraa_intel_edison_miniboard_t_MRAA_INTEL_EDISON_MINIBOARD_J19_12
mraa_intel_edison_miniboard_t_MRAA_INTEL_EDISON_MINIBOARD_J19_13
mraa_intel_edison_miniboard_t_MRAA_INTEL_EDISON_MINIBOARD_J19_14
mraa_intel_edison_miniboard_t_MRAA_INTEL_EDISON_MINIBOARD_J20_3
mraa_intel_edison_miniboard_t_MRAA_INTEL_EDISON_MINIBOARD_J20_4
mraa_intel_edison_miniboard_t_MRAA_INTEL_EDISON_MINIBOARD_J20_5
mraa_intel_edison_miniboard_t_MRAA_INTEL_EDISON_MINIBOARD_J20_6
mraa_intel_edison_miniboard_t_MRAA_INTEL_EDISON_MINIBOARD_J20_7
mraa_intel_edison_miniboard_t_MRAA_INTEL_EDISON_MINIBOARD_J20_8
mraa_intel_edison_miniboard_t_MRAA_INTEL_EDISON_MINIBOARD_J20_9
mraa_intel_edison_miniboard_t_MRAA_INTEL_EDISON_MINIBOARD_J20_10
mraa_intel_edison_miniboard_t_MRAA_INTEL_EDISON_MINIBOARD_J20_11
mraa_intel_edison_miniboard_t_MRAA_INTEL_EDISON_MINIBOARD_J20_12
mraa_intel_edison_miniboard_t_MRAA_INTEL_EDISON_MINIBOARD_J20_13
mraa_intel_edison_miniboard_t_MRAA_INTEL_EDISON_MINIBOARD_J20_14
mraa_intel_edison_t_MRAA_INTEL_EDISON_GP12
mraa_intel_edison_t_MRAA_INTEL_EDISON_GP13
mraa_intel_edison_t_MRAA_INTEL_EDISON_GP14
mraa_intel_edison_t_MRAA_INTEL_EDISON_GP15
mraa_intel_edison_t_MRAA_INTEL_EDISON_GP19
mraa_intel_edison_t_MRAA_INTEL_EDISON_GP20
mraa_intel_edison_t_MRAA_INTEL_EDISON_GP27
mraa_intel_edison_t_MRAA_INTEL_EDISON_GP28
mraa_intel_edison_t_MRAA_INTEL_EDISON_GP40
mraa_intel_edison_t_MRAA_INTEL_EDISON_GP41
mraa_intel_edison_t_MRAA_INTEL_EDISON_GP42
mraa_intel_edison_t_MRAA_INTEL_EDISON_GP43
mraa_intel_edison_t_MRAA_INTEL_EDISON_GP44
mraa_intel_edison_t_MRAA_INTEL_EDISON_GP45
mraa_intel_edison_t_MRAA_INTEL_EDISON_GP46
mraa_intel_edison_t_MRAA_INTEL_EDISON_GP47
mraa_intel_edison_t_MRAA_INTEL_EDISON_GP48
mraa_intel_edison_t_MRAA_INTEL_EDISON_GP49
mraa_intel_edison_t_MRAA_INTEL_EDISON_GP77
mraa_intel_edison_t_MRAA_INTEL_EDISON_GP78
mraa_intel_edison_t_MRAA_INTEL_EDISON_GP79
mraa_intel_edison_t_MRAA_INTEL_EDISON_GP80
mraa_intel_edison_t_MRAA_INTEL_EDISON_GP81
mraa_intel_edison_t_MRAA_INTEL_EDISON_GP82
mraa_intel_edison_t_MRAA_INTEL_EDISON_GP83
mraa_intel_edison_t_MRAA_INTEL_EDISON_GP84
mraa_intel_edison_t_MRAA_INTEL_EDISON_GP109
mraa_intel_edison_t_MRAA_INTEL_EDISON_GP110
mraa_intel_edison_t_MRAA_INTEL_EDISON_GP111
mraa_intel_edison_t_MRAA_INTEL_EDISON_GP114
mraa_intel_edison_t_MRAA_INTEL_EDISON_GP115
mraa_intel_edison_t_MRAA_INTEL_EDISON_GP128
mraa_intel_edison_t_MRAA_INTEL_EDISON_GP129
mraa_intel_edison_t_MRAA_INTEL_EDISON_GP130
mraa_intel_edison_t_MRAA_INTEL_EDISON_GP131
mraa_intel_edison_t_MRAA_INTEL_EDISON_GP134
mraa_intel_edison_t_MRAA_INTEL_EDISON_GP135
mraa_intel_edison_t_MRAA_INTEL_EDISON_GP165
mraa_intel_edison_t_MRAA_INTEL_EDISON_GP182
mraa_intel_edison_t_MRAA_INTEL_EDISON_GP183
mraa_pinmodes_t_MRAA_PIN_AIO

< Analog in

mraa_pinmodes_t_MRAA_PIN_FAST_GPIO

< Faster GPIO

mraa_pinmodes_t_MRAA_PIN_GPIO

< General Purpose IO

mraa_pinmodes_t_MRAA_PIN_I2C

< I2C

mraa_pinmodes_t_MRAA_PIN_PWM

< Pulse Width Modulation

mraa_pinmodes_t_MRAA_PIN_SPI

< SPI

mraa_pinmodes_t_MRAA_PIN_UART

< UART

mraa_pinmodes_t_MRAA_PIN_VALID

< Pin Valid

mraa_platform_t_MRAA_96BOARDS

< Linaro 96boards

mraa_platform_t_MRAA_ANDROID_PERIPHERALMANAGER

< Android Things peripheral manager platform

mraa_platform_t_MRAA_BANANA

< Allwinner A20 based Banana Pi and Banana Pro

mraa_platform_t_MRAA_BEAGLEBONE

< The different BeagleBone Black Modes B/C

mraa_platform_t_MRAA_DE_NANO_SOC

< Terasic DE-Nano-SoC Board

mraa_platform_t_MRAA_FTDI_FT4222

< FTDI FT4222 USB to i2c bridge

mraa_platform_t_MRAA_GENERIC_FIRMATA

< Firmata uart platform/bridge

mraa_platform_t_MRAA_GROVEPI

< GrovePi shield i2c bridge

mraa_platform_t_MRAA_IEI_TANK

< IEI Tank System

mraa_platform_t_MRAA_INTEL_CHERRYHILLS

< The Intel Braswell Cherryhills

mraa_platform_t_MRAA_INTEL_DE3815

< The Intel DE3815 Baytrail NUC

mraa_platform_t_MRAA_INTEL_EDISON_FAB_C

< The Intel Edison (FAB C)

mraa_platform_t_MRAA_INTEL_GALILEO_GEN1

< The Generation 1 Galileo platform (RevD)

mraa_platform_t_MRAA_INTEL_GALILEO_GEN2

< The Generation 2 Galileo platform (RevG/H)

mraa_platform_t_MRAA_INTEL_GT_TUCHUCK
mraa_platform_t_MRAA_INTEL_JOULE_EXPANSION

< The Intel Joule Expansion Board

mraa_platform_t_MRAA_INTEL_MINNOWBOARD_MAX

< The Intel Minnow Board Max

mraa_platform_t_MRAA_INTEL_NUC5

< The Intel 5th generations Broadwell NUCs

mraa_platform_t_MRAA_INTEL_SOFIA_3GR

< The Intel SoFIA 3GR

mraa_platform_t_MRAA_JSON_PLATFORM

< User initialised platform from json

mraa_platform_t_MRAA_MOCK_PLATFORM

< Mock platform, which requires no real hardware

mraa_platform_t_MRAA_MTK_LINKIT

< Mediatek MT7688 based Linkit boards

mraa_platform_t_MRAA_MTK_OMEGA2

< MT7688 based Onion Omega2 board

mraa_platform_t_MRAA_NULL_PLATFORM

< Platform with no capabilities that hosts a sub platform

mraa_platform_t_MRAA_PHYBOARD_WEGA

< The phyBOARD-Wega

mraa_platform_t_MRAA_RASPBERRY_PI

< The different Raspberry PI Models -like A,B,A+,B+

mraa_platform_t_MRAA_ROCKPI4

< Radxa ROCK PI 4 Models A/B

mraa_platform_t_MRAA_UNKNOWN_PLATFORM

< An unknown platform type, typically will load INTEL_GALILEO_GEN1

mraa_platform_t_MRAA_UP

< The UP Board

mraa_platform_t_MRAA_UP2

< The UP^2 Board

mraa_raspberry_wiring_t_MRAA_RASPBERRY_WIRING_PIN0
mraa_raspberry_wiring_t_MRAA_RASPBERRY_WIRING_PIN1
mraa_raspberry_wiring_t_MRAA_RASPBERRY_WIRING_PIN2
mraa_raspberry_wiring_t_MRAA_RASPBERRY_WIRING_PIN3
mraa_raspberry_wiring_t_MRAA_RASPBERRY_WIRING_PIN4
mraa_raspberry_wiring_t_MRAA_RASPBERRY_WIRING_PIN5
mraa_raspberry_wiring_t_MRAA_RASPBERRY_WIRING_PIN6
mraa_raspberry_wiring_t_MRAA_RASPBERRY_WIRING_PIN7
mraa_raspberry_wiring_t_MRAA_RASPBERRY_WIRING_PIN8
mraa_raspberry_wiring_t_MRAA_RASPBERRY_WIRING_PIN9
mraa_raspberry_wiring_t_MRAA_RASPBERRY_WIRING_PIN10
mraa_raspberry_wiring_t_MRAA_RASPBERRY_WIRING_PIN11
mraa_raspberry_wiring_t_MRAA_RASPBERRY_WIRING_PIN12
mraa_raspberry_wiring_t_MRAA_RASPBERRY_WIRING_PIN13
mraa_raspberry_wiring_t_MRAA_RASPBERRY_WIRING_PIN14
mraa_raspberry_wiring_t_MRAA_RASPBERRY_WIRING_PIN15
mraa_raspberry_wiring_t_MRAA_RASPBERRY_WIRING_PIN16
mraa_raspberry_wiring_t_MRAA_RASPBERRY_WIRING_PIN17
mraa_raspberry_wiring_t_MRAA_RASPBERRY_WIRING_PIN18
mraa_raspberry_wiring_t_MRAA_RASPBERRY_WIRING_PIN19
mraa_raspberry_wiring_t_MRAA_RASPBERRY_WIRING_PIN20
mraa_raspberry_wiring_t_MRAA_RASPBERRY_WIRING_PIN21
mraa_raspberry_wiring_t_MRAA_RASPBERRY_WIRING_PIN22
mraa_raspberry_wiring_t_MRAA_RASPBERRY_WIRING_PIN23
mraa_raspberry_wiring_t_MRAA_RASPBERRY_WIRING_PIN24
mraa_raspberry_wiring_t_MRAA_RASPBERRY_WIRING_PIN25
mraa_raspberry_wiring_t_MRAA_RASPBERRY_WIRING_PIN26
mraa_raspberry_wiring_t_MRAA_RASPBERRY_WIRING_PIN27
mraa_raspberry_wiring_t_MRAA_RASPBERRY_WIRING_PIN28
mraa_raspberry_wiring_t_MRAA_RASPBERRY_WIRING_PIN29
mraa_result_t_MRAA_ERROR_FEATURE_NOT_IMPLEMENTED

< Feature TODO

mraa_result_t_MRAA_ERROR_FEATURE_NOT_SUPPORTED

< Feature not supported by HW

mraa_result_t_MRAA_ERROR_INVALID_HANDLE

< Handle invalid

mraa_result_t_MRAA_ERROR_INVALID_PARAMETER

< Parameter invalid

mraa_result_t_MRAA_ERROR_INVALID_PLATFORM

< Platform not recognised

mraa_result_t_MRAA_ERROR_INVALID_QUEUE_TYPE

< Queue type incorrect

mraa_result_t_MRAA_ERROR_INVALID_RESOURCE

< Resource invalid

mraa_result_t_MRAA_ERROR_INVALID_VERBOSITY_LEVEL

< Verbosity level wrong

mraa_result_t_MRAA_ERROR_NO_DATA_AVAILABLE

< No data available

mraa_result_t_MRAA_ERROR_NO_RESOURCES

< No resource of that type avail

mraa_result_t_MRAA_ERROR_PLATFORM_NOT_INITIALISED

< Board information not initialised

mraa_result_t_MRAA_ERROR_UART_OW_DATA_ERROR

< UART OW Data/Bus error detected

mraa_result_t_MRAA_ERROR_UART_OW_NO_DEVICES

< UART OW No devices detected

mraa_result_t_MRAA_ERROR_UART_OW_SHORTED

< UART OW Short Circuit Detected

mraa_result_t_MRAA_ERROR_UNSPECIFIED

< Unknown Error

mraa_result_t_MRAA_SUCCESS

< Expected response

mraa_spi_mode_t_MRAA_SPI_MODE0

< CPOL = 0, CPHA = 0, Clock idle low, data is clocked in on rising edge, output data (change) on falling edge

mraa_spi_mode_t_MRAA_SPI_MODE1

< CPOL = 0, CPHA = 1, Clock idle low, data is clocked in on falling edge, output data (change) on rising edge

mraa_spi_mode_t_MRAA_SPI_MODE2

< CPOL = 1, CPHA = 0, Clock idle low, data is clocked in on falling edge, output data (change) on rising edge

mraa_spi_mode_t_MRAA_SPI_MODE3

< CPOL = 1, CPHA = 1, Clock idle low, data is clocked in on rising, edge output data (change) on falling edge

mraa_uart_ow_rom_cmd_t_MRAA_UART_OW_CMD_MATCH_ROM

< match a specific rom code

mraa_uart_ow_rom_cmd_t_MRAA_UART_OW_CMD_READ_ROM

< read rom, when only one device on bus

mraa_uart_ow_rom_cmd_t_MRAA_UART_OW_CMD_SEARCH_ROM

< search all rom codes

mraa_uart_ow_rom_cmd_t_MRAA_UART_OW_CMD_SEARCH_ROM_ALARM

< search all roms in alarm state

mraa_uart_ow_rom_cmd_t_MRAA_UART_OW_CMD_SKIP_ROM

< skip match/search rom

mraa_uart_parity_t_MRAA_UART_PARITY_EVEN
mraa_uart_parity_t_MRAA_UART_PARITY_MARK
mraa_uart_parity_t_MRAA_UART_PARITY_NONE
mraa_uart_parity_t_MRAA_UART_PARITY_ODD
mraa_uart_parity_t_MRAA_UART_PARITY_SPACE

Functions

mraa_adc_raw_bits

Check the board's bit size when reading the value

mraa_adc_supported_bits

Return value that the raw value should be shifted to. Zero if no ADC

mraa_add_subplatform

Add mraa subplatform

mraa_aio_close

Close the analog input context, this will free the memory for the context

mraa_aio_get_bit

Gets the bit value mraa is shifting the analog read to. @param dev the analog input context

mraa_aio_init

Initialise an Analog input device, connected to the specified pin. Aio pins are always 0 indexed reguardless of their position. Check your board mapping for details. An arduino style layout will have A0 as pin14 but AIO0.

mraa_aio_read

Read the input voltage. By default mraa will shift the raw value up or down to a 10 bit value.

mraa_aio_read_float

Read the input voltage and return it as a normalized float (0.0f-1.0f).

mraa_aio_set_bit

Set the bit value which mraa will shift the raw reading from the ADC to. I.e. 10bits @param dev the analog input context @param bits the bits the return from read should be i.e 10

mraa_deinit

De-Initilise MRAA

mraa_get_aio_count

Get the number of usable analog pins, board must be initialised.

mraa_get_default_i2c_bus

Get default i2c bus, board must be initialised.

mraa_get_gpio_count

Get the number of usable GPIOs, board must be initialised.

mraa_get_i2c_bus_count

Get platform usable I2C bus count, board must be initialised.

mraa_get_i2c_bus_id

Get I2C adapter number in sysfs.

mraa_get_pin_count

Get platform pincount, board must be initialised.

mraa_get_pin_name

Get name of pin, board must be initialised.

mraa_get_platform_adc_raw_bits

Check the specified board's bit size when reading the value

mraa_get_platform_adc_supported_bits

Return value that the raw value should be shifted to. Zero if no ADC

mraa_get_platform_combined_type

Get combined platform type, board must be initialised. The combined type is represented as (sub_platform_type << 8) | main_platform_type

mraa_get_platform_name

Return the Platform's Name, If no platform detected return NULL

mraa_get_platform_pin_count

Get specified platform pincount, board must be initialised.

mraa_get_platform_type

Get platform type, board must be initialised.

mraa_get_platform_version

Return the platform's versioning info, the information given depends per platform and can be NULL. platform_offset has to be given. Do not modify this pointer

mraa_get_pwm_count

Get the number of usable PWM pins, board must be initialised.

mraa_get_spi_bus_count

Get the number of usable SPI buses, board must be initialised.

mraa_get_sub_platform_id

Convert pin or bus index to corresponding sub platform id.

mraa_get_sub_platform_index

Convert pin or bus sub platform id to index.

mraa_get_uart_count

Get the number of usable UARTs, board must be initialised.

mraa_get_version

Get the version string of mraa autogenerated from git tag

mraa_gpio_close

Close the Gpio context

mraa_gpio_dir

Set Gpio(s) direction

mraa_gpio_edge_mode

Set the edge mode on the gpio

mraa_gpio_get_events

Get an array of structures describing triggered events.

mraa_gpio_get_pin

Get a pin number of the gpio, invalid will return -1

mraa_gpio_get_pin_raw

Get a gpio number as used within sysfs, invalid will return -1

mraa_gpio_init

Initialise gpio_context, based on board number

mraa_gpio_init_by_name

Initialise gpio_context, based on gpio line name

mraa_gpio_init_multi

Initialise gpio_context, based on board number, for multiple pins (can be one).

mraa_gpio_init_raw

Initialise gpio context without any mapping to a pin

mraa_gpio_input_mode

Set Gpio input mode

mraa_gpio_isr

Set an interrupt on pin(s).

mraa_gpio_isr_exit

Stop the current interrupt watcher on this Gpio, and set the Gpio edge mode to MRAA_GPIO_EDGE_NONE(only for sysfs interface).

mraa_gpio_lookup

Get GPIO index by pin name, board must be initialised.

mraa_gpio_mode

Set Gpio(s) Output Mode,

mraa_gpio_out_driver_mode

Set Gpio output driver mode. This is not a standard feature, it needs custom implementation for each board

mraa_gpio_owner

Change ownership of the context.

mraa_gpio_read

Read the Gpio value. This can be 0 or 1. A resonse of -1 means that there was a fatal error.

mraa_gpio_read_dir

Read Gpio(s) direction

mraa_gpio_read_multi

Read the Gpio(s) value. The user must provide an integer array with a length equal to the number of pins provided to mraa_gpio_init_multi() function.

mraa_gpio_use_mmaped

Enable using memory mapped io instead of sysfs, chardev based I/O can be considered memorymapped

mraa_gpio_write

Write to the Gpio Value.

mraa_gpio_write_multi

Write to the Gpio(s) Value. The user must provide an integer array with a length equal to the number of pins provided to mraa_gpio_init_multi() function.

mraa_has_sub_platform

Detect presence of sub platform.

mraa_i2c_lookup

Get I2C bus index by bus name, board must be initialised.

mraa_i2c_init

Initialise i2c context, using board defintions

mraa_i2c_init_raw

Initialise i2c context, passing in the i2c bus to use.

mraa_i2c_frequency

Sets the frequency of the i2c context. Most platforms do not support this.

mraa_i2c_read

Simple bulk read from an i2c context

mraa_i2c_read_byte

Simple read for a single byte from the i2c context

mraa_i2c_read_byte_data

Read a single byte from i2c context, from designated register

mraa_i2c_read_word_data

Read a single word from i2c context, from designated register

mraa_i2c_read_bytes_data

Bulk read from i2c context, starting from designated register

mraa_i2c_write

Write length bytes to the bus, the first byte in the array is the command/register to write

mraa_i2c_write_byte

Write a single byte to an i2c context

mraa_i2c_write_byte_data

Write a single byte to an i2c context

mraa_i2c_write_word_data

Write a single word to an i2c context

mraa_i2c_address

Sets the i2c slave address.

mraa_i2c_stop

De-inits an mraa_i2c_context device

mraa_init
mraa_init_io

Create IO using a description in the format: [io]-[pin] [io]-[raw]-[pin] [io]-[raw]-[id]-[pin] [io]-[raw]-[path]

mraa_init_json_platform

Instantiate an unknown board using a json file

mraa_is_sub_platform_id

Check if pin or bus id includes sub platform mask.

mraa_led_clear_trigger

Clear active LED trigger

mraa_led_close

Close LED file descriptors and free the context memory

mraa_led_init

Initialise led_context, based on led index.

mraa_led_init_raw

Initialise led_context, based on led function name. The structure of LED entry in sysfs is "devicename:colour:function" This api expects only one unique LED identifier which would be "function" name most often. For instance, mraa_led_init_raw("user4");

mraa_led_read_brightness

Read LED brightness

mraa_led_read_max_brightness

Read LED maximum brightness

mraa_led_set_brightness

Set LED brightness

mraa_led_set_trigger

Set LED trigger

mraa_pin_mode_test

Checks if a pin is able to use the passed in mode.

mraa_pwm_close

Close and unexport the PWM pin

mraa_pwm_enable

Set the enable status of the PWM pin. None zero will assume on with output being driven. and 0 will disable the output.

mraa_pwm_get_max_period

Get the maximum pwm period in us

mraa_pwm_get_min_period

Get the minimum pwm period in us

mraa_pwm_init

Initialise pwm_context, uses board mapping

mraa_pwm_init_raw

Initialise pwm_context, raw mode

mraa_pwm_lookup

Get PWM index by PWM name, board must be initialised.

mraa_pwm_owner

Change ownership of context

mraa_pwm_period

Set the PWM period as seconds represented in a float

mraa_pwm_period_ms

Set period, milliseconds.

mraa_pwm_period_us

Set period, microseconds

mraa_pwm_pulsewidth

Set pulsewidth, As represnted by seconds in a (float)

mraa_pwm_pulsewidth_ms

Set pulsewidth, milliseconds

mraa_pwm_pulsewidth_us

Set pulsewidth, microseconds

mraa_pwm_read

Read the output duty-cycle percentage, as a float

mraa_pwm_write

Set the output duty-cycle percentage, as a float

mraa_remove_subplatform

Remove a mraa subplatform

mraa_result_print

Print a textual representation of the mraa_result_t

mraa_set_log_level

Sets the log level to use from 0-7 where 7 is very verbose. These are the syslog log levels, see syslog(3) for more information on the levels.

mraa_set_priority

This function attempts to set the mraa process to a given priority and the scheduler to SCHED_RR. Highest * priority is typically 99 and minimum is 0. This function * will set to MAX if * priority is > MAX. Function will return -1 on failure.

mraa_spi_bit_per_word

Set bits per mode on transaction, defaults at 8

mraa_spi_frequency

Set the SPI device operating clock frequency.

mraa_spi_init

Initialise SPI_context, uses board mapping. Sets the muxes

mraa_spi_init_raw

Initialise SPI_context without any board configuration, selects a bus and a mux.

mraa_spi_lookup

Get SPI bus index by bus name, board must be initialised.

mraa_spi_lsbmode

Change the SPI lsb mode

mraa_spi_mode

Set the SPI device mode. see spidev 0-3.

mraa_spi_stop

De-inits an mraa_spi_context device

mraa_spi_transfer_buf

Transfer Buffer of bytes to the SPI device. Both send and recv buffers are passed in

mraa_spi_transfer_buf_word

Transfer Buffer of uint16 to the SPI device. Both send and recv buffers are passed in

mraa_spi_write

Write Single Byte to the SPI device.

mraa_spi_write_buf

Write Buffer of bytes to the SPI device. The pointer return has to be free'd by the caller. It will return a NULL pointer in cases of error.

mraa_spi_write_buf_word

Write Buffer of uint16 to the SPI device. The pointer return has to be free'd by the caller. It will return a NULL pointer in cases of error.

mraa_spi_write_word

Write Two Bytes to the SPI device.

mraa_uart_data_available

Check to see if data is available on the device for reading

mraa_uart_flush

Flush the outbound data. Blocks until complete.

mraa_uart_get_dev_path

Get Char pointer with tty device path within Linux For example. Could point to "/dev/ttyS0"

mraa_uart_init

Initialise uart_context, uses board mapping

mraa_uart_init_raw

Initialise a raw uart_context. No board setup.

mraa_uart_lookup

Get UART index by name, board must be initialised.

mraa_uart_ow_bit

Write a bit to a 1-wire bus and read a bit corresponding to the time slot back. This is possible due to the way we wired the TX and RX together with a diode, forming a loopback.

mraa_uart_ow_command

Send a command byte to a device on the 1-wire bus

mraa_uart_ow_crc8

Perform a Dallas 1-wire compliant CRC8 computation on a buffer

mraa_uart_ow_get_dev_path

Get char pointer with tty device path within Linux For example. Could point to "/dev/ttyS0"

mraa_uart_ow_init

Initialise uart_ow_context, uses UART board mapping

mraa_uart_ow_init_raw

Initialise a raw uart_ow_context. No board setup.

mraa_uart_ow_read_byte

Read a byte from the 1-wire bus

mraa_uart_ow_reset

Send a reset pulse to the 1-wire bus and test for device presence

mraa_uart_ow_rom_search

Begin a rom code search of the 1-wire bus. This function implements the 1-wire search algorithm. See the uart_ow.c example for an idea on how to use this function to identify all devices present on the bus.

mraa_uart_ow_stop

Destroy a mraa_uart_ow_context

mraa_uart_ow_write_byte

Write a byte to a 1-wire bus

mraa_uart_read

Read bytes from the device into a buffer

mraa_uart_sendbreak

Send a break to the device. Blocks until complete.

mraa_uart_set_baudrate

Set the baudrate. Takes an int and will attempt to decide what baudrate is to be used on the UART hardware.

mraa_uart_set_flowcontrol

Set the flowcontrol

mraa_uart_set_mode

Set the transfer mode For example setting the mode to 8N1 would be "mraa_uart_set_mode(dev, 8,MRAA_UART_PARITY_NONE , 1)"

mraa_uart_set_non_blocking

Set the blocking state for write operations

mraa_uart_set_timeout

Set the timeout for read and write operations <= 0 will disable that timeout

mraa_uart_settings

Get the current settings of an UART. This is an unintrusive function. Meaning it intends not to change anything, only read the values without disturbing.

mraa_uart_stop

Destroy a mraa_uart_context

mraa_uart_write

Write bytes in buffer to a device

Type Definitions

__uint8_t
__uint16_t
mraa_aio_context

Opaque pointer definition to the internal struct _aio. This context refers to one single AIO pin on the board.

mraa_boolean_t

MRAA boolean type 1 For TRUE

mraa_gpio_context

Opaque pointer definition to the internal struct _gpio

mraa_gpio_dir_t

Gpio Direction options

mraa_gpio_edge_t

Gpio Edge types for interrupts

mraa_gpio_events_t
mraa_gpio_input_mode_t

Gpio input modes

mraa_gpio_mode_t

Gpio Output modes

mraa_gpio_out_driver_mode_t

Gpio output driver modes

mraa_i2c_mode_t

Enum reprensenting different i2c speeds/modes

mraa_i2c_context

Opaque pointer definition to the internal struct _i2c

mraa_intel_edison_miniboard_t

Intel edison miniboard numbering enum

mraa_intel_edison_t

Intel Edison raw GPIO numbering enum

mraa_led_context

Opaque pointer definition to the internal struct _led

mraa_pinmodes_t

Enum representing different possible modes for a pin.

mraa_platform_t

MRAA supported platform types

mraa_pwm_context

Mraa Pwm Context

mraa_raspberry_wiring_t

Raspberry PI Wiring compatible numbering enum

mraa_result_t

MRAA return codes

mraa_spi_context

Opaque pointer definition to the internal struct _spi

mraa_spi_mode_t

MRAA SPI Modes

mraa_timestamp_t
mraa_uart_context

Mraa Uart Context

mraa_uart_ow_context
mraa_uart_ow_rom_cmd_t

UART One Wire ROM related Command bytes

mraa_uart_parity_t

Enum representing different uart parity states