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

Device Tree • HID Over i2C help

$
0
0
Goal - from Raspberry pi 4 i want to talk HID over I2C to a custom microcontroller software running on a PICO.

So i've been taking some notes from these resources to make a HID over i2c example.
* viewtopic.php?t=152803
* https://github.com/NordicPlayground/nrf ... _README.md


What i found is that my small modifications to the device tree make it not work and i'm trying to figure out why? If i used the given device tree i found on github it works just fine, as in my logic analyzer sees it trying to check the device. But with my device tree file it doesn't do anything. I'm just trying to understand why this is causing a problem?


## original vesion

Code:

// Definitions for HID over I2C/dts-v1/;/plugin/;/{compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709";fragment@0 {target = <&i2c_arm>;__overlay__ {status = "okay";};};fragment@1 {target = <&gpio>;__overlay__ {i2c_hid_pins: i2c_hid_pins {brcm,pins = <27>;brcm,function = <0>;};};};fragment@2 {target = <&i2c_arm>;__overlay__{#address-cells = <1>;#size-cells = <0>;i2c_hid: i2c-hid-dev@40 {compatible = "hid-over-i2c";reg = <0x0A>;hid-descr-addr = <0x0001>;interrupt-parent = <&gpio>;interrupts = <27 0x8>;};};};__overrides__ {gpiopin = <&i2c_hid_pins>, "brcm,pins:0",<&i2c_hid>, "interrupts:0";addr = <&i2c_hid>, "reg:0";};};
Edited version

Code:

/dts-v1/;/plugin/;/{compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709";    /*     i2c_arm == i2c1 on RP4     dtparam=i2c_arm=on     */fragment@0 {target = <&i2c_arm>;__overlay__ {status = "okay";};};    fragment@1 {target = <&gpio>;__overlay__ {i2c_hid_pins: i2c_hid_pins {brcm,pins = <27>;brcm,function = <0>;};};};        fragment@2 {        target = <&i2c_arm>;        __overlay__ {            #address-cells = <1>;#size-cells = <0>;i2c-hid-dev@2c {compatible = "hid-over-i2c";                reg = <0x2c>;                                hid-descr-addr = <0x0020>;interrupt-parent = <&gpio>;interrupts = <27 0x8>;                /*status = "okay";*/};        };    };    __overrides__ {        gpiopin = <&i2c_hid_pins>, "brcm,pins:0",                    <&i2c_hid>, "interrupts:0";        addr = <&i2c_hid>, "reg:0";    };};/*Device is 0x2cHID descriptor 0x20*/

Statistics: Posted by brenden — Mon Oct 13, 2025 11:34 pm



Viewing all articles
Browse latest Browse all 7659

Trending Articles