Private
Public Access
2
0

maa: add maa_get_platform_type function and move swig common to type.h

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
Brendan Le Foll
2014-06-20 18:00:19 +01:00
parent 5723e356db
commit 475a692638
5 changed files with 117 additions and 85 deletions

View File

@@ -36,7 +36,7 @@
//static maa_pininfo_t* pindata;
static maa_board_t* plat = NULL;
static maa_platform_t platform_type = 99;
static maa_platform_t platform_type = MAA_UNKNOWN_PLATFORM;
const char *
maa_get_version()
@@ -64,8 +64,6 @@ maa_init()
Py_InitializeEx(0);
PyEval_InitThreads();
#endif
platform_type = MAA_UNKNOWN_PLATFORM;
// detect a galileo gen2 board
char *line = NULL;
// let getline allocate memory for *line
@@ -420,3 +418,8 @@ maa_swap_complex_gpio(int pin, int out)
default: return MAA_SUCCESS;
}
}
maa_platform_t maa_get_platform_type()
{
return platform_type;
}

View File

@@ -21,40 +21,20 @@
maa_init();
%}
%rename(getVersion) maa_get_version();
const char * maa_get_version();
%rename(getVersion) maa_get_version;
%rename(setPriority) maa_set_priority;
int maa_set_priority(const unsigned int);
%rename(printError) maa_result_print(maa_result_t error);
void maa_result_print(maa_result_t error);
/**
* MAA return codes
*/
typedef enum {
MAA_SUCCESS = 0, /**< Expected response */
MAA_ERROR_FEATURE_NOT_IMPLEMENTED = 1, /**< Feature TODO */
MAA_ERROR_FEATURE_NOT_SUPPORTED = 2, /**< Feature not supported by HW */
MAA_ERROR_INVALID_VERBOSITY_LEVEL = 3, /**< Verbosity level wrong */
MAA_ERROR_INVALID_PARAMETER = 4, /**< Parameter invalid */
MAA_ERROR_INVALID_HANDLE = 5, /**< Handle invalid */
MAA_ERROR_NO_RESOURCES = 6, /**< No resource of that type avail */
MAA_ERROR_INVALID_RESOURCE = 7, /**< Resource invalid */
MAA_ERROR_INVALID_QUEUE_TYPE = 8, /**< Queue type incorrect */
MAA_ERROR_NO_DATA_AVAILABLE = 9, /**< No data available */
MAA_ERROR_INVALID_PLATFORM = 10, /**< Platform not recognised */
MAA_ERROR_PLATFORM_NOT_INITIALISED = 11, /**< Board information not initialised */
MAA_ERROR_PLATFORM_ALREADY_INITIALISED = 12, /**< Board is already initialised */
MAA_ERROR_UNSPECIFIED = 99 /**< Unknown Error */
} maa_result_t;
%rename(getPlatform) maa_get_platform_type;
%typemap(in) unsigned char* = char*;
%typemap(in) uint8_t* = char*;
%typemap(in) uint8_t = char;
%include "types.h"
#### GPIO ####
%include "gpio.hpp"