1

I am beginner of linux driver. I want to write my simple module with led. i found some function like gpio_request(unsigned gpio, const char *label), gpio_export(unsigned gpio, bool direction_may_change),...

But i couldn't specify unsigned gpio corresponding with gpio pin. Can you provide some documemnt about this?

0

GPIO numbered 0 to 53 correspond to Broadcom GPIO numbered 0 - 53.

See https://pinout.xyz/ for the correspondence between GPIO number and Raspberry Pi extension header pin number.

If you are using the new gpiochip interface (rather than the sysfs interface) this assumes you open gpiochip0.

  • Ex. Physical pin 15 BCM pin 22 Wiring Pi pin 3. what is unsigned gpio i must pass to function above? – NAM Jun 6 at 2:35
  • it is Physical, BCM or Wiring Pi? – NAM Jun 6 at 3:03
  • BCM (Broadcom). – joan Jun 6 at 7:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.