Skip to content

GPIO Modes

Allison edited this page Apr 27, 2019 · 37 revisions

R64.GPIO supports three GPIO modes: ROCK, BOARD, and BCM.

  • ROCK is the default mode, which uses standard Rock64 GPIO numbers.
  • BOARD allows you to use pin numbers when working with GPIOs instead of GPIO numbers.
  • BCM attempts to emulate the layout of the Raspberry Pi's 40-pin header.
    • BCM 4, 5, 6, 17, and 27 are mapped to the Pi P5+ header due to compatibility issues.
    • BCM 12, 13, 16, 19, 20, 21, and 26 are not usable if a MicroSD card is inserted.
    • BCM is only able to access 28 (out of 33 total) GPIOs.

The following table compares all available layouts against the physical pin-outs of the Pi-2 and Pi P5+ buses.

Pin# (Physical) Pin# (BOARD) GPIO# (ROCK) GPIO# (BCM) Confirmed Working?
Pi-2: 3 3 89 2 YES
Pi-2: 5 5 88 3 YES
Pi-2: 7 7 60 YES (May cause crashes)
Pi-2: 8 8 64 14
Pi-2: 10 10 65 15
Pi-2: 12 12 67 18 YES (Input Only)
Pi-2: 15 15 100 22 YES
Pi-2: 16 16 101 23 YES
Pi-2: 18 18 102 24 YES
Pi-2: 19 19 97 10
Pi-2: 21 21 98 9
Pi-2: 22 22 103 25 YES
Pi-2: 23 23 96 11
Pi-2: 24 24 104 8
Pi-2: 26 26 76 7
Pi-2: 27 27 68 0
Pi-2: 28 28 69 1
Pi-2: 32 32 38 12 YES (No MicroSD)
Pi-2: 33 33 32 13 YES (No MicroSD)
Pi-2: 35 35 33 19 YES (No MicroSD)
Pi-2: 36 36 37 16 YES (No MicroSD)
Pi-2: 37 37 34 26 YES (No MicroSD)
Pi-2: 38 38 36 20 YES (No MicroSD)
Pi-2: 40 40 35 21 YES (No MicroSD)
Pi P5+: 3 43 81 4 YES
Pi P5+: 4 44 82 27 YES
Pi P5+: 5 45 87 5 YES
Pi P5+: 6 46 83 6 YES
Pi P5+: 9 49 80 17 YES
Pi P5+: 10 50 79 YES
Pi P5+: 11 51 85 YES
Pi P5+: 12 52 84 YES
Pi P5+: 13 53 27
Pi P5+: 14 54 86 YES
Pi P5+: 21 61 89 2 YES (Duplicate)
Pi P5+: 22 62 88 3 YES (Duplicate)
Clone this wiki locally