Permalink
Browse files

Modify GPIO mapping for OrangePi Zero.

  • Loading branch information...
masa-a committed Mar 12, 2017
1 parent bb25d2d commit 43b67a2f3d7b525615ce43d058c5e1fba477137f
Showing with 24 additions and 54 deletions.
  1. +3 −0 .vscode/settings.json
  2. +4 −37 README.md
  3. +17 −17 wiringPi/wiringPi.c
View
@@ -0,0 +1,3 @@
+{
+ "files.associations": {}
+}
View
@@ -1,45 +1,12 @@
-# wiringBP README
+# WiringOP for OrangePi Zero
+This is a modified WiringPi for OrangePi Zero. Since original WiringOP is not fully compatible with OrangePi Zero, GPIO mapping has been modified for OrangePi Zero.
+Only use wiringPiSetupPhys() to setup WiringOp because only Pyhs mapping is valid.
-This is a modified WiringPi for OrangePi. We call it WiringOP.
-Test fo Orangepi pc
+Not fully tested but so far ISR on 6 pin(UART2_TX/PA00) doesn't work.
-## Download
-### For Orangepi Pi
- git clone https://github.com/zhaolei/WiringOP.git -b h3
## Installation
cd WiringOP
chmod +x ./build
sudo ./build
-```
-orangepi@orangepi:~$ gpio readall
- +-----+-----+----------+------+---+--OrangePiPC--+---+------+---------+-----+--+
- | BCM | wPi | Name | Mode | V | Physical | V | Mode | Name | wPi | BCM |
- +-----+-----+----------+------+---+----++----+---+------+----------+-----+-----+
- | | | 3.3v | | | 1 || 2 | | | 5v | | |
- | 2 | -1 | SDA.0 | | | 3 || 4 | | | 5V | | |
- | 3 | -1 | SCL.0 | | | 5 || 6 | | | 0v | | |
- | 4 | 6 | IO6 PA06 | OUT | 0 | 7 || 8 | | | TxD3 | | |
- | | | 0v | | | 9 || 10 | | | RxD3 | | |
- | 17 | -1 | RxD2 | | | 11 || 12 | 0 | OUT | IO1 PD14 | 1 | 18 |
- | 27 | -1 | TxD2 | | | 13 || 14 | | | 0v | | |
- | 22 | -1 | CTS2 | | | 15 || 16 | 0 | OUT | IO4 PC04 | 4 | 23 |
- | | | 3.3v | | | 17 || 18 | 0 | OUT | IO5 PC07 | 5 | 24 |
- | 10 | -1 | MOSI | | | 19 || 20 | | | 0v | | |
- | 9 | -1 | MISO | | | 21 || 22 | | | RTS2 | | |
- | 11 | -1 | SCLK | | | 23 || 24 | | | SPI-CE0 | | |
- | | | 0v | | | 25 || 26 | | | CE1 | | |
- | 0 | -1 | SDA.1 | | | 27 || 28 | | | SCL.1 | | |
- | 5 | 7 | IO7 PA7 | OUT | 0 | 29 || 30 | | | 0v | | |
- | 6 | 8 | IO8 PA8 | OUT | 0 | 31 || 32 | 0 | OUT | IO9 PG08 | 9 | 12 |
- | 13 | 10 | IO10 PA9 | OUT | 0 | 33 || 34 | | | 0v | | |
- | 19 | 12 | IO12PA10 | OUT | 0 | 35 || 36 | 0 | OUT | IO13PG09 | 13 | 16 |
- | 26 | 14 | IO14PA20 | OUT | 0 | 37 || 38 | 0 | OUT | IO15PG06 | 15 | 20 |
- | | | 0v | | | 39 || 40 | 0 | OUT | IO16PG07 | 16 | 21 |
- +-----+-----+----------+------+---+----++----+---+------+----------+-----+-----+
- | BCM | wPi | Name | Mode | V | Physical | V | Mode | Name | wPi | BCM |
- +-----+-----+----------+------+---+--OrangePIPC--+------+----------+-----+-----+
-```
-Thanks!
-
View
@@ -749,23 +749,23 @@ static int physToGpio_BP [64] =
-1, -1, // 1, 2
12, -1, // 3, 4
11, -1, // 5, 6
- 6, 13, // 7, 8
- -1, 14, // 9, 10
- 1, 110, //11, 12
+ 6, 0xC6, // 7, 8
+ -1, 0xC7, // 9, 10
+ 1, 7, //11, 12
0, -1, //13, 14
- 3, 68, //15, 16
- -1, 71, //17, 18
- 64, -1, //19, 20
- 65, 2, //21, 22
- 66, 67, //23, 24
- -1, 21, //25, 26
- 19, 18, //27, 28
- 7, -1, //29, 30
- 8, 200, //31, 32
- 9, -1, //33, 34
- 10, 201, //35, 36
- 20, 198, //37, 38
- -1, 199, //39, 40
+ 3, 19, //15, 16
+ -1, 18, //17, 18
+ 15, -1, //19, 20
+ 16, 2, //21, 22
+ 14, 13, //23, 24
+ -1, 10, //25, 26
+ -1, -1, //27, 28
+ -1, -1, //29, 30
+ -1, -1, //31, 32
+ -1, -1, //33, 34
+ -1, -1, //35, 36
+ -1, -1, //37, 38
+ -1, -1, //39, 40
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, //41-> 55
-1, -1, -1, -1, -1, -1, -1, -1 // 56-> 63
} ;
@@ -889,7 +889,7 @@ static int BP_PIN_MASK[9][32] = //[BANK] [INDEX]
// guenter anfang ... welche pins werden freigegeben .. -1 = gesperrt
static int BP_PIN_MASK[9][32] = //[BANK] [INDEX]
{
- { 0, 1, 2, 3,-1,-1, 6, 7, 8, 9,10,11,12,13,14,-1,-1,-1,18,19,20,21,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,},//PA
+ { 0, 1, 2, 3,-1,-1, 6, 7, 8, 9,10,11,12,13,14,15,16,17,18,19,20,21,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,},//PA
{-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,},//PB
{ 0, 1, 2, 3, 4,-1,-1, 7,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,},//PC
{-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,14,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,},//PD

0 comments on commit 43b67a2

Please sign in to comment.