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
Functions | Enumerations
types.h File Reference

API Description

This file defines the basic shared types for libmraa this file is different to common.h in that swig takes this as an input

Go to the source code of this file.

Functions

int mraa_set_priority (const unsigned int priority)
 
const char * mraa_get_version ()
 
void mraa_result_print (mraa_result_t result)
 
mraa_platform_t mraa_get_platform_type ()
 

Enumerations

enum  mraa_platform_t { MRAA_INTEL_GALILEO_GEN1 = 0, MRAA_INTEL_GALILEO_GEN2 = 1, MRAA_UNKNOWN_PLATFORM = 99 }
 
enum  mraa_result_t {
  MRAA_SUCCESS = 0, MRAA_ERROR_FEATURE_NOT_IMPLEMENTED = 1, MRAA_ERROR_FEATURE_NOT_SUPPORTED = 2, MRAA_ERROR_INVALID_VERBOSITY_LEVEL = 3,
  MRAA_ERROR_INVALID_PARAMETER = 4, MRAA_ERROR_INVALID_HANDLE = 5, MRAA_ERROR_NO_RESOURCES = 6, MRAA_ERROR_INVALID_RESOURCE = 7,
  MRAA_ERROR_INVALID_QUEUE_TYPE = 8, MRAA_ERROR_NO_DATA_AVAILABLE = 9, MRAA_ERROR_INVALID_PLATFORM = 10, MRAA_ERROR_PLATFORM_NOT_INITIALISED = 11,
  MRAA_ERROR_PLATFORM_ALREADY_INITIALISED = 12, MRAA_ERROR_UNSPECIFIED = 99
}
 

Function Documentation

int mraa_set_priority ( 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 caller graph for this function:

const char* mraa_get_version ( )

Get the version string of mraa autogenerated from git tag

The version returned may not be what is expected however it is a reliable number associated with the git tag closest to that version at build time

Returns
version string from version.h

Here is the caller graph for this function:

void mraa_result_print ( mraa_result_t  result)

Print a textual representation of the mraa_result_t

Parameters
resultthe result to print

Here is the caller graph for this function:

mraa_platform_t mraa_get_platform_type ( )

Get platform type, board must be initialised.

Returns
mraa_platform_t Platform type enum

Here is the caller graph for this function:

Enumeration Type Documentation

MRAA supported platform types

Enumerator
MRAA_INTEL_GALILEO_GEN1 

The Generation 1 Galileo platform (RevD)

MRAA_INTEL_GALILEO_GEN2 

The Generation 2 Galileo platform (RevG/H)

MRAA_UNKNOWN_PLATFORM 

An unknown platform type, typically will load INTEL_GALILEO_GEN1

MRAA return codes

Enumerator
MRAA_SUCCESS 

Expected response

MRAA_ERROR_FEATURE_NOT_IMPLEMENTED 

Feature TODO

MRAA_ERROR_FEATURE_NOT_SUPPORTED 

Feature not supported by HW

MRAA_ERROR_INVALID_VERBOSITY_LEVEL 

Verbosity level wrong

MRAA_ERROR_INVALID_PARAMETER 

Parameter invalid

MRAA_ERROR_INVALID_HANDLE 

Handle invalid

MRAA_ERROR_NO_RESOURCES 

No resource of that type avail

MRAA_ERROR_INVALID_RESOURCE 

Resource invalid

MRAA_ERROR_INVALID_QUEUE_TYPE 

Queue type incorrect

MRAA_ERROR_NO_DATA_AVAILABLE 

No data available

MRAA_ERROR_INVALID_PLATFORM 

Platform not recognised

MRAA_ERROR_PLATFORM_NOT_INITIALISED 

Board information not initialised

MRAA_ERROR_PLATFORM_ALREADY_INITIALISED 

Board is already initialised

MRAA_ERROR_UNSPECIFIED 

Unknown Error