mraa  0.4.5
Low Level Skeleton Library for Communication on GNU/Linux platforms
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
Data Structures | Functions | Typedefs | Enumerations
common.h File Reference
Include dependency graph for common.h:

API Description

This file defines the basic shared values for libmraa

Go to the source code of this file.

Data Structures

struct  mraa_pincapabilities_t
 
struct  mraa_mux_t
 
struct  mraa_pin_cap_complex_t
 
struct  mraa_pin_t
 
struct  mraa_mmap_pin_t
 
struct  mraa_pininfo_t
 
struct  mraa_i2c_bus_t
 
struct  mraa_spi_bus_t
 
struct  mraa_uart_dev_t
 
struct  mraa_board_t
 

Functions

mraa_result_t mraa_init () __attribute__((constructor))
 
void mraa_deinit ()
 
mraa_boolean_t mraa_pin_mode_test (int pin, mraa_pinmodes_t mode)
 
unsigned int mraa_adc_raw_bits ()
 
unsigned int mraa_adc_supported_bits ()
 

Typedefs

typedef unsigned int mraa_boolean_t
 

Enumerations

enum  mraa_pinmodes_t {
  MRAA_PIN_VALID = 0, MRAA_PIN_GPIO = 1, MRAA_PIN_PWM = 2, MRAA_PIN_FAST_GPIO = 3,
  MRAA_PIN_SPI = 4, MRAA_PIN_I2C = 5, MRAA_PIN_AIO = 6, MRAA_PIN_UART = 7
}
 

Function Documentation

mraa_result_t mraa_init ( ) const

Initialise MRAA

Detects running platform and attempts to use included pinmap

Returns
Result of operation
void mraa_deinit ( )

De-Initilise MRAA

This is not a strict requirement but useful to test memory leaks and for people who like super clean code.

mraa_boolean_t mraa_pin_mode_test ( int  pin,
mraa_pinmodes_t  mode 
)

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

Parameters
pinPhysical Pin to be checked.
modethe mode to be tested.
Returns
boolean if the mode is supported, 0=false.

Here is the caller graph for this function:

unsigned int mraa_adc_raw_bits ( )

Check the board's bit size when reading the value

Returns
raw bits being read from kernel module. zero if no ADC

Here is the caller graph for this function:

unsigned int mraa_adc_supported_bits ( )

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

Returns
return actual bit size the adc value should be understood as.

Here is the caller graph for this function:

Typedef Documentation

typedef unsigned int mraa_boolean_t

MRAA boolean type 1 For TRUE

Enumeration Type Documentation

Enum representing different possible modes for a pin.

Enumerator
MRAA_PIN_VALID 

Pin Valid

MRAA_PIN_GPIO 

General Purpose IO

MRAA_PIN_PWM 

Pulse Width Modulation

MRAA_PIN_FAST_GPIO 

Faster GPIO

MRAA_PIN_SPI 

SPI

MRAA_PIN_I2C 

I2C

MRAA_PIN_AIO 

Analog in

MRAA_PIN_UART 

UART