Search by Tags

GPIO Alphanumeric to GPIO Numeric Assignment

 

Compare with Revision


Subscribe for this article updates

GPIO

This article describes the relationship between a SOC's GPIO Name and GPIO number used in various SW APIs.

Most pins on a SOC can be configured for different functions, one of them GPIO.

A SOC pin has an alphanumeric name, the GPIO functionality usually has an alphanumeric name and in the SW APIs the GPIO is often referenced as a number.

To make matters more complicated the SOC pin is then routed to the modules connector and gets an additional module pin name and number.

The WinCE GPIOLib.h provides a MACRO for the conversion from alphanumeric to numbers (TEGRA_GPIONUM). We recommend to use the SODIMM pin number instead of GPIO Numbers for better compatibility with other Colibri modules when ever possible.

The Linux kernel uses the numeric-only representation in its GPIO subsystem and in the sysfs interface to the GPIO functionality.

e.g. on a Colibri T20 the T20 pin SDIO3_DAT0 has the following relationships.

Module Pin Name Module Pin Number SOC Pin Name SOC GPIO Name GPIO number
GPIO: PS2.SCL1
SODIMM_63
63 SDIO3_DAT0 B7 15

The relationship between Module Pin Name / Module Pin Number / SOC Pin Name / SOC GPIO Name can be found in the modules datasheet.

i.MX 6

The i.MX 6 has GPIO controllers which can control up to 32 GPIO. The GPIO names are formed "GPIO<controller>_IO<gpio>" with controller in 1..7 and gpio in 00..31. E.g. a GPIO function could be named GPIO2_IO04.

The numeric value is calculated as follows:

32 x (controller- 1) + gpio

E.g. GPIO1_IO00 becomes 0, GPIO2_IO04 becomes 36

Note that not all GPIO controllers provide all 32 possible GPIOs, so the list has gaps.

