Private
Public Access
2
0

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:
Yong Li
2015-08-25 15:04:38 +08:00
committed by Brendan Le Foll
parent af533deffe
commit 02399b61f9
3 changed files with 47 additions and 1 deletions

View File

@@ -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);