初步修改源码适配蓝莓派
This commit is contained in:
parent
359f5f9b7e
commit
d6e6b3b2d2
61
build
61
build
@ -145,29 +145,30 @@ select_boards()
|
||||
[[ $BOARD == orangepir1plus-lts ]] && BOARD=orangepir1plus-rk3328
|
||||
|
||||
export BOARD="${BOARD}"
|
||||
export BOARD=orangepizero2-h616
|
||||
}
|
||||
|
||||
sudo=${WIRINGPI_SUDO-sudo}
|
||||
|
||||
if [ x$1 = "xclean" ]; then
|
||||
cd wiringPi
|
||||
echo -n "wiringPi: " ; make clean
|
||||
echo -n "wiringPi: " ; make V=1 clean
|
||||
cd ../devLib
|
||||
echo -n "DevLib: " ; make clean
|
||||
echo -n "DevLib: " ; make V=1 clean
|
||||
cd ../gpio
|
||||
echo -n "gpio: " ; make clean
|
||||
echo -n "gpio: " ; make V=1 clean
|
||||
cd ../examples
|
||||
echo -n "Examples: " ; make clean
|
||||
echo -n "Examples: " ; make V=1 clean
|
||||
cd Gertboard
|
||||
echo -n "Gertboard: " ; make clean
|
||||
echo -n "Gertboard: " ; make V=1 clean
|
||||
cd ../PiFace
|
||||
echo -n "PiFace: " ; make clean
|
||||
echo -n "PiFace: " ; make V=1 clean
|
||||
cd ../q2w
|
||||
echo -n "Quick2Wire: " ; make clean
|
||||
echo -n "Quick2Wire: " ; make V=1 clean
|
||||
cd ../PiGlow
|
||||
echo -n "PiGlow: " ; make clean
|
||||
echo -n "PiGlow: " ; make V=1 clean
|
||||
cd ../scrollPhat
|
||||
echo -n "scrollPhat: " ; make clean
|
||||
echo -n "scrollPhat: " ; make V=1 clean
|
||||
cd ../..
|
||||
echo -n "Deb: " ; rm -f debian-template/wiringpi*.deb
|
||||
echo
|
||||
@ -176,11 +177,11 @@ fi
|
||||
|
||||
if [ x$1 = "xuninstall" ]; then
|
||||
cd wiringPi
|
||||
echo -n "wiringPi: " ; $sudo make uninstall
|
||||
echo -n "wiringPi: " ; $sudo make V=1 uninstall
|
||||
cd ../devLib
|
||||
echo -n "DevLib: " ; $sudo make uninstall
|
||||
echo -n "DevLib: " ; $sudo make V=1 uninstall
|
||||
cd ../gpio
|
||||
echo -n "gpio: " ; $sudo make uninstall
|
||||
echo -n "gpio: " ; $sudo make V=1 uninstall
|
||||
exit
|
||||
fi
|
||||
|
||||
@ -193,13 +194,13 @@ if [ x$1 = "xdebian" ]; then
|
||||
rm -rf usr
|
||||
echo "building wiringPi"
|
||||
cd $here/wiringPi
|
||||
make install-deb
|
||||
make V=1 install-deb
|
||||
echo "building devLib"
|
||||
cd $here/devLib
|
||||
make install-deb INCLUDE='-I. -I../wiringPi'
|
||||
make V=1 install-deb INCLUDE='-I. -I../wiringPi'
|
||||
echo "building gpio"
|
||||
cd $here/gpio
|
||||
make install-deb INCLUDE='-I../wiringPi -I../devLib' LDFLAGS=-L../debian-template/wiringPi/usr/lib
|
||||
make V=1 install-deb INCLUDE='-I../wiringPi -I../devLib' LDFLAGS=-L../debian-template/wiringPi/usr/lib
|
||||
echo "Building deb package"
|
||||
cd $here/debian-template
|
||||
fakeroot dpkg-deb --build wiringPi
|
||||
@ -239,53 +240,53 @@ fi
|
||||
echo
|
||||
echo "WiringPi Library"
|
||||
cd wiringPi
|
||||
$sudo make uninstall
|
||||
$sudo make V=1 uninstall
|
||||
if [ x$1 = "xstatic" ]; then
|
||||
make -j5 static
|
||||
make V=1 -j5 static
|
||||
check_make_ok
|
||||
$sudo make install-static
|
||||
$sudo make V=1 install-static
|
||||
else
|
||||
make -j5
|
||||
make V=1 -j5
|
||||
check_make_ok
|
||||
$sudo make install
|
||||
$sudo make V=1 install
|
||||
fi
|
||||
check_make_ok
|
||||
|
||||
echo
|
||||
echo "WiringPi Devices Library"
|
||||
cd ../devLib
|
||||
$sudo make uninstall
|
||||
$sudo make V=1 uninstall
|
||||
if [ x$1 = "xstatic" ]; then
|
||||
make -j5 static
|
||||
make V=1 -j5 static
|
||||
check_make_ok
|
||||
$sudo make install-static
|
||||
$sudo make V=1 install-static
|
||||
else
|
||||
make -j5
|
||||
make V=1 -j5
|
||||
check_make_ok
|
||||
$sudo make install
|
||||
$sudo make V=1 install
|
||||
fi
|
||||
check_make_ok
|
||||
|
||||
echo
|
||||
echo "GPIO Utility"
|
||||
cd ../gpio
|
||||
make -j5
|
||||
make V=1 -j5
|
||||
check_make_ok
|
||||
$sudo make install
|
||||
$sudo make V=1 install
|
||||
check_make_ok
|
||||
|
||||
# echo
|
||||
# echo "wiringPi Daemon"
|
||||
# cd ../wiringPiD
|
||||
# make -j5
|
||||
# make V=1 -j5
|
||||
# check_make_ok
|
||||
# $sudo make install
|
||||
# $sudo make V=1 install
|
||||
# check_make_ok
|
||||
|
||||
# echo
|
||||
# echo "Examples"
|
||||
# cd ../examples
|
||||
# make
|
||||
# make V=1
|
||||
# cd ..
|
||||
|
||||
echo
|
||||
|
132
gpio/OrangePi.c
132
gpio/OrangePi.c
@ -671,79 +671,7 @@ char *physNames [64] =
|
||||
};
|
||||
#endif
|
||||
|
||||
// #ifdef CONFIG_ORANGEPI_ZERO2
|
||||
// int physToWpi [64] =
|
||||
// {
|
||||
// -1, // 0
|
||||
// -1, -1, // 1, 2
|
||||
// 0, -1,
|
||||
// 1, -1,
|
||||
// 2, 3, //7, 8
|
||||
// -1, 4,
|
||||
// 5, 6, //11, 12
|
||||
// 7, -1,
|
||||
// 8, 9, //15, 16
|
||||
// -1, 10,
|
||||
// 11, -1, //19, 20
|
||||
// 12, 13,
|
||||
// 14, 15, //23, 24
|
||||
// -1, 16, // 25, 26
|
||||
// 17, -1,
|
||||
// 18, -1,
|
||||
// 19, -1,
|
||||
// 20, -1,
|
||||
|
||||
// -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // ... 56
|
||||
// -1, // ... 63
|
||||
|
||||
// };
|
||||
|
||||
// char *physNames [64] =
|
||||
// {
|
||||
// NULL,
|
||||
|
||||
// " 3.3V", "5V ",
|
||||
// " SDA.3", "5V ",
|
||||
// " SCL.3", "GND ",
|
||||
// " PC9", "TXD.5 ",
|
||||
// " GND", "RXD.5 ",
|
||||
// " PC6", "PC11 ",
|
||||
// " PC5", "GND ",
|
||||
// " PC8", "PC15 ",
|
||||
// " 3.3V", "PC14 ",
|
||||
// " MOSI.1", "GND ",
|
||||
// " MISO.1", "PC7 ",
|
||||
// " SCLK.1", "CE.1 ",
|
||||
// " GND", "PC10 ",
|
||||
// " PC1", " ",
|
||||
// " PI16", " ",
|
||||
// " PI6", " ",
|
||||
// " PH10", " ",
|
||||
|
||||
|
||||
// NULL, NULL,
|
||||
// NULL, NULL,
|
||||
// NULL, NULL,
|
||||
// NULL, NULL,
|
||||
// NULL, NULL,
|
||||
// NULL, NULL,
|
||||
// NULL, NULL,
|
||||
// NULL, NULL,
|
||||
// NULL, NULL,
|
||||
// NULL, NULL,
|
||||
// NULL, NULL,
|
||||
// NULL, NULL,
|
||||
// NULL, NULL,
|
||||
// NULL, NULL,
|
||||
// NULL, NULL,
|
||||
// NULL, NULL,
|
||||
// NULL, NULL,
|
||||
// NULL,
|
||||
// };
|
||||
// #endif
|
||||
|
||||
#ifdef CONFIG_ORANGEPI_ZERO2
|
||||
// phys = pins
|
||||
int pinToGpioOrangePi [64] =
|
||||
{
|
||||
-1, // 0
|
||||
@ -767,23 +695,14 @@ int pinToGpioOrangePi [64] =
|
||||
258 , 234 ,
|
||||
272 , 260 ,
|
||||
-1 , 259 , // 40
|
||||
-1, -1,
|
||||
-1, -1,
|
||||
-1, -1,
|
||||
-1, -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, -1, -1,
|
||||
-1, -1, -1, -1,-1, // 63
|
||||
};
|
||||
|
||||
int physToWpi[64] =
|
||||
{
|
||||
-1, // 0
|
||||
-1, -1, // 1, 2
|
||||
-1, //0
|
||||
-1, -1, //1, 2
|
||||
3, -1, //3, 4
|
||||
5, -1, //5, 6
|
||||
7, 8, //7, 8
|
||||
@ -795,7 +714,7 @@ int physToWpi[64] =
|
||||
19, -1, //19,20
|
||||
21, 22, //21,22
|
||||
23, 24, //23, 24
|
||||
-1, 26, // 25, 26
|
||||
-1, 26, //25, 26
|
||||
27, 28, //27, 28
|
||||
29, -1, //29, 30
|
||||
31, 32, //31, 32
|
||||
@ -804,7 +723,6 @@ int physToWpi[64] =
|
||||
37, 38, //37, 38
|
||||
-1, 40, //39, 40
|
||||
// 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
|
||||
};
|
||||
@ -813,25 +731,25 @@ char *physNames[64] =
|
||||
{
|
||||
NULL,
|
||||
" 3.3V", "5V ",
|
||||
" TWI1_SDA", "5V ",
|
||||
" TWI1_SCL", "GND ",
|
||||
"I2S0_MCLK", "TX0",
|
||||
" GND", "RX0",
|
||||
" TX5", "I2S_CLK",
|
||||
" RX5", "GND ",
|
||||
" TX4/PWM3", "RX4/PWM4",
|
||||
" 3.3V", "PH4",
|
||||
"SPI1_MOSI", "GND ",
|
||||
"SPI1_MISO", "RX2",
|
||||
" SPI1_CLK", "SPI1_CS0 ",
|
||||
" GND", "SPI1_CS1",
|
||||
" TWI2_SDA", "TWI2_SCL",
|
||||
" PI11", "GND ",
|
||||
" PI12", "LEDC/TX2",
|
||||
" PI10", "5V ",
|
||||
" PI15", "GND ",
|
||||
"I2S0_LRCK", "PH10",
|
||||
" PI16", "I2S0_DOUT",
|
||||
" GND", "I2S0_DIN",
|
||||
" PI12", "PI11 ",
|
||||
" GND", "PI5 ",
|
||||
" PI4", "PI6 ",
|
||||
" PI7", "GND ",
|
||||
" PI16", "PI14 ",
|
||||
" 3.3V", "PI0 ",
|
||||
" PI2", "GND ",
|
||||
" PH8", "PH1 ",
|
||||
" PH0", "PH7 ",
|
||||
" GND", "PH10 ",
|
||||
" PH5", "PH9 ",
|
||||
" PI3", "GND ",
|
||||
" PI9", "PI1 ",
|
||||
" PI13", "GND ",
|
||||
" PH4", "PI8 ",
|
||||
" PH2", "PH6 ",
|
||||
" GND", "PH3 ",
|
||||
NULL, NULL,
|
||||
NULL, NULL,
|
||||
NULL, NULL,
|
||||
@ -1326,7 +1244,7 @@ void OrangePiReadAll(void)
|
||||
for (pin = 1 ; pin <= 13; pin += 2)
|
||||
|
||||
#elif CONFIG_ORANGEPI_ZERO2
|
||||
for (pin = 1 ; pin <= 34; pin += 2)
|
||||
for (pin = 1 ; pin <= 40; pin += 2)
|
||||
#endif
|
||||
readallPhys(pin);
|
||||
|
||||
|
@ -960,15 +960,6 @@ int ORANGEPI_PIN_MASK[12][32] = //[BANK] [INDEX]
|
||||
#ifdef CONFIG_ORANGEPI_ZERO2
|
||||
int pinToGpioOrangePi [64] =
|
||||
{
|
||||
// 229, 228, 73, 226, 227, 70,
|
||||
// 75, 69, 72, 79, 78, 231, 232,
|
||||
// 71, 230, 233, 74, 65, 272, 262,234,
|
||||
|
||||
// // Padding:
|
||||
|
||||
// -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, // ... 63
|
||||
|
||||
-1, // 0
|
||||
-1 , -1 ,
|
||||
264 , -1 ,
|
||||
@ -990,45 +981,12 @@ int pinToGpioOrangePi [64] =
|
||||
258 , 234 ,
|
||||
272 , 260 ,
|
||||
-1 , 259 , // 40
|
||||
-1, -1,
|
||||
-1, -1,
|
||||
-1, -1,
|
||||
-1, -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, -1, -1,
|
||||
-1, -1, -1, -1, -1, // 63
|
||||
};
|
||||
|
||||
int physToGpioOrangePi [64] =
|
||||
{
|
||||
// -1, // 0
|
||||
|
||||
// -1, -1, // 1, 2
|
||||
// 229, -1,
|
||||
// 228, -1,
|
||||
// 73, 226,
|
||||
// -1, 227,
|
||||
// 70, 75,
|
||||
// 69, -1,
|
||||
// 72, 79,
|
||||
// -1, 78,
|
||||
// 231, -1,
|
||||
// 232, 71,
|
||||
// 230, 233,
|
||||
// -1, 74, // 25, 26
|
||||
// 65, -1,
|
||||
// 272, -1,
|
||||
// 262, -1,
|
||||
// 234, -1,
|
||||
|
||||
// -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // ... 56
|
||||
// -1, -1, -1, -1, // ... 63
|
||||
|
||||
-1, // 0
|
||||
-1 , -1 ,
|
||||
264 , -1 ,
|
||||
@ -1050,45 +1008,12 @@ int physToGpioOrangePi [64] =
|
||||
258 , 234 ,
|
||||
272 , 260 ,
|
||||
-1 , 259 , // 40
|
||||
-1, -1,
|
||||
-1, -1,
|
||||
-1, -1,
|
||||
-1, -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, -1, -1,
|
||||
-1, -1, -1, -1, -1, // 63
|
||||
} ;
|
||||
|
||||
int physToPinOrangePi [64] =
|
||||
{
|
||||
|
||||
// -1, // 0
|
||||
// -1, -1, // 1, 2
|
||||
// 0, -1,
|
||||
// 1, -1,
|
||||
// 2, 3, //7, 8
|
||||
// -1, 4,
|
||||
// 5, 6, //11, 12
|
||||
// 7, -1,
|
||||
// 8, 9, //15, 16
|
||||
// -1, 10,
|
||||
// 11, -1, //19, 20
|
||||
// 12, 13,
|
||||
// 14, 15, //23, 24
|
||||
// -1, 16, // 25, 26
|
||||
// 17, -1,
|
||||
// 18, -1,
|
||||
// 19, -1,
|
||||
// 20, -1,
|
||||
|
||||
// -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // ... 56
|
||||
// -1, // ... 63
|
||||
|
||||
-1, // 0
|
||||
-1, -1, // 1, 2
|
||||
3, -1, //3, 4
|
||||
@ -1117,20 +1042,7 @@ int physToPinOrangePi [64] =
|
||||
|
||||
int ORANGEPI_PIN_MASK[12][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,},//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
|
||||
// {-1, 1,-1,-1,-1, 5, 6, 7, 8, 9,10,11,-1,-1,14,15,-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,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,},//PD
|
||||
// {-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,},//PE
|
||||
// {-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,},//PF
|
||||
// {-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,},//PG
|
||||
// {-1,-1, 2,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