2 * Author: Brendan Le Foll <brendan.le.foll@intel.com>
3 * Copyright © 2014 Intel Corporation
5 * Permission is hereby granted, free of charge, to any person obtaining a copy
6 * of this software and associated documentation files (the "Software"), to
7 * deal in the Software without restriction, including without limitation the
8 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
9 * sell copies of the Software, and to permit persons to whom the Software is
10 * furnished to do so, subject to the following conditions:
12 * The above copyright notice and this permission notice shall be included in
13 * all copies or substantial portions of the Software.
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
28 * This file defines the basic shared types for libmraa
29 * this file is different to common.h in that swig takes this as an input
37 * MRAA supported platform types
40 MRAA_INTEL_GALILEO_GEN1 = 0, /**< The Generation 1 Galileo platform (RevD) */
41 MRAA_INTEL_GALILEO_GEN2 = 1, /**< The Generation 2 Galileo platform (RevG/H) */
43 MRAA_UNKNOWN_PLATFORM = 99 /**< An unknown platform type, typically will load INTEL_GALILEO_GEN1 */
50 MRAA_SUCCESS = 0, /**< Expected response */
51 MRAA_ERROR_FEATURE_NOT_IMPLEMENTED = 1, /**< Feature TODO */
52 MRAA_ERROR_FEATURE_NOT_SUPPORTED = 2, /**< Feature not supported by HW */
53 MRAA_ERROR_INVALID_VERBOSITY_LEVEL = 3, /**< Verbosity level wrong */
54 MRAA_ERROR_INVALID_PARAMETER = 4, /**< Parameter invalid */
55 MRAA_ERROR_INVALID_HANDLE = 5, /**< Handle invalid */
56 MRAA_ERROR_NO_RESOURCES = 6, /**< No resource of that type avail */
57 MRAA_ERROR_INVALID_RESOURCE = 7, /**< Resource invalid */
58 MRAA_ERROR_INVALID_QUEUE_TYPE = 8, /**< Queue type incorrect */
59 MRAA_ERROR_NO_DATA_AVAILABLE = 9, /**< No data available */
60 MRAA_ERROR_INVALID_PLATFORM = 10, /**< Platform not recognised */
61 MRAA_ERROR_PLATFORM_NOT_INITIALISED = 11, /**< Board information not initialised */
62 MRAA_ERROR_PLATFORM_ALREADY_INITIALISED = 12, /**< Board is already initialised */
64 MRAA_ERROR_UNSPECIFIED = 99 /**< Unknown Error */
68 * This function attempts to set the mraa process to a given priority and the
69 * scheduler to SCHED_RR. Highest * priority is typically 99 and minimum is 0.
70 * This function * will set to MAX if * priority is > MAX. Function will return
73 * @param priority Value from typically 0 to 99
74 * @return The priority value set
76 int mraa_set_priority(const unsigned int priority);
78 /** Get the version string of mraa autogenerated from git tag
80 * The version returned may not be what is expected however it is a reliable
81 * number associated with the git tag closest to that version at build time
83 * @return version string from version.h
85 const char* mraa_get_version();
88 * Print a textual representation of the mraa_result_t
90 * @param result the result to print
92 void mraa_result_print(mraa_result_t result);
95 * Get platform type, board must be initialised.
97 * @return mraa_platform_t Platform type enum
99 mraa_platform_t mraa_get_platform_type();