GPIO Sysfs Number Calculator

Compute the /sys/class/gpio/gpioN number from a bank index and pin offset — common on Allwinner, Rockchip, TI, and similar SoCs.

Ad slot

How this works

Most Linux GPIO controllers expose pins via /sys/class/gpio/gpioN/ where N = bank × pins_per_bank + offset. Pins-per-bank is usually 32, but check your SoC's datasheet or pinctrl driver — some parts use 8, 16, or non-uniform bank sizes, in which case this simple formula won't hold and you should check the platform's gpiochip base offsets under /sys/class/gpio/gpiochipN/base instead.

← All EmbedCalc tools