I would like to learn how to remap the GPIOs on the Raspberry Pi Zero.
How to make Physical Pin 11 to act like something else ?
Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. It only takes a minute to sign up.Sign up to join this community
The GPIO (General Purpose Input Output) may be set in a variety of modes. Potentially each Pi GPIO may be set into 8 different modes called INPUT, OUPUT, ALT0, ALT1, ALT2, ALT3, ALT4, and ALT5.
All GPIO may be set in INPUT or OUTPUT modes. The other potential modes depend on the GPIO and are summarised on page 102 of BCM2835 ARM Peripherals.
Several of the GPIO libraries let you set the mode of a GPIO. In particular wiringPi's gpio utility and (my) pigpio's pigs utility.
The Pi4B has some altered ALT functions which are summarised here.
The preferred way to manipulate the modes is probably to use device tree settings in
/boot/config.txt (e.g. to set up a UART, SPI, etc.).
/boot/overlays/README for up to date information.