Gpio Numeric Representation
GPIO1_IO00 0
GPIO1_IO01 1
GPIO1_IO02 2
GPIO1_IO03 3
GPIO1_IO04 4
GPIO1_IO05 5
GPIO1_IO06 6
GPIO1_IO07 7
GPIO1_IO08 8
GPIO1_IO09 9
GPIO1_IO10 10
GPIO1_IO11 11
GPIO1_IO12 12
GPIO1_IO13 13
GPIO1_IO14 14
GPIO1_IO15 15
GPIO1_IO16 16
GPIO1_IO17 17
GPIO1_IO18 18
GPIO1_IO19 19
GPIO1_IO20 20
GPIO1_IO21 21
GPIO1_IO22 22
GPIO1_IO23 23
GPIO1_IO24 24
GPIO1_IO25 25
GPIO1_IO26 26
GPIO1_IO27 27
GPIO1_IO28 28
GPIO1_IO29 29
GPIO1_IO30 30
GPIO1_IO31 31
GPIO2_IO00 32
GPIO2_IO01 33
GPIO2_IO02 34
GPIO2_IO03 35
GPIO2_IO04 36
GPIO2_IO05 37
GPIO2_IO06 38
GPIO2_IO07 39
GPIO2_IO08 40
GPIO2_IO09 41
GPIO2_IO10 42
GPIO2_IO11 43
GPIO2_IO12 44
GPIO2_IO13 45
GPIO2_IO14 46
GPIO2_IO15 47
GPIO2_IO16 48
GPIO2_IO17 49
GPIO2_IO18 50
GPIO2_IO19 51
GPIO2_IO20 52
GPIO2_IO21 53
GPIO2_IO22 54
GPIO2_IO23 55
GPIO2_IO24 56
GPIO2_IO25 57
GPIO2_IO26 58
GPIO2_IO27 59
GPIO2_IO28 60
GPIO2_IO29 61
GPIO2_IO30 62
GPIO2_IO31 63
GPIO3_IO00 64
GPIO3_IO01 65
GPIO3_IO02 66
GPIO3_IO03 67
GPIO3_IO04 68
GPIO3_IO05 69
GPIO3_IO06 70
GPIO3_IO07 71
GPIO3_IO08 72
GPIO3_IO09 73
GPIO3_IO10 74
GPIO3_IO11 75
GPIO3_IO12 76
GPIO3_IO13 77
GPIO3_IO14 78
GPIO3_IO15 79
GPIO3_IO16 80
GPIO3_IO17 81
GPIO3_IO18 82
GPIO3_IO19 83
GPIO3_IO20 84
GPIO3_IO21 85
GPIO3_IO22 86
GPIO3_IO23 87
GPIO3_IO24 88
GPIO3_IO25 89
GPIO3_IO26 90
GPIO3_IO27 91
GPIO3_IO28 92
GPIO3_IO29 93
GPIO3_IO30 94
GPIO3_IO31 95
GPIO4_IO05 101
GPIO4_IO06 102
GPIO4_IO07 103
GPIO4_IO08 104
GPIO4_IO09 105
GPIO4_IO10 106
GPIO4_IO11 107
GPIO4_IO12 108
GPIO4_IO13 109
GPIO4_IO14 110
GPIO4_IO15 111
GPIO4_IO16 112
GPIO4_IO17 113
GPIO4_IO18 114
GPIO4_IO19 115
GPIO4_IO20 116
GPIO4_IO21 117
GPIO4_IO22 118
GPIO4_IO23 119
GPIO4_IO24 120
GPIO4_IO25 121
GPIO4_IO26 122
GPIO4_IO27 123
GPIO4_IO28 124
GPIO4_IO29 125
GPIO4_IO30 126
GPIO4_IO31 127
GPIO5_IO00 128
GPIO5_IO02 130
GPIO5_IO04 132
GPIO5_IO05 133
GPIO5_IO06 134
GPIO5_IO07 135
GPIO5_IO08 136
GPIO5_IO09 137
GPIO5_IO10 138
GPIO5_IO11 139
GPIO5_IO12 140
GPIO5_IO13 141
GPIO5_IO14 142
GPIO5_IO15 143
GPIO5_IO16 144
GPIO5_IO17 145
GPIO5_IO18 146
GPIO5_IO19 147
GPIO5_IO20 148
GPIO5_IO21 149
GPIO5_IO22 150
GPIO5_IO23 151
GPIO5_IO24 152
GPIO5_IO25 153
GPIO5_IO26 154
GPIO5_IO27 155
GPIO5_IO28 156
GPIO5_IO29 157
GPIO5_IO30 158
GPIO5_IO31 159
GPIO6_IO00 160
GPIO6_IO01 161
GPIO6_IO02 162
GPIO6_IO03 163
GPIO6_IO04 164
GPIO6_IO05 165
GPIO6_IO06 166
GPIO6_IO07 167
GPIO6_IO08 168
GPIO6_IO09 169
GPIO6_IO10 170
GPIO6_IO11 171
GPIO6_IO14 174
GPIO6_IO15 175
GPIO6_IO16 176
GPIO6_IO17 177
GPIO6_IO18 178
GPIO6_IO19 179
GPIO6_IO20 180
GPIO6_IO21 181
GPIO6_IO22 182
GPIO6_IO23 183
GPIO6_IO24 184
GPIO6_IO25 185
GPIO6_IO26 186
GPIO6_IO27 187
GPIO6_IO28 188
GPIO6_IO29 189
GPIO6_IO30 190
GPIO6_IO31 191
GPIO7_IO00 192
GPIO7_IO01 193
GPIO7_IO02 194
GPIO7_IO03 195
GPIO7_IO04 196
GPIO7_IO05 197
GPIO7_IO06 198
GPIO7_IO07 199
GPIO7_IO08 200
GPIO7_IO09 201
GPIO7_IO10 202
GPIO7_IO11 203
GPIO7_IO12 204
GPIO7_IO13 205

T20, T30, TK1

The Tegra CPU defines GPIOs with an alphanumeric term, e.g. A1 or T5 (GPIO-Q.01).

The numeric value is calculated as follows:

8 x (Character - 'A') + Digit

So A0 becomes 0, A7 becomes 7, B0 becomes 8, ...

The Linux kernel defines macros in arch/arm/mach-tegra/gpio-names.h for each GPIO.


The following table lists all assignments of Tegra GPIO to their numeric representation.

GpioNumeric Representation
A00
A11
A22
A33
A44
A55
A66
A77
B08
B19
B210
B311
B412
B513
B614
B715
C016
C117
C218
C319
C420
C521
C622
C723
D024
D125
D226
D327
D428
D529
D630
D731
E032
E133
E234
E335
E436
E537
E638
E739
F040
F141
F242
F343
F444
F545
F646
F747
G048
G149
G250
G351
G452
G553
G654
G755
H056
H157
H258
H359
H460
H561
H662
H763
I064
I165
I266
I367
I468
I569
I670
I771
J072
J173
J274
J375
J476
J577
J678
J779
K080
K181
K282
K383
K484
K585
K686
K787
L088
L189
L290
L391
L492
L593
L694
L795
M096
M197
M298
M399
M4100
M5101
M6102
M7103
N0104
N1105
N2106
N3107
N4108
N5109
N6110
N7111
O0112
O1113
O2114
O3115
O4116
O5117
O6118
O7119
P0120
P1121
P2122
P3123
P4124
P5125
P6126
P7127
Q0128
Q1129
Q2130
Q3131
Q4132
Q5133
Q6134
Q7135
R0136
R1137
R2138
R3139
R4140
R5141
R6142
R7143
S0144
S1145
S2146
S3147
S4148
S5149
S6150
S7151
T0152
T1153
T2154
T3155
T4156
T5157
T6158
T7159
U0160
U1161
U2162
U3163
U4164
U5165
U6166
U7167
V0168
V1169
V2170
V3171
V4172
V5173
V6174
V7175
W0176
W1177
W2178
W3179
W4180
W5181
W6182
W7183
X0184
X1185
X2186
X3187
X4188
X5189
X6190
X7191
Y0192
Y1193
Y2194
Y3195
Y4196
Y5197
Y6198
Y7199
Z0200
Z1201
Z2202
Z3203
Z4204
Z5205
Z6206
Z7207
AA0208
AA1209
AA2210
AA3211
AA4212
AA5213
AA6214
AA7215
BB0216
BB1217
BB2218
BB3219
BB4220
BB5221

Additionaly on T30

GpioNumeric Representation
BB6222
BB7223
CC0224
CC1225
CC2226
CC3227
CC4228
CC5229
CC6230
CC7231
DD0232
DD1233
DD2234
DD3235
DD4236
DD5237
DD6238
DD7239
EE0240
EE1241
EE2242
EE3243

Additionaly on TK1

GpioNumeric Representation
EE4244
EE5245
EE6246
EE7247
FF0248
FF1249
FF2250

Vybrid

Gpio Numeric Representation
PTA6 0
PTA8 1
PTA9 2
PTA10 3
PTA11 4
PTA12 5
PTA16 6
PTA17 7
PTA18 8
PTA19 9
PTA20 10
PTA21/MII0_RXCLK 11
PTA22 12
PTA23 13
PTA24 14
PTA25 15
PTA26 16
PTA27 17
PTA28 18
PTA29 19
PTA30 20
PTA31 21
PTB0 22
PTB1 23
PTB2 24
PTB3 25
PTB4 26
PTB5 27
PTB6 28
PTB7 29
PTB8 30
PTB9 31
PTB10 32
PTB11 33
PTB12 34
PTB13 35
PTB14 36
PTB15 37
PTB16 38
PTB17 39
PTB18 40
PTB19 41
PTB20 42
PTB21 43
PTB22 44
PTC0 45
PTC1 46
PTC2 47
PTC3 48
PTC4 49
PTC5 50
PTC6 51
PTC7 52
PTC8 53
PTC9 54
PTC10 55
PTC11 56
PTC12 57
PTC13 58
PTC14 59
PTC15 60
PTC16 61
PTC17 62
PTD31 63
PTD30 64
PTD29 65
PTD28 66
PTD27 67
PTD26 68
PTD25 69
PTD24 70
PTD23/MII0_RXDATA[3] 71
PTD22/MII0_RXDATA[2] 72
PTD21/MII0_CRS 73
PTD20/MII0_COL 74
PTD19 75
PTD18 76
PTD17 77
PTD16 78
PTD0 79
PTD1 80
PTD2 81
PTD3 82
PTD4 83
PTD5 84
PTD6 85
PTD7 86
PTD8 87
PTD9 88
PTD10 89
PTD11 90
PTD12 91
PTD13 92
PTB23 93
PTB24 94
PTB25 95
PTB26 96
PTB27 97
PTB28 98
PTC26 99
PTC27 100
PTC28 101
PTC29 102
PTC30 103
PTC31 104
PTE0 105
PTE1 106
PTE2 107
PTE3 108
PTE4 109
PTE5 110
PTE6 111
PTE7 112
PTE8 113
PTE9 114
PTE10 115
PTE11 116
PTE12 117
PTE13 118
PTE14 119
PTE15 120
PTE16 121
PTE17 122
PTE18 123
PTE19 124
PTE20 125
PTE21 126
PTE22 127
PTE23 128
PTE24 129
PTE25 130
PTE26 131
PTE27 132
PTE28 133
PTA7 134