Search by Tags

GPIO Alphanumeric to GPIO Numeric Assignment

 

Article updated at 10 Jan 2020
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 8, i.MX8X

The i.MX 8/8X modules have GPIO controllers which can control up to 32 GPIO. The GPIO names are formed "LSIO.GPIO<controller>.IO<gpio>" with controller in 0..6 and gpio in 00..31. E.g. a GPIO function could be named LSIO.GPIO2.IO04.

The numeric value is calculated as follows:

480 - 32 x controller + gpio

E.g. LSIO.GPIO0.IO00 becomes 480, LSIO.GPIO2.IO04 becomes 420

You must find the correspondence between GPIO and the edge connector pin (X1) that you want to use in the CoM datasheet. A good place to start is the SoC Function List:

Attention: this table is automatically generated from the formula above. Some of the GPIO lines from the table may not be available in the Toradex SoM or the NXP SoC.

Gpio Numeric Representation
LSIO.GPIO00.IO00 480
LSIO.GPIO00.IO01 481
LSIO.GPIO00.IO02 482
LSIO.GPIO00.IO03 483
LSIO.GPIO00.IO04 484
LSIO.GPIO00.IO05 485
LSIO.GPIO00.IO06 486
LSIO.GPIO00.IO07 487
LSIO.GPIO00.IO08 488
LSIO.GPIO00.IO09 489
LSIO.GPIO00.IO10 490
LSIO.GPIO00.IO11 491
LSIO.GPIO00.IO12 492
LSIO.GPIO00.IO13 493
LSIO.GPIO00.IO14 494
LSIO.GPIO00.IO15 495
LSIO.GPIO00.IO16 496
LSIO.GPIO00.IO17 497
LSIO.GPIO00.IO18 498
LSIO.GPIO00.IO19 499
LSIO.GPIO00.IO20 500
LSIO.GPIO00.IO21 501
LSIO.GPIO00.IO22 502
LSIO.GPIO00.IO23 503
LSIO.GPIO00.IO24 504
LSIO.GPIO00.IO25 505
LSIO.GPIO00.IO26 506
LSIO.GPIO00.IO27 507
LSIO.GPIO00.IO28 508
LSIO.GPIO00.IO29 509
LSIO.GPIO00.IO30 510
LSIO.GPIO00.IO31 511
LSIO.GPIO01.IO00 448
LSIO.GPIO01.IO01 449
LSIO.GPIO01.IO02 450
LSIO.GPIO01.IO03 451
LSIO.GPIO01.IO04 452
LSIO.GPIO01.IO05 453
LSIO.GPIO01.IO06 454
LSIO.GPIO01.IO07 455
LSIO.GPIO01.IO08 456
LSIO.GPIO01.IO09 457
LSIO.GPIO01.IO10 458
LSIO.GPIO01.IO11 459
LSIO.GPIO01.IO12 460
LSIO.GPIO01.IO13 461
LSIO.GPIO01.IO14 462
LSIO.GPIO01.IO15 463
LSIO.GPIO01.IO16 464
LSIO.GPIO01.IO17 465
LSIO.GPIO01.IO18 466
LSIO.GPIO01.IO19 467
LSIO.GPIO01.IO20 468
LSIO.GPIO01.IO21 469
LSIO.GPIO01.IO22 470
LSIO.GPIO01.IO23 471
LSIO.GPIO01.IO24 472
LSIO.GPIO01.IO25 473
LSIO.GPIO01.IO26 474
LSIO.GPIO01.IO27 475
LSIO.GPIO01.IO28 476
LSIO.GPIO01.IO29 477
LSIO.GPIO01.IO30 478
LSIO.GPIO01.IO31 479
LSIO.GPIO02.IO00 416
LSIO.GPIO02.IO01 417
LSIO.GPIO02.IO02 418
LSIO.GPIO02.IO03 419
LSIO.GPIO02.IO04 420
LSIO.GPIO02.IO05 421
LSIO.GPIO02.IO06 422
LSIO.GPIO02.IO07 423
LSIO.GPIO02.IO08 424
LSIO.GPIO02.IO09 425
LSIO.GPIO02.IO10 426
LSIO.GPIO02.IO11 427
LSIO.GPIO02.IO12 428
LSIO.GPIO02.IO13 429
LSIO.GPIO02.IO14 430
LSIO.GPIO02.IO15 431
LSIO.GPIO02.IO16 432
LSIO.GPIO02.IO17 433
LSIO.GPIO02.IO18 434
LSIO.GPIO02.IO19 435
LSIO.GPIO02.IO20 436
LSIO.GPIO02.IO21 437
LSIO.GPIO02.IO22 438
LSIO.GPIO02.IO23 439
LSIO.GPIO02.IO24 440
LSIO.GPIO02.IO25 441
LSIO.GPIO02.IO26 442
LSIO.GPIO02.IO27 443
LSIO.GPIO02.IO28 444
LSIO.GPIO02.IO29 445
LSIO.GPIO02.IO30 446
LSIO.GPIO02.IO31 447
LSIO.GPIO03.IO00 384
LSIO.GPIO03.IO01 385
LSIO.GPIO03.IO02 386
LSIO.GPIO03.IO03 387
LSIO.GPIO03.IO04 388
LSIO.GPIO03.IO05 389
LSIO.GPIO03.IO06 390
LSIO.GPIO03.IO07 391
LSIO.GPIO03.IO08 392
LSIO.GPIO03.IO09 393
LSIO.GPIO03.IO10 394
LSIO.GPIO03.IO11 395
LSIO.GPIO03.IO12 396
LSIO.GPIO03.IO13 397
LSIO.GPIO03.IO14 398
LSIO.GPIO03.IO15 399
LSIO.GPIO03.IO16 400
LSIO.GPIO03.IO17 401
LSIO.GPIO03.IO18 402
LSIO.GPIO03.IO19 403
LSIO.GPIO03.IO20 404
LSIO.GPIO03.IO21 405
LSIO.GPIO03.IO22 406
LSIO.GPIO03.IO23 407
LSIO.GPIO03.IO24 408
LSIO.GPIO03.IO25 409
LSIO.GPIO03.IO26 410
LSIO.GPIO03.IO27 411
LSIO.GPIO03.IO28 412
LSIO.GPIO03.IO29 413
LSIO.GPIO03.IO30 414
LSIO.GPIO03.IO31 415
LSIO.GPIO04.IO00 352
LSIO.GPIO04.IO01 353
LSIO.GPIO04.IO02 354
LSIO.GPIO04.IO03 355
LSIO.GPIO04.IO04 356
LSIO.GPIO04.IO05 357
LSIO.GPIO04.IO06 358
LSIO.GPIO04.IO07 359
LSIO.GPIO04.IO08 360
LSIO.GPIO04.IO09 361
LSIO.GPIO04.IO10 362
LSIO.GPIO04.IO11 363
LSIO.GPIO04.IO12 364
LSIO.GPIO04.IO13 365
LSIO.GPIO04.IO14 366
LSIO.GPIO04.IO15 367
LSIO.GPIO04.IO16 368
LSIO.GPIO04.IO17 369
LSIO.GPIO04.IO18 370
LSIO.GPIO04.IO19 371
LSIO.GPIO04.IO20 372
LSIO.GPIO04.IO21 373
LSIO.GPIO04.IO22 374
LSIO.GPIO04.IO23 375
LSIO.GPIO04.IO24 376
LSIO.GPIO04.IO25 377
LSIO.GPIO04.IO26 378
LSIO.GPIO04.IO27 379
LSIO.GPIO04.IO28 380
LSIO.GPIO04.IO29 381
LSIO.GPIO04.IO30 382
LSIO.GPIO04.IO31 383
LSIO.GPIO05.IO00 320
LSIO.GPIO05.IO01 321
LSIO.GPIO05.IO02 322
LSIO.GPIO05.IO03 323
LSIO.GPIO05.IO04 324
LSIO.GPIO05.IO05 325
LSIO.GPIO05.IO06 326
LSIO.GPIO05.IO07 327
LSIO.GPIO05.IO08 328
LSIO.GPIO05.IO09 329
LSIO.GPIO05.IO10 330
LSIO.GPIO05.IO11 331
LSIO.GPIO05.IO12 332
LSIO.GPIO05.IO13 333
LSIO.GPIO05.IO14 334
LSIO.GPIO05.IO15 335
LSIO.GPIO05.IO16 336
LSIO.GPIO05.IO17 337
LSIO.GPIO05.IO18 338
LSIO.GPIO05.IO19 339
LSIO.GPIO05.IO20 340
LSIO.GPIO05.IO21 341
LSIO.GPIO05.IO22 342
LSIO.GPIO05.IO23 343
LSIO.GPIO05.IO24 344
LSIO.GPIO05.IO25 345
LSIO.GPIO05.IO26 346
LSIO.GPIO05.IO27 347
LSIO.GPIO05.IO28 348
LSIO.GPIO05.IO29 349
LSIO.GPIO05.IO30 350
LSIO.GPIO05.IO31 351
LSIO.GPIO06.IO00 288
LSIO.GPIO06.IO01 289
LSIO.GPIO06.IO02 290
LSIO.GPIO06.IO03 291
LSIO.GPIO06.IO04 292
LSIO.GPIO06.IO05 293
LSIO.GPIO06.IO06 294
LSIO.GPIO06.IO07 295
LSIO.GPIO06.IO08 296
LSIO.GPIO06.IO09 297
LSIO.GPIO06.IO10 298
LSIO.GPIO06.IO11 299
LSIO.GPIO06.IO12 300
LSIO.GPIO06.IO13 301
LSIO.GPIO06.IO14 302
LSIO.GPIO06.IO15 303
LSIO.GPIO06.IO16 304
LSIO.GPIO06.IO17 305
LSIO.GPIO06.IO18 306
LSIO.GPIO06.IO19 307
LSIO.GPIO06.IO20 308
LSIO.GPIO06.IO21 309
LSIO.GPIO06.IO22 310
LSIO.GPIO06.IO23 311
LSIO.GPIO06.IO24 312
LSIO.GPIO06.IO25 313
LSIO.GPIO06.IO26 314
LSIO.GPIO06.IO27 315
LSIO.GPIO06.IO28 316
LSIO.GPIO06.IO29 317
LSIO.GPIO06.IO30 318
LSIO.GPIO06.IO31 319

i.MX 6, i.MX6ULL, i.MX7

The i.MX 6/6ULL/7 modules have 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