Private
Public Access
2
0

gpio: add function to get raw gpio number.

Will return the GPIO number used within SYSFS
Closes #63

Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
This commit is contained in:
Thomas Ingleby
2015-01-20 18:24:57 +00:00
parent 4e5991779a
commit c3980c217c
3 changed files with 27 additions and 2 deletions

View File

@@ -583,5 +583,17 @@ mraa_gpio_use_mmaped(mraa_gpio_context dev, mraa_boolean_t mmap_en)
int
mraa_gpio_get_pin(mraa_gpio_context dev)
{
if (dev == NULL) {
syslog(LOG_ERR, "gpio: context is invalid");
}
return dev->phy_pin;
}
int
mraa_gpio_get_pin_raw(mraa_gpio_context dev)
{
if (dev == NULL) {
syslog(LOG_ERR, "gpio: context is invalid");
}
return dev->pin;
}