gpio: Add support for push-pull/open-drain output mode
This attribute is not part of gpio standard attributes so it's necessary to implement a custom version of this function Signed-off-by: Nicola Ponte <nicola.ponte@u-blox.com> Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
committed by
Brendan Le Foll
parent
be9fcf2b2d
commit
7d6164c136
@@ -881,3 +881,20 @@ mraa_gpio_input_mode(mraa_gpio_context dev, mraa_gpio_input_mode_t mode)
|
||||
|
||||
return MRAA_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
mraa_result_t
|
||||
mraa_gpio_out_driver_mode(mraa_gpio_context dev, mraa_gpio_out_driver_mode_t mode)
|
||||
{
|
||||
if (dev == NULL) {
|
||||
syslog(LOG_ERR, "gpio: write: context is invalid");
|
||||
return MRAA_ERROR_INVALID_HANDLE;
|
||||
}
|
||||
|
||||
if (IS_FUNC_DEFINED(dev, gpio_out_driver_mode_replace)) {
|
||||
return dev->advance_func->gpio_out_driver_mode_replace(dev, mode);
|
||||
}
|
||||
else {
|
||||
return MRAA_ERROR_FEATURE_NOT_SUPPORTED;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user