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?

1 Answer 1


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
    Commented Jun 6, 2019 at 2:35
  • it is Physical, BCM or Wiring Pi?
    – NAM
    Commented Jun 6, 2019 at 3:03
  • BCM (Broadcom).
    – joan
    Commented Jun 6, 2019 at 7:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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