Skip to content

Commit

Permalink
Update for Orange Pi 3Plus
Browse files Browse the repository at this point in the history
  • Loading branch information
liu1313277 committed Mar 27, 2024
1 parent ce520ea commit c2ce450
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
1 change: 1 addition & 0 deletions examples/blink.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ unsigned char getGpioNum(void)
case PI_MODEL_CM4:
case PI_MODEL_3B:
case PI_MODEL_ZERO_2_W:
case PI_MODEL_3_PLUS:
return 28;
break;
case PI_MODEL_R1_PLUS:
Expand Down
6 changes: 3 additions & 3 deletions gpio/readall.c
Original file line number Diff line number Diff line change
Expand Up @@ -1284,8 +1284,8 @@ static char * physNames_3PLUS[64] =
{
NULL,
" 3.3V", "5V ",
" SDA_M3", "5V ",
" SCL_M3", "GND ",
" SDA_AO", "5V ",
" SCL_AO", "GND ",
" PWM_F", "TXD_A ",
" GND", "RXD_A ",
" PAO7", "PA12 ",
Expand All @@ -1296,7 +1296,7 @@ static char * physNames_3PLUS[64] =
" MISO_B", "PAO5 ",
" SCLK_B", "SSO_B ",
" GND", "PWMAO_C ",
" SDA_M0", "SCL_M0 ",
" PAO4", "PA6 ",
" PA2", "GND ",
" PC7", "PA4 ",
" PAO10", "GND ",
Expand Down
21 changes: 11 additions & 10 deletions wiringPi/wiringPi.c
Original file line number Diff line number Diff line change
Expand Up @@ -390,9 +390,9 @@ static int ORANGEPI_PIN_MASK_3PLUS[16][32] = //[BANK] [INDEX]
{-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,},//351
{-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,},//383
{-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,28,29,30,31,},//415
{-1, 1, 2, 3, 4, 5, 6,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,31,},//447
{ 0, 1, 2, 3, 4, 5, 6, 7,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,31,},//447
{ 0, 1, 2, 3,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,27,28,-1,30,31,},//479
{ 0,-1,-1, 3,-1, 5, 6, 7, 8, 9,10,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,},//511
{ 0,-1, 2, 3,-1, 5, 6, 7, 8, 9,10,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,},//511
};

int (*ORANGEPI_PIN_MASK)[32];
Expand Down Expand Up @@ -1086,21 +1086,21 @@ int pinToGpio_R1_PLUS[64] =

int pinToGpio_3PLUS[64] =
{
490, 491, // 0, 1
415, 414, // 0, 1
487, 412, // 2, 3
413, 419, // 4 5
488, 421, // 6, 7
420, 451, // 8, 9
479, 447, //10,11
448, 417, //12,13
450, 449, //14,15
418, 415, //16,17
414, 478, //18,19
418, 416, //16,17
482, 478, //18,19
475, 480, //20,21
422, 489, //22,23
476, 483, //24,25
486, 485, //26,27
-1, -1, //28,29
423, -1, //28,29
-1, -1, //30,31

-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // ... 47
Expand Down Expand Up @@ -1766,8 +1766,8 @@ int physToGpio_3PLUS[64] =
{
-1, // 0
-1, -1, // 1, 2
490, -1, // 3, 4
491, -1, // 5, 6
415, -1, // 3, 4
414, -1, // 5, 6
487, 412, // 7, 8
-1, 413, // 9, 10
419, 488, // 11, 12
Expand All @@ -1778,17 +1778,18 @@ int physToGpio_3PLUS[64] =
448, 417, // 21, 22
450, 449, // 23, 24
-1, 418, // 25, 26
415, 414, // 27, 28
416, 482, // 27, 28
478, -1, // 29, 30
475, 480, // 31, 32
422, -1, // 33, 34
489, 476, // 35, 36
483, 486, // 37, 38
-1, 485, // 39, 40
423,

//Padding:
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // ... 56
-1, -1, -1, -1, -1, -1, -1, // ... 63
-1, -1, -1, -1, -1, -1, // ... 63
};

// gpioToGPFSEL:
Expand Down

0 comments on commit c2ce450

Please sign in to comment.