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

Device Tree • Re: Raspberry Pi 5 - rotary-encoder overlay not working

$
0
0
Hello,

It is working now with this code:

Code:

/dts-v1/;/plugin/;/ {    compatible = "brcm,bcm2835";    fragment@1 {        target-path = "/";        __overlay__ {            rotary@4 {                compatible = "rotary-encoder";                status = "okay";                gpios = <0x115 0x01 0x00 0x115 0x03 0x00>;                linux,axis = <0x00>;                rotary-encoder,encoding = "gray";                rotary-encoder,steps = <0xFFFF>;                rotary-encoder,steps-per-period = <0x04>;            };        };    };    __symbols__ {        rotary_pins = "/fragment@0/__overlay__/rotary_pins@4";        rotary      = "/fragment@1/__overlay__/rotary@4";    };};
At the moment I am using the phandle 0x115 as I don't know, how I am able to access the gpio via expander by name, but for the first tests it looks fine. I've also needed to speed up the I²C to 400kHz instead of the default 100kHz, to work correctly at higher turning speeds. Does anyone know, if the rotary encoder is able to make use of the IRQ of the gpio-expander, or not?

Thanks!

Statistics: Posted by mani9876 — Sat Aug 30, 2025 7:15 pm



Viewing all articles
Browse latest Browse all 7521

Trending Articles