Private
Public Access
2
0

grovepi: grovepi subplatform support via i2c

Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
Mihai Tudor Panu
2017-09-11 07:49:57 -07:00
committed by Brendan Le Foll
parent c6b1b18a9d
commit cc55ee6314
11 changed files with 454 additions and 16 deletions

View File

@@ -360,11 +360,11 @@ int mraa_get_sub_platform_index(int pin_or_bus_id);
* Add mraa subplatform
*
* @param subplatformtype subplatform type
* @param uart_dev uart device subplatform is on
* @param dev uart device or i2c bus subplatform is on
*
* @return mraa_result_t indicating success
*/
mraa_result_t mraa_add_subplatform(mraa_platform_t subplatformtype, const char* uart_dev);
mraa_result_t mraa_add_subplatform(mraa_platform_t subplatformtype, const char* dev);
/**
* Remove a mraa subplatform

View File

@@ -412,14 +412,14 @@ getDefaultI2cBus(int platform_offset=MRAA_MAIN_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")
* (e.g. MRAA_GENERIC_FIRMATA or MRAA_GROVEPI)
* @param dev subplatform uart device string or i2c bus number (e.g. "/dev/ttyACM0" or "0")
* @return Result of operation
*/
inline Result
addSubplatform(Platform subplatformtype, std::string uart_dev)
addSubplatform(Platform subplatformtype, std::string dev)
{
return (Result) mraa_add_subplatform((mraa_platform_t) subplatformtype, uart_dev.c_str());
return (Result) mraa_add_subplatform((mraa_platform_t) subplatformtype, dev.c_str());
}
/**

View File

@@ -62,14 +62,14 @@ typedef enum {
MRAA_FTDI_FT4222 = 256, /**< FTDI FT4222 USB to i2c bridge */
// contains bit 9 so is subplatform
MRAA_GROVEPI = 1024, /**< GrovePi shield i2c bridge */
MRAA_GENERIC_FIRMATA = 1280, /**< Firmata uart platform/bridge */
MRAA_ANDROID_PERIPHERALMANAGER = 95, /**< Android Things peripheral manager platform */
MRAA_MOCK_PLATFORM = 96, /**< Mock platform, which requires no real hardware */
MRAA_JSON_PLATFORM = 97, /**< User initialised platform from json*/
MRAA_JSON_PLATFORM = 97, /**< User initialised platform from json */
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 */
MRAA_UNKNOWN_PLATFORM = 99 /**< An unknown platform type, typically will load INTEL_GALILEO_GEN1 */
} mraa_platform_t;
/**

View File

@@ -58,12 +58,12 @@ typedef enum {
FTDI_FT4222 = 256, /**< FTDI FT4222 USB to i2c bridge */
GROVEPI = 1024, /**< GrovePi shield i2c bridge */
GENERIC_FIRMATA = 1280, /**< Firmata uart platform/bridge */
ANDROID_PERIPHERALMANAGER = 95, /**< Android Things peripheral manager platform */
NULL_PLATFORM = 98,
UNKNOWN_PLATFORM =
99 /**< An unknown platform type, typically will load INTEL_GALILEO_GEN1 */
UNKNOWN_PLATFORM = 99 /**< An unknown platform type, typically will load INTEL_GALILEO_GEN1 */
} Platform;
/**