Coby Levy Posted December 17, 2020 Share Posted December 17, 2020 hi guys, i'm using NanoPi neo core using a battery and a volt booster. and I want to control the voltage booster to turn off all peripherals to conserve power and prevent battery drainage. I figured there's a PWR-LED pin connected to GPIOL10, which turns off when the system shut down. is there a way to map another GPIO in the same way so i could know when the system has shut down - so it will be safe to cut power off? thank you so much. 0 Quote Link to comment Share on other sites More sharing options...
tipine9824 Posted October 7, 2022 Share Posted October 7, 2022 You can use "gpio-poweroff" https://www.kernel.org/doc/Documentation/devicetree/bindings/power/reset/gpio-poweroff.txt PA2 will be High when shutdown complete: /dts-v1/; /plugin/; / { compatible = "allwinner,sun8i-h3"; fragment@0 { target = <&pio>; __overlay__ { poweroff_pins:poweroff_pins { allwinner,pins = "PA2"; allwinner,function = "gpio_out"; }; }; }; fragment@1 { target-path = "/"; __overlay__ { poweroff: poweroff { compatible = "gpio-poweroff"; gpios = <&pio 0 2 0>; }; }; }; }; 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.