The production Raspberry Pi board has a 26-pin 2.54mm (100mil)[1] expansion header, arranged in a 2x13 strip. They provide 8 GPIO pins plus access to I2C, SPI, UART), as well as +3V3, +5V and GND supply lines. Pin one is the pin in the first column and on the bottom row. [2]

Voltage levels are 3v3. There is no over-voltage protection on the board - the intention is that people interested in serious interfacing will use an external board with buffers, level conversion and analog I/O rather than soldering directly onto the main board.

On the production board, all the UART, SPI and I2C pins can be reconfigured as GPIO pins, to provide a total of 17 GPIO pins[3]. Each of their functions and full details of how to access are detailed in the chipset datasheet [4].

The availabile alternative functions and their corresponding pins are detailed below. These numbers are in reference to the chipset documentation and may not match the numbers exposed in linux. Only fully usable functions are detailed, for some alternative functions not all the necessary pins are available for the funtionality to be actually used.

It is also possible to reconfigure some of the pins to provide an ARM JTAG interface.[9] However ARM_TMS isn't available for this (chipset pin 12 or 27 is needed).

It is also possible to reconfigure some of the pins to provide an I2S (hardware mod may be required[10]) or PCM interface.[11] However, PCM_FS and PCM_DIN (chipset pins 19 or 29 and 20 or 30) are needed for I2S or PCM.

It is also possible to reconfigure some of the pins to provide a second I2C interface. [no-ref]

A note about GPIO vs the schematic

You may notice that the GPIO connector as documented in the schematic does NOT match with what is on this wiki page. Do NOT update this wiki page. The pins which are marked as NC should not be used in order to be compatible with possible future designs. The plan is that if a new design comes along and if the layout permits it we will connect additional GPIO pins to those NC pins. (Gert's first vote is for GPIO 19 and 20, That gives us the second PWM, second SPI and I2S)

Referring to pins on the Expansion header

The header is referred to as "The GPIO Connector (P1)". To avoid nomenclature confusion between Broadcom signal names on the SoC and pin names on the expansion header, the following naming is highly recommended:

The expansion header is referred to as "Expansion Header" or "GPIO Connector (P1)"

Pins on the GPIO connector (P1) are referred to as P1-01, etc.

Names GPIO0, GPIO1, GPIOx-ALTy, etc refer to the signal names on the SoC as enumerated in the Broadcom datasheet, where "x" matches BCM2835 number (without leading zero) and "y" is the alternate number column 0 to 5 on page 102-103 of the Broadcom document. For example, depending on what you are describing, use either "GPIO7" to refer to a row of the table, and "GPIO7-ALT0" would refer to a specific cell of the table.

When refering to signal names, you should modify the Broadcom name slightly to minimize confusion. The Broadcom SPI bus pin names are fine, such as "SPI0_*" and "SPI1_*", but they didn't do the same on the I2C and UART pins. Instead of using "SDA0" and "SCL0", you should use "I2C0_SDA" and "I2C0_SCL"; and instead of "TX" or "TXD" and "RX" or "RXD", you should use "UART0_TXD" and "UART0_RXD".

Power pins

Maximum permitted current draw from the 3v3 pin is 50mA.

Maximum permitted current draw from the 5v pin is the USB input current (usually 1A) minus any current draw from the rest of the board.[12]

Model A: 1000mA - 500mA -> max power draw: 500mA

Model B: 1000mA - 700mA -> max power draw: 300mA

Driver support

The Foundation will not include a GPIO driver in the initial release, standard linux GPIO drivers should work with minimal modification.[13]
The Foundation will not include an SPI driver in the initial release, we hope the community might write one.[14]
The Foundation will not include an I2C driver in the initial release, we hope the community might provide one, standard linux I2C drivers should work with minimal modification.[15]

Code examples

GPIO Driving Example (C)

Gert van Loo & Dom, has provided some tested code which accesses the GPIO pins through direct GPIO register manipulation in C-code.
(Thanks to Dom for doing the difficult work of finding and testing the mapping.)
Example GPIO code: