Create generic gpio in device tree. #33307
-
Hello, I have recently decided to give Zephyr a try and thus far I am really liking what I see, also I really like the divice tree approach. I've been able to get Leds, SPI, SPI Flash and PWM working in no time (ok, doing it the old-fashioned way would have been faster but we're on a learning curve). How do I create a generic gpio in the device tree? I know how to create leds and keys, but this one is neither. I have tried adding the following to the root node:
and the node shows up, it 'exists' and the label is created. But the gpios property is not. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
A similar question was asked here: #29281 ...I think the answer was to just use |
Beta Was this translation helpful? Give feedback.
-
As @drojf wrote, there are multiple options. Either use the inferred bindings (see https://docs.zephyrproject.org/latest/guides/dts/bindings.html#inferred-bindings) or create a custom, board specific devicetree binding (see https://docs.zephyrproject.org/latest/application/index.html#custom-board-devicetree-and-soc-definitions for how to add it, https://docs.zephyrproject.org/latest/guides/dts/bindings.html for bindings syntax, and https://docs.zephyrproject.org/latest/guides/dts/intro.html#devicetree-intro for an intro on the bindings are used). The Arty board definition uses a board specific DTS binding containing GPIO pin(s). You might find some inspiration there: https://github.com/zephyrproject-rtos/zephyr/tree/master/boards/arm/arty/dts/bindings |
Beta Was this translation helpful? Give feedback.
As @drojf wrote, there are multiple options. Either use the inferred bindings (see https://docs.zephyrproject.org/latest/guides/dts/bindings.html#inferred-bindings) or create a custom, board specific devicetree binding (see https://docs.zephyrproject.org/latest/application/index.html#custom-board-devicetree-and-soc-definitions for how to add it, https://docs.zephyrproject.org/latest/guides/dts/bindings.html for bindings syntax, and https://docs.zephyrproject.org/latest/guides/dts/intro.html#devicetree-intro for an intro on the bindings are used).
The Arty board definition uses a board specific DTS binding containing GPIO pin(s). You might find some inspiration there: https://github.com/ze…