# BPI-R2 GPIO Pin define

**Banana Pi BPI-R2 40-pin GPIO**

Banana Pi BPI-R2 has a 40-pin GPIO header that matches that of the Model Raspberry Pi 3. Following is the Banana Pi GPIO Pinout:

![](https://2026254418-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M2HWtQhonJaM_KJIa7S%2F-M2HWugLnEYPO4HWj-RM%2F-M2HXJXXd7GG6EzWfE77%2Fgpio%20define.jpg?generation=1584080203650470\&alt=media)

BPI-R2 40 PIN GPIO define:

| GPIO Pin Name | Default Function | Function2：GPIO |
| ------------- | ---------------- | -------------- |
| CON1-P01      | VCC-3V3          |                |
| CON1-P02      | VCC-5V           |                |
| CON1-P03      | I2C\_SDA0        | GPIO75         |
| CON1-P04      | VCC-5V           |                |
| CON1-P05      | I2C\_SCL0        | GPIO76         |
| CON1-P06      | GND              |                |
| CON1-P07      | PWM-003          | GPIO206        |
| CON1-P08      | UTXD1            | GPIO80         |
| CON1-P09      | GND              |                |
| CON1-P10      | URXD0            | GPIO81         |
| CON1-P11      | URXD1            | GPIO80         |
| CON1-P12      | I2S0\_BCK        | GPIO74         |
| CON1-P13      | UTXD0            | GPIO79         |
| CON1-P14      | GND              |                |
| CON1-P15      | PWM-002          | GPIO205        |
| CON1-P16      | URTS1            | GPIO25         |
| CON1-P17      | VCC-3V3          |                |
| CON1-P18      | UCTS1            | GPIO24         |
| CON1-P19      | SPI0\_MO         | GPIO56         |
| CON1-P20      | GND              |                |
| CON1-P21      | SPI0\_MI         | GPIO55         |
| CON1-P22      | PCM\_CLK         | GPIO18         |
| CON1-P23      | SPI0\_CK         | GPIO54         |
| CON1-P24      | SPI0\_CSN        | GPIO53         |
| CON1-P25      | GND              |                |
| CON1-P26      | PCM\_RX          | GPIO20         |
| CON1-P27      | I2C\_SDA1        | GPIO57         |
| CON1-P28      | I2C\_SCL1        | GPIO58         |
| CON1-P29      | PCM\_RST         | GPIO22         |
| CON1-P30      | GND              |                |
| CON1-P31      | SPDIF\_OUT       | GPIO200        |
| CON1-P32      | PCM\_TX          | GPIO21         |
| CON1-P33      | I2S0\_MCLK       | GPIO126        |
| CON1-P34      | GND              |                |
| CON1-P35      | I2S0\_LRCK       | GPIO73         |
| CON1-P36      | PCM\_SYNC        | GPIO19         |
| CON1-P37      | SPDIF\_IN1       | GPIO202        |
| CON1-P38      | I2S0\_DATA\_IN   | GPIO72         |
| CON1-P39      | GND              |                |
| CON1-P40      | I2S0\_DATA\_OUT  | GPI049         |

**MIPI DSI (Display SerialInterface)**\
Thedisplay Connector is a 40-pin FPC connector which can connect external LCD panel (MIPI DSI) and touch screen (I2C) module as well. The pin definitions of this connector are shown as below. This is marked on the Banana Pi board as“DSI”.

| **DSI Pin Name** | **Default Function** | **Function2：GPIO** |
| ---------------- | -------------------- | ------------------ |
| CN6-P01          | VCC-3V3              |                    |
| CN6-P02          | VCC-5V               |                    |
| CN6-P03          | VCC-3V3              |                    |
| CN6-P04          | VCC-5V               |                    |
| CN6-P05          | GND                  |                    |
| CN6-P06          | VCC-5V               |                    |
| CN6-P07          | GND                  |                    |
| CN6-P08          | VCC-5V               |                    |
| CN6-P09          | NC                   |                    |
| CN6-P10          | GND                  |                    |
| CN6-P11          | NC                   |                    |
| CN6-P12          | DSI-D0N              |                    |
| CN6-P13          | NC                   |                    |
| CN6-P14          | DSI-D0P              |                    |
| CN6-P15          | DSI\_TE              | GPIO84             |
| CN6-P16          | GND                  |                    |
| CN6-P17          | I2C\_SDA2            | GPIO77             |
| CN6-P18          | DSI-D1N              |                    |
| CN6-P19          | I2C\_SCL2            | GPIO78             |
| CN6-P20          | DSI-D1P              |                    |
| CN6-P21          | CTP-INT              | GPIO23             |
| CN6-P22          | GND                  |                    |
| CN6-P23          | CTP-RST              | GPIO236            |
| CN6-P24          | DSI-CKN              |                    |
| CN6-P25          | GND                  |                    |
| CN6-P26          | DSI-CKP              |                    |
| CN6-P27          | LCM\_BLCTRL          | GPIO28             |
| CN6-P28          | GND                  |                    |
| CN6-P29          | LCM\_RST             | GPIO83             |
| CN6-P30          | DSI-D2N              |                    |
| CN6-P31          | LCM\_BIAS\_EN        | GPIO204            |
| CN6-P32          | DSI-D2P              |                    |
| CN6-P33          | GND                  |                    |
| CN6-P34          | GND                  |                    |
| CN6-P35          | LCM\_BLPWM           | GPIO203            |
| CN6-P36          | DSI-D3N              |                    |
| CN6-P37          | GND                  |                    |
| CN6-P38          | DSI-D3P              |                    |
| CN6-P39          | NC                   |                    |
| CN6-P40          | GND                  |                    |

UART specification:

Theheader CON4 is the UART interface. For developers of Banana Pi, this is an easy way to get the UART console output to check the system status and log message.

| CON2 Pin Name | Default Function | GPIO |
| ------------- | ---------------- | ---- |
| CON2 P03      | UTXD2            |      |
| CON2P02       | URXD2            |      |
| CON2P01       | GND              |      |

How to use Banana PI BPI-R2's GPIO-s

[http://forum.banana-pi.org/t/how-to-use-banana-pi-bpi-r2s-gpio-s/4480](http://forum.banana-pi.org/t/how-to-use-banana-pi-bpi-r2s-gpio-s/4480)
