Hello CircuitDojo Community,
I have been working on an nRF9160, Nordic ncs 1.6.1 and Zephyr based project. Past six weeks have been focused on reaching deep sleep modes and floor currents in single micro-ampere range both in development board and custom board. I’ve been testing configs where I set every GPIO to Zephyr’s GPIO_DISCONNECTED
state, as part of this effort. Recently discovered I’d missed one pin, an input that’s connected to the board’s “user purposed” push button.
When I add the following Zephyr API call:
gpio_pin_configure(dev_s1, SW0_PIN, GPIO_DISCONNECTED);
…I find that the push button still triggers firmware that’s checking for push button press events, code which reads whether the state of that pin is found to be high or low.
I went further and modified my board’s DTS file, [custom_board]_common.dts:
buttons {
compatible = "gpio-keys";
button0: button_0 {
gpios = <&gpio0 22 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
label = "Button 1";
status = "disabled";
};
};
…so that the device is disabled at compile time. Yet the button remains active, and firmware responds to button presses.
What basic detail am I failing to see here? Feels like I may be making a dumb mistake. I’d like to be able to control this GPIO, so that in case the original configuration I chose or inherited is drawing some current I could otherwise save, I may turn that off, for battery life purposes.
Thanks ahead of time for any help community here can offer!