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 | 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 System Packet 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 }
 
enum  Edge { EDGE_NONE = 0, EDGE_BOTH = 1, EDGE_RISING = 2, EDGE_FALLING = 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 ()
 

Detailed Description

namespace

Enumeration Type Documentation

enum Mode

Gpio Output modes

Enumerator
MODE_STRONG 

No interrupt on Gpio

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

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

Function Documentation

std::string mraa::getVersion ( )

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)

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 ( )

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)

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 
)

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 ( )

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 ( )

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: