Use new Zephyr 2.2 GPIO driver API features

Enable and disable pins are now handled the same using _set function
instead of _write and using ACTIVE_HIGH/LOW setting in dts.
This commit is contained in:
Martin Jaeger
2020-02-13 18:35:42 +01:00
parent c4d4372953
commit 08974169ab
11 changed files with 60 additions and 84 deletions
+4 -5
View File
@@ -71,11 +71,10 @@ void ExtOled::enable()
uext_dis = 0;
#endif
#if defined(DT_SWITCH_UEXT_DIS_GPIOS_CONTROLLER) && defined(__ZEPHYR__)
struct device *dev_uext_dis =
device_get_binding(DT_SWITCH_UEXT_DIS_GPIOS_CONTROLLER);
gpio_pin_configure(dev_uext_dis, DT_SWITCH_UEXT_DIS_GPIOS_PIN, GPIO_DIR_OUT);
gpio_pin_write(dev_uext_dis, DT_SWITCH_UEXT_DIS_GPIOS_PIN, 0);
#ifdef DT_SWITCH_UEXT_GPIOS_CONTROLLER
struct device *dev_uext_dis = device_get_binding(DT_SWITCH_UEXT_GPIOS_CONTROLLER);
gpio_pin_configure(dev_uext_dis, DT_SWITCH_UEXT_GPIOS_PIN,
DT_SWITCH_UEXT_GPIOS_FLAGS | GPIO_OUTPUT_ACTIVE);
#endif
#ifdef OLED_BRIGHTNESS