Author Topic: setting pull-down bias on userspace GPIO in embedded linux  (Read 903 times)

0 Members and 1 Guest are viewing this topic.

Offline davegravyTopic starter

  • Regular Contributor
  • *
  • Posts: 248
  • Country: ca
setting pull-down bias on userspace GPIO in embedded linux
« on: October 26, 2024, 11:17:55 pm »
It seems the pins on this SBC default to pull-up, which I need to change. I spent a while modifying the device tree but while it's easy to configure pins that you're binding to a device with a driver (like gpio-keys) it seems impossible to do it for GPIO that you want to use in userspace. I hope I'm wrong and someone knows of a way.

I tried to set bias using gpiod, which involved needing to compile the latest version in order for gpioset to support the --bias parameter. It doesn't throw an error but it also doesn't work. I read some rather negative things about libgpiod in my quest for an answer.

The only success I've had is using busybox devmem to directly write to the memory address that controls the pin config. I feel like direct memory manipulation like this is kind of dangerous but as it stands running this on startup is the only option I see. 

Please let me know if there's a better way you know about.
« Last Edit: October 26, 2024, 11:24:22 pm by davegravy »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

- - -
-->