Replies: 3 comments 9 replies
-
I converted this to a discussion; seems the easiest way to discuss things. ;-) <edited away my long answer, it no longer really applies, see below> |
Beta Was this translation helpful? Give feedback.
-
@skyne98
The first thing to note is that the Correct solution for enabling hardware GPIO features is to use Device Tree Overlays. But I have not done this yet. So I still present a 'make a full custom device tree' solution. I have I2C, PWM and general Digital IO covered there, it all works
There is now a GPIO guide at: GPIO-examples.md with examples and notes. I have also improved and expanded the alternate tree examples; adding one that closely mimics a standard RPi HAT layout. |
Beta Was this translation helpful? Give feedback.
-
@skyne98 As I was doing this I realised that an overlay based solution has pretty much the same overhead as just compiling a full tree. They still need to be (ideally) recompiled for each new kernel, and cannot be applied 'dynamically'(*), so you still need to reboot after compiling and installing. 👎 I might come back to this later; but for now please go with the 'full tree' method. (*) There is a way.. but it involves recompiling a custom kernel for each version with an unsupported option. |
Beta Was this translation helpful? Give feedback.
-
Hi! Thanks for the unique and extremely useful resource!
I am somewhat of an embedded linux noob, so I am trying to figure things out step by step with my
mq pro
. Currently I am trying to initialize i2c to communicate with the "Adafruit 128x64 OLED Bonnet"'s OLED panel with the SD1306 driver.Problem I am currently having is with the bus and controller. You wrote that the correct way of doing things is using the vanilla mq pro device tree and then using
gpiod
andpinctl
to dynamically manage devices. Can you please help me out on how that works?All the resources I find tell me to compile a device tree to enable i2c and I cannot find any that mentions how to use the two to do it dynamically D:
Current goal: initialize an i2c bus on pins 3 and 5.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions