mraa/platform: add mraa_get_pin_count()
Will return physical pin count. Closes #75 Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
This commit is contained in:
@@ -278,6 +278,13 @@ void mraa_result_print(mraa_result_t result);
|
|||||||
*/
|
*/
|
||||||
mraa_platform_t mraa_get_platform_type();
|
mraa_platform_t mraa_get_platform_type();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get platform pincount, board must be initialised.
|
||||||
|
*
|
||||||
|
* @return uint of physical pin count on the in-use platform
|
||||||
|
*/
|
||||||
|
unsigned int mraa_get_pin_count();
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -127,6 +127,16 @@ inline std::string getPlatformName()
|
|||||||
return ret_val;
|
return ret_val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return count of physical pins on the running platform
|
||||||
|
*
|
||||||
|
* @return uint of physical pins.
|
||||||
|
*/
|
||||||
|
inline unsigned int getPinCount()
|
||||||
|
{
|
||||||
|
return mraa_get_pin_count();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the log level to use from 0-7 where 7 is very verbose. These are the
|
* Sets the log level to use from 0-7 where 7 is very verbose. These are the
|
||||||
* syslog log levels, see syslog(3) for more information on the levels.
|
* syslog log levels, see syslog(3) for more information on the levels.
|
||||||
|
|||||||
@@ -307,3 +307,12 @@ mraa_get_platform_name()
|
|||||||
return "Unknown";
|
return "Unknown";
|
||||||
return plat->platform_name;
|
return plat->platform_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsigned int
|
||||||
|
mraa_get_pin_count()
|
||||||
|
{
|
||||||
|
if (plat == NULL) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return plat->phy_pin_count;
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user