Private
Public Access
2
0

firmata: initial work

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
Brendan Le Foll
2016-03-07 14:49:42 +00:00
parent f2cbe1c68d
commit 78caa990f1
17 changed files with 1586 additions and 34 deletions

View File

@@ -274,7 +274,10 @@ int mraa_get_sub_platform_id(int pin_or_bus_index);
*/
int mraa_get_sub_platform_index(int pin_or_bus_id);
/**
*
*/
mraa_result_t mraa_add_subplatform(mraa_platform_t subplatformtype, const char* uart_dev);
#ifdef __cplusplus
}

View File

@@ -288,4 +288,19 @@ getDefaultI2cBus(int platform_offset=MRAA_MAIN_PLATFORM_OFFSET)
{
return mraa_get_default_i2c_bus(platform_offset);
}
/**
* Add mraa subplatform
*
* @param subplatformtype the type of subplatform to add
* (e.g. MRAA_GENERIC_FIRMATA)
* @param uart_dev subplatform device string (e.g. "/dev/ttyACM0")
* @return Result of operation
*/
inline Result
addSubplatform(Platform subplatformtype, std::string uart_dev)
{
return (Result) mraa_add_subplatform((mraa_platform_t) subplatformtype, uart_dev.c_str());
}
}

View File

@@ -54,6 +54,9 @@ typedef enum {
// USB platform extenders start at 256
MRAA_FTDI_FT4222 = 256, /**< FTDI FT4222 USB to i2c bridge */
// contains bit 9 so is subplatform
MRAA_GENERIC_FIRMATA = 1280, /**< Firmata uart platform/bridge */
MRAA_NULL_PLATFORM = 98, /**< Platform with no capabilities that hosts a sub platform */
MRAA_UNKNOWN_PLATFORM =
99 /**< An unknown platform type, typically will load INTEL_GALILEO_GEN1 */

View File

@@ -47,13 +47,13 @@ typedef enum {
BEAGLEBONE = 6, /**< The different BeagleBone Black Modes B/C */
BANANA = 7, /**< Allwinner A20 based Banana Pi and Banana Pro */
INTEL_NUC5 = 8, /**< The Intel 5th generations Broadwell NUCs */
96BOARDS = 9, /**< Linaro 96boards */
A96BOARDS = 9, /**< Linaro 96boards, A prefix for 'ARM' since not allowed numerical */
INTEL_SOFIA_3GR = 10, /**< The Intel SoFIA 3GR */
INTEL_CHERRYHILLS = 11, /**< The Intel Braswell Cherryhills */
FTDI_FT4222 = 256, /**< FTDI FT4222 USB to i2c bridge */
FIRMATA = 1024, /**< Firmata uart platform/bridge */
GENERIC_FIRMATA = 1280, /**< Firmata uart platform/bridge */
NULL_PLATFORM = 98,
UNKNOWN_PLATFORM =