forked from kofal.net/zmk
Merge pull request #242 from megamind4089/feature/ext-power
[RDY] Driver to control the external power output
This commit is contained in:
@@ -29,6 +29,11 @@
|
||||
};
|
||||
};
|
||||
|
||||
ext-power {
|
||||
compatible = "zmk,ext-power-generic";
|
||||
label = "EXT_POWER";
|
||||
control-gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
};
|
||||
|
||||
&gpiote {
|
||||
|
||||
@@ -26,6 +26,11 @@
|
||||
};
|
||||
};
|
||||
|
||||
ext-power {
|
||||
compatible = "zmk,ext-power-generic";
|
||||
label = "EXT_POWER";
|
||||
control-gpios = <&gpio1 9 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
};
|
||||
|
||||
&gpio0 {
|
||||
|
||||
@@ -26,6 +26,11 @@
|
||||
};
|
||||
};
|
||||
|
||||
ext-power {
|
||||
compatible = "zmk,ext-power-generic";
|
||||
label = "EXT_POWER";
|
||||
control-gpios = <&gpio1 9 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
};
|
||||
|
||||
&gpio0 {
|
||||
|
||||
@@ -26,6 +26,11 @@
|
||||
};
|
||||
};
|
||||
|
||||
ext-power {
|
||||
compatible = "zmk,ext-power-generic";
|
||||
label = "EXT_POWER";
|
||||
control-gpios = <&gpio1 9 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
};
|
||||
|
||||
&gpio0 {
|
||||
|
||||
@@ -14,25 +14,14 @@
|
||||
static int pinmux_nrfmicro_init(struct device *port) {
|
||||
ARG_UNUSED(port);
|
||||
|
||||
struct device *p1 = device_get_binding("GPIO_1");
|
||||
|
||||
#if CONFIG_BOARD_NRFMICRO_13
|
||||
struct device *p0 = device_get_binding("GPIO_0");
|
||||
// enable EXT_VCC (use 0 for nRFMicro 1.3, use 1 for nRFMicro 1.1)
|
||||
gpio_pin_configure(p1, 9, GPIO_OUTPUT);
|
||||
gpio_pin_set(p1, 9, 0);
|
||||
|
||||
#if CONFIG_BOARD_NRFMICRO_CHARGER
|
||||
gpio_pin_configure(p0, 5, GPIO_OUTPUT);
|
||||
gpio_pin_set(p0, 5, 0);
|
||||
#else
|
||||
gpio_pin_configure(p0, 5, GPIO_INPUT);
|
||||
#endif
|
||||
|
||||
#else
|
||||
// enable EXT_VCC (use 0 for nRFMicro 1.3, use 1 for nRFMicro 1.1)
|
||||
gpio_pin_configure(p1, 9, GPIO_OUTPUT);
|
||||
gpio_pin_set(p1, 9, 1);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user