Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add fan control pin for OrangePi 3B #121

Open
wants to merge 2 commits into
base: next
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions gpio/readall.c
Original file line number Diff line number Diff line change
Expand Up @@ -1567,9 +1567,10 @@ static int physToWpi_3B[64] =
23, 24, //35,36
25, 26, //37,38
-1, 27, //39,40
28, -1, //fan,+5V

// 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, -1, -1, -1, -1, -1, -1, -1, // ... 56
-1, -1, -1, -1, -1, -1, -1, // ... 63
};

Expand Down Expand Up @@ -1621,6 +1622,7 @@ static char * physNames_3B[64] =
"GPIO3_D0", "GPIO3_D5",
"GPIO3_D3", "GPIO3_D2",
" GND", "GPIO3_D1",
"GPIO0_C6", "+5V(FAN)",
};

static int physToWpi_3PLUS[64] =
Expand Down Expand Up @@ -2136,6 +2138,10 @@ void OrangePiReadAll(int model)

switch (model)
{
case PI_MODEL_3B:
for (pin = 1 ; pin <= 42; pin += 2)
readallPhys(pin);
break;
case PI_MODEL_H3:
case PI_MODEL_RK3399:
case PI_MODEL_4:
Expand All @@ -2149,7 +2155,6 @@ void OrangePiReadAll(int model)
case PI_MODEL_AI_MAX:
case PI_MODEL_900:
case PI_MODEL_CM4:
case PI_MODEL_3B:
case PI_MODEL_ZERO_2_W:
case PI_MODEL_3_PLUS:
case PI_MODEL_AI_PRO:
Expand Down
13 changes: 7 additions & 6 deletions wiringPi/wiringPi.c
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ static int ORANGEPI_PIN_MASK_RV[5][32] = //[BANK] [INDEX]

static int ORANGEPI_PIN_MASK_3B[5][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, 0, 1,-1,-1,-1,-1,-1,-1,},//GPIO0
{-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1, 6,-1, 0, 1,-1,-1,-1,-1,-1,-1,},//GPIO0
{ 0, 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,},//GPIO1
{-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,},//GPIO2
{-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7,},//GPIO3
Expand Down Expand Up @@ -1080,7 +1080,7 @@ int pinToGpio_CM5[64] =
40, 41, // 0, 1
42, 43, // 2, 3
44, 45, // 4 5
138, 139, // 6, 7
138, 139, // 6, 7
-1, -1, // 8, 9
-1, -1, //10,11
-1, -1, //12,13
Expand Down Expand Up @@ -1187,7 +1187,7 @@ int pinToGpio_5PLUS[64] =
-1, -1, //30,31

-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // ... 47
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,// ... 63
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // ... 63
};

int pinToGpio_AIMAX[64] =
Expand Down Expand Up @@ -1263,7 +1263,7 @@ int pinToGpio_3B[64] =
{
140,141, // 0, 1
147, 25, // 2, 3
24, 118, // 4 5
24, 118, // 4, 5
119,128, // 6, 7
130,131, // 8, 9
129,138, //10,11
Expand All @@ -1275,7 +1275,7 @@ int pinToGpio_3B[64] =
127,120, //22,23
125,123, //24,25
122,121, //26,27
-1, -1, //28,29
22, -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 @@ -2197,9 +2197,10 @@ int physToGpio_3B[64] =
120,125, // 35, 36
123,122, // 37, 38
-1, 121, // 39, 40
22, -1, // fan, +5V

//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, -1, -1, -1, -1, -1, -1, -1, // ... 56
-1, -1, -1, -1, -1, -1, -1, // ... 63
};

Expand Down