Private
Public Access
2
0

gpio: Add a function to get a pin number from mraa_gpio_context

Signed-off-by: Kenta Yonekura <yoneken@ieee.org>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
yoneken
2014-12-21 20:31:59 +09:00
committed by Brendan Le Foll
parent bc05ce7078
commit 74d172cb6c
3 changed files with 22 additions and 0 deletions

View File

@@ -192,6 +192,14 @@ mraa_result_t mraa_gpio_owner(mraa_gpio_context dev, mraa_boolean_t owner);
*/
mraa_result_t mraa_gpio_use_mmaped(mraa_gpio_context dev, mraa_boolean_t mmap);
/**
* Get a pin number of the gpio
*
* @param dev The Gpio context
* @return Pin number
*/
int mraa_gpio_get_pin(mraa_gpio_context dev);
#ifdef __cplusplus
}
#endif

View File

@@ -183,6 +183,14 @@ class Gpio {
mraa_result_t useMmap(bool enable) {
return mraa_gpio_use_mmaped(m_gpio, (mraa_boolean_t) enable);
}
/**
* Get pin number of Gpio
*
* @return Pin number
*/
int getPin() {
return mraa_gpio_get_pin(m_gpio);
}
private:
mraa_gpio_context m_gpio;
};