mraa  2.0.0
Low Level Skeleton Library for Communication on GNU/Linux platforms
Data Structures | Functions | Typedefs
initio.h File Reference

API Description

initio allows for string initialization of mraa resources.

Go to the source code of this file.

Data Structures

struct  _mraa_io_descriptor
 

Functions

mraa_result_t mraa_io_init (const char *strdesc, mraa_io_descriptor **desc)
 
mraa_result_t mraa_io_close (mraa_io_descriptor *desc)
 

Typedefs

typedef struct _mraa_io_descriptor mraa_io_descriptor
 

Function Documentation

mraa_result_t mraa_io_init ( const char *  strdesc,
mraa_io_descriptor **  desc 
)

Initialize a structure of MRAA context elements given a description string.

Parameters
strdescof one or more MRAA IO io:io_ndx[:option_0:option_1:option_2:option_n][,io:io_ndx]

AIO AIO_KEY:aio pin[:num_bits]

examples: a:13 # aio 13 a:13:10 # aio 13, 10 bits

GPIO GPIO_KEY:gpio pin[:dir:value:mode:edge:input:driver]

examples: g:13:input # gpio 13, input g:13:0:output # gpio 13, value 0, output

I2C I2C_KEY:i2c bus[:address:mode]

examples: i:1:std # i2c bus 1, STD speed (100 KHz) i:1:16 # i2c bus 1, address 16 i:0x1:0x10 # i2c bus 1, address 16

IIO IIO_KEY:iio device

examples: ii:1 # iio device 1 ii:0x1 # iio device 1

PWM PWM_KEY:pwm pin

examples: p:1 # pwm pin 1 p:0x1 # pwm pin 1

SPI SPI_KEY:spi bus[:mode:frequency]

examples: s:1 # spi bus 1 s:0x1:mode2:400000 # spi bus 1, mode2 (CPOL = 1, CPHA = 0), 400 KHz

UART UART_KEY:uart ndx[:baud:mode]

examples: u:1 # uart bus 1 u:0x1:9600:8N1 # uart bus 1, 9600 baud, 8 bit byte, no parity, 1 stop bit

UART_OW UART_OW_KEY:uart_ow ndx

examples: ow:1 # uart_ow bus 1 ow:0x1 # uart_ow bus 1

Parameters
descPointer to structure containing number/pointer collections for initialized IO.
Returns
Result of operation
mraa_result_t mraa_io_close ( mraa_io_descriptor desc)

Free and close resources used by mraa_io_descriptor structure.

Parameters
descmraa_io_descriptor structure
Returns
Result of operation
Include dependency graph for initio.h: