mraa.c: Add new API to support I2C bus number query
Add two new API to get the usable I2C bus count and related I2C adapter number Signed-off-by: Yong Li <yong.b.li@intel.com> Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
@@ -152,11 +152,26 @@ mraa_platform_t mraa_get_platform_type();
|
||||
*/
|
||||
unsigned int mraa_get_pin_count();
|
||||
|
||||
/**
|
||||
* Get platform usable I2C bus count, board must be initialised.
|
||||
*
|
||||
* @return number f usable I2C bus count on the current platform. Function will
|
||||
* return -1 on failure
|
||||
*/
|
||||
int mraa_get_i2c_bus_count();
|
||||
|
||||
/**
|
||||
* Get I2C adapter number in sysfs.
|
||||
*
|
||||
* @param i2c_bus the logical I2C bus number
|
||||
* @return I2C adapter number in sysfs. Function will return -1 on failure
|
||||
*/
|
||||
int mraa_get_i2c_bus_id(unsigned int i2c_bus);
|
||||
|
||||
/**
|
||||
* Get name of pin, board must be initialised.
|
||||
*
|
||||
* @param pin number
|
||||
*
|
||||
* @return char* of pin name
|
||||
*/
|
||||
char* mraa_get_pin_name(int pin);
|
||||
|
||||
Reference in New Issue
Block a user