summaryrefslogtreecommitdiff
path: root/peripheral/libmraa/api/mraa/common.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'peripheral/libmraa/api/mraa/common.hpp')
-rw-r--r--peripheral/libmraa/api/mraa/common.hpp49
1 files changed, 6 insertions, 43 deletions
diff --git a/peripheral/libmraa/api/mraa/common.hpp b/peripheral/libmraa/api/mraa/common.hpp
index 29894d3..26f4a60 100644
--- a/peripheral/libmraa/api/mraa/common.hpp
+++ b/peripheral/libmraa/api/mraa/common.hpp
@@ -46,7 +46,9 @@ namespace mraa
*
* Detects running platform and attempts to use included pinmap, this is run on
* module/library init/load but is handy to rerun to check board initialised
- * correctly. mraa::SUCCESS inidicates correct initialisation.
+ * correctly. MRAA_SUCCESS inidicates correct (first time) initialisation
+ * whilst MRAA_ERROR_PLATFORM_ALREADY_INITIALISED indicates the board is
+ * already initialised correctly
*
* @return Result of operation
*/
@@ -78,7 +80,7 @@ getVersion()
* @return The priority value set
*/
inline int
-setPriority(const int priority)
+setPriority(const unsigned int priority)
{
return mraa_set_priority(priority);
}
@@ -195,7 +197,7 @@ getI2cBusCount()
* @return I2C adapter number in sysfs. Function will return -1 on failure
*/
inline int
-getI2cBusId(int i2c_bus)
+getI2cBusId(unsigned int i2c_bus)
{
return mraa_get_i2c_bus_id(i2c_bus);
}
@@ -258,7 +260,7 @@ isSubPlatformId(int pin_or_bus_id)
*
* @return int sub platform pin or bus number
*/
-inline int
+inline int
getSubPlatformId(int pin_or_bus_index)
{
return mraa_get_sub_platform_id(pin_or_bus_index);
@@ -288,43 +290,4 @@ 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());
-}
-
-inline Result
-removeSubplatform(Platform subplatformtype)
-{
- return (Result) mraa_remove_subplatform((mraa_platform_t) subplatformtype);
-}
-
-/**
- * Create IO using a description in the format:
- * [io]-[pin]
- * [io]-[raw]-[pin]
- * [io]-[raw]-[id]-[pin]
- * [io]-[raw]-[path]
- *
- * @param IO description
- *
- * @return class T initialised using pointer to IO or NULL
- */
-template <class T>
-inline T*
-initIo(std::string desc)
-{
- return new T(mraa_init_io(desc.c_str()));
-}
-
}