From ffe49f558e7173ef9c5b06908dba343a0a9dbe60 Mon Sep 17 00:00:00 2001 From: Dmitry Mikushin Date: Wed, 1 Feb 2023 17:09:10 +0000 Subject: [PATCH 1/2] Changing debian arch to arm64 --- debian-template/wiringPi/DEBIAN/control | 2 +- debian/control | 6 +++--- newVersion | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/debian-template/wiringPi/DEBIAN/control b/debian-template/wiringPi/DEBIAN/control index 1041c5e..283569c 100644 --- a/debian-template/wiringPi/DEBIAN/control +++ b/debian-template/wiringPi/DEBIAN/control @@ -2,7 +2,7 @@ Package: wiringPi Version: 2.46 Section: libraries Priority: optional -Architecture: armhf +Architecture: arm64 Depends: libc6 Maintainer: Boby Lee Description: The wiringPi libraries for the OrangePi, headers and gpio command diff --git a/debian/control b/debian/control index 1d6d228..5f33b7b 100644 --- a/debian/control +++ b/debian/control @@ -8,20 +8,20 @@ Build-Depends: debhelper (>= 8) Package: libwiringpi2 Section: libs -Architecture: armhf +Architecture: arm64 Depends: ${shlibs:Depends}, ${misc:Depends} Description: GPIO librariees for Raspberry Pi (runtime). Runtime for the popular wiringPi library. Package: wiringpi -Architecture: armhf +Architecture: arm64 Depends: ${shlibs:Depends}, ${misc:Depends} Description: gpio utility for Raspberry Pi The wiringPi gpio command line utility, for GPIO access on a Raspberry Pi from the command line. Package: libwiringpi-dev -Architecture: armhf +Architecture: arm64 Depends: libwiringpi2 (= ${binary:Version}), libc6-dev, ${misc:Depends} Suggests: wiringpi Description: GPIO development library for Raspberry Pi diff --git a/newVersion b/newVersion index ed4b438..4d4ece0 100755 --- a/newVersion +++ b/newVersion @@ -38,7 +38,7 @@ Package: wiringpi Version: `cat VERSION` Section: libraries Priority: optional -Architecture: armhf +Architecture: arm64 Depends: libc6 Maintainer: Gordon Henderson Description: The wiringPi libraries, headers and gpio command From a0e64d1b69f2060905d2ae92808471fa5189e542 Mon Sep 17 00:00:00 2001 From: Dmitry Mikushin Date: Sat, 28 Aug 2021 05:30:02 +0200 Subject: [PATCH 2/2] Adding beginner's example on using PD15 in OrangePi 3 --- examples/pd15.c | 63 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 examples/pd15.c diff --git a/examples/pd15.c b/examples/pd15.c new file mode 100644 index 0000000..e5c6f52 --- /dev/null +++ b/examples/pd15.c @@ -0,0 +1,63 @@ +#include + +#include +#include +#include +#include + +#if 0 + +------+-----+----------+------+---+ OPi 3 +---+------+----------+-----+------+ + | GPIO | wPi | Name | Mode | V | Physical | V | Mode | Name | wPi | GPIO | + +------+-----+----------+------+---+----++----+---+------+----------+-----+------+ + | | | 3.3V | | | 1 || 2 | | | 5V | | | + | 122 | 0 | SDA.0 | OFF | 0 | 3 || 4 | | | 5V | | | + | 121 | 1 | SCL.0 | OFF | 0 | 5 || 6 | | | GND | | | + | 118 | 2 | PWM.0 | OFF | 0 | 7 || 8 | 0 | OFF | PL02 | 3 | 354 | + | | | GND | | | 9 || 10 | 0 | OFF | PL03 | 4 | 355 | + | 120 | 5 | RXD.3 | ALT4 | 0 | 11 || 12 | 0 | OFF | PD18 | 6 | 114 | + | 119 | 7 | TXD.3 | ALT4 | 0 | 13 || 14 | | | GND | | | + | 362 | 8 | PL10 | OFF | 0 | 15 || 16 | 0 | OFF | PD15 | 9 | 111 | + | | | 3.3V | | | 17 || 18 | 0 | OFF | PD16 | 10 | 112 | + | 229 | 11 | MOSI.1 | ALT2 | 0 | 19 || 20 | | | GND | | | + | 230 | 12 | MISO.1 | ALT2 | 0 | 21 || 22 | 0 | OFF | PD21 | 13 | 117 | + | 228 | 14 | SCLK.1 | ALT2 | 0 | 23 || 24 | 0 | ALT2 | CE.1 | 15 | 227 | + | | | GND | | | 25 || 26 | 0 | OFF | PL08 | 16 | 360 | + +------+-----+----------+------+---+----++----+---+------+----------+-----+------+ + | GPIO | wPi | Name | Mode | V | Physical | V | Mode | Name | wPi | GPIO | + +------+-----+----------+------+---+ OPi 3 +---+------+----------+-----+------+ +#endif + +#define PD15_PIN 9 + +static void usage(const char* argv0) +{ + printf("Usage: %s \n", argv0); + exit(1); +} + +int main(int argc, char* argv[]) +{ + printf ("OrangePi Pi wiringPi PD15 test program\n"); + + if (argc != 2) usage(argv[0]); + + int mode = 0; + if (!strcmp(argv[1], "on")) + mode = HIGH; + else if (!strcmp(argv[1], "off")) + mode = LOW; + else + usage(argv[0]); + + if (wiringPiSetup() == -1) + { + fprintf(stderr, "Error setting up wiringPi\n"); + return -1; + } + + pinMode(PD15_PIN, OUTPUT); + digitalWrite(PD15_PIN, mode); + + return 0; +} +