mraa  0.6.0
Low Level Skeleton Library for Communication on GNU/Linux platforms
 All Data Structures Namespaces Files Functions Typedefs Enumerations Enumerator Pages
Data Structures | Enumerations | Functions
mraa Namespace Reference

Data Structures

class  Aio
 API to Analog IO. More...
 
class  Gpio
 API to General Purpose IO. More...
 
class  I2c
 API to Inter-Integrated Circuit. More...
 
class  Pwm
 API to Pulse Width Modulation. More...
 
class  Spi
 API to Serial Peripheral Interface. More...
 
class  Uart
 API to UART (enabling only) More...
 

Enumerations

enum  Mode { MODE_STRONG = 0, MODE_PULLUP = 1, MODE_PULLDOWN = 2, MODE_HIZ = 3 }
 
enum  Dir { DIR_OUT = 0, DIR_IN = 1, DIR_OUT_HIGH = 2, DIR_OUT_LOW = 3 }
 
enum  Edge { EDGE_NONE = 0, EDGE_BOTH = 1, EDGE_RISING = 2, EDGE_FALLING = 3 }
 
enum  Spi_Mode { SPI_MODE0 = 0, SPI_MODE1 = 1, SPI_MODE2 = 2, SPI_MODE3 = 3 }
 

Functions

std::string getVersion ()
 
int setPriority (const unsigned int priority)
 
mraa_platform_t getPlatformType ()
 
void printError (mraa_result_t result)
 
bool pinModeTest (int pin, mraa_pinmodes_t mode)
 
unsigned int adcRawBits ()
 
unsigned int adcSupportedBits ()
 
std::string getPlatformName ()
 
unsigned int getPinCount ()
 
mraa_result_t setLogLevel (int level)
 

Detailed Description

namespace

Enumeration Type Documentation

enum Mode

Gpio Output modes

Enumerator
MODE_STRONG 

Default. Strong High and Low

MODE_PULLUP 

Interupt on rising & falling

MODE_PULLDOWN 

Interupt on rising only

MODE_HIZ 

Interupt on falling only

enum Dir

Gpio Direction options

Enumerator
DIR_OUT 

Output. A Mode can also be set

DIR_IN 

Input

DIR_OUT_HIGH 

Output. Init High

DIR_OUT_LOW 

Output. Init Low

enum Edge

Gpio Edge types for interupts

Enumerator
EDGE_NONE 

No interrupt on Gpio

EDGE_BOTH 

Interupt on rising & falling

EDGE_RISING 

Interupt on rising only

EDGE_FALLING 

Interupt on falling only

enum Spi_Mode

MRAA SPI Modes

Enumerator
SPI_MODE0 

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

SPI_MODE1 

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

SPI_MODE2 

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

SPI_MODE3 

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

Function Documentation

std::string mraa::getVersion ( )
inline

Get libmraa version.

Returns
libmraa version (e.g. v0.4.0-20-gb408207)

Here is the call graph for this function:

int mraa::setPriority ( const unsigned int  priority)
inline

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.

Parameters
priorityValue from typically 0 to 99
Returns
The priority value set

Here is the call graph for this function:

mraa_platform_t mraa::getPlatformType ( )
inline

Get platform type, board must be initialised.

Returns
mraa_platform_t Platform type enum

Here is the call graph for this function:

void mraa::printError ( mraa_result_t  result)
inline

Print a textual representation of the mraa_result_t

Parameters
resultthe result to print

Here is the call graph for this function:

bool mraa::pinModeTest ( int  pin,
mraa_pinmodes_t  mode 
)
inline

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 call graph for this function:

unsigned int mraa::adcRawBits ( )
inline

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 call graph for this function:

unsigned int mraa::adcSupportedBits ( )
inline

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 call graph for this function:

std::string mraa::getPlatformName ( )
inline

Return Platform Name. Returns NULL if no platform inited.

Returns
platform name

Here is the call graph for this function:

unsigned int mraa::getPinCount ( )
inline

Return count of physical pins on the running platform

Returns
uint of physical pins.

Here is the call graph for this function:

mraa_result_t mraa::setLogLevel ( int  level)
inline

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.

Parameters
level
Returns
Result of operation

Here is the call graph for this function: