Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 6143

Device Tree • Re: gpio-poweroff questions

$
0
0
I2C1 uses GPIO2 & GPIO3, so using GPIO4 for gpio-poweroff is fine.
Does this work on other OS besides Raspberry Pi OS or is this YMMV?
Most OSs on Pi (those that are Linux-based) will support overlays because they inherit the Device Tree from the firmware, and its the firmware that applies the overlays.
set up GPIO 4 as an input with pulldown
That's an unusual choice - it's normally best to work with the power-up default of the pins to avoid glitches; GPIOs 0-8 pull up by default, and 9-27 pull down.

How are you hoping to use the input? The "export" option makes the GPIO available via sysfs, but that mechanism is deprecated now.
Can I either merge this with another overlay or load it with another overlay?
You can merge overlays, but is it necessary? All you should need is something like:

Code:

dtparam=i2c_arm=ondtoverlay=gpio-poweroff,gpiopin=4,input,export

Statistics: Posted by PhilE — Tue Apr 23, 2024 7:53 am



Viewing all articles
Browse latest Browse all 6143

Trending Articles