mraa: add accessor functions to return counts of spi, pwm, gpio and adcs
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
b7e8d96945
commit
d6edf76680
36
src/mraa.c
36
src/mraa.c
@@ -759,6 +759,42 @@ mraa_get_uart_count(void)
|
||||
return plat->uart_dev_count;
|
||||
}
|
||||
|
||||
int
|
||||
mraa_get_spi_count(void)
|
||||
{
|
||||
if (plat == NULL) {
|
||||
return -1;
|
||||
}
|
||||
return plat->spi_bus_count;
|
||||
}
|
||||
|
||||
int
|
||||
mraa_get_pwm_count(void)
|
||||
{
|
||||
if (plat == NULL) {
|
||||
return -1;
|
||||
}
|
||||
return plat->pwm_dev_count;
|
||||
}
|
||||
|
||||
int
|
||||
mraa_get_gpio_count(void)
|
||||
{
|
||||
if (plat == NULL) {
|
||||
return -1;
|
||||
}
|
||||
return plat->gpio_count;
|
||||
}
|
||||
|
||||
int
|
||||
mraa_get_aio_count(void)
|
||||
{
|
||||
if (plat == NULL) {
|
||||
return -1;
|
||||
}
|
||||
return plat->aio_count;
|
||||
}
|
||||
|
||||
int
|
||||
mraa_get_i2c_bus_count()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user