mraa: add a function that returns the number of uarts available
Signed-off-by: Tapani Utriainen <tapani@technexion.com> Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
committed by
Brendan Le Foll
parent
04c5593cef
commit
b7e8d96945
@@ -201,6 +201,13 @@ int mraa_get_platform_combined_type();
|
|||||||
*/
|
*/
|
||||||
unsigned int mraa_get_pin_count();
|
unsigned int mraa_get_pin_count();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the number of usable UARTs, board must be initialised.
|
||||||
|
*
|
||||||
|
* @return number of usable UARTs on the platform, returns -1 on failure.
|
||||||
|
*/
|
||||||
|
int mraa_get_uart_count(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get platform usable I2C bus count, board must be initialised.
|
* Get platform usable I2C bus count, board must be initialised.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -178,6 +178,18 @@ getPinCount()
|
|||||||
return mraa_get_pin_count();
|
return mraa_get_pin_count();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get platform usable UART count, board must be initialised.
|
||||||
|
*
|
||||||
|
* @return number of usable UARTs on the current platform. Function will
|
||||||
|
* return -1 on failure
|
||||||
|
*/
|
||||||
|
inline int
|
||||||
|
getUartCount()
|
||||||
|
{
|
||||||
|
return mraa_get_uart_count();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get platform usable I2C bus count, board must be initialised.
|
* Get platform usable I2C bus count, board must be initialised.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -750,6 +750,15 @@ mraa_get_platform_version(int platform_offset)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
mraa_get_uart_count(void)
|
||||||
|
{
|
||||||
|
if (plat == NULL) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
return plat->uart_dev_count;
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
mraa_get_i2c_bus_count()
|
mraa_get_i2c_bus_count()
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user