![]() |
RPi.GPIO with C - Printable Version +- PINE64 (https://forum.pine64.org) +-- Forum: PINE A64(+) (https://forum.pine64.org/forumdisplay.php?fid=4) +--- Forum: Pine A64 Hardware, Accessories and POT (https://forum.pine64.org/forumdisplay.php?fid=32) +---- Forum: Pi2, Euler and Exp GPIO Ports (https://forum.pine64.org/forumdisplay.php?fid=34) +---- Thread: RPi.GPIO with C (/showthread.php?tid=2020) |
RPi.GPIO with C - Wolfenstein - 08-14-2016 Related to this thread http://forum.pine64.org/showthread.php?tid=723 I am trying to build and use the functions in C. I copied all files from RPi.GPIO-PineA64/source and I made these files test.c Code: #include "c_gpio.h" Code: HEADERS = test.h c_gpio.h Code: int testfunktion(void) And I get this compile error: Code: $ make RE: RPi.GPIO with C - MarkHaysHarris777 - 08-14-2016 Wolfenstein, I am so pleased to see you working on this. ... this is a very good step towards porting pigpio from Raspberry PI over to PineA64. Also, the more you understand about the RPi.GPIO-PinA64 source, the better we'll be positioned to implement a working i2S SPI i2c, and soft PWM. Keep at it... I will also look at what you are proposing this next week--- keep working on it ! As long as we're sharing failures, i opened up the device-tree-compiler dtc and removed all references to spwm PL10 to see if by disabling that in the dtb we could reclaim pin(7) GPIO04. No luck so far... i removed the references and recompiled the dtb (with appropriate renaming) but there is a driver in there that I need to disable too... so I still don't have GPII04 working yet... Stay in touch on this thread. tnx RE: RPi.GPIO with C - martinayotte - 08-15-2016 The "pinea64_found" variable is located in RPi.GPIO-PineA64-master/source/cpuinfo.c and initialized to 1 if the identified board is a PineA64. You can bypass that code by simply adding a global variable "int pinea64_found = 1;" somewhere in your code. RE: RPi.GPIO with C - KnReLe - 08-22-2016 (08-14-2016, 02:35 PM)MarkHaysHarris777 Wrote: Wolfenstein, I am so pleased to see you working on this. Could it be that the reason for the PL10 («GPIO4» on the PI-2-Bus pin #7) is in a different Peripheral area. I went in and tried the code discussed in the thread «C GPIO» http://forum.pine64.org/showthread.php?tid=1327 and noticed that while it worked as expected for all the ports in the PB-PH series, the PL ones wouldn't move. The reason that I found for that is that PB thru PH are all in the registers beginning at 0x01c20800 (defined as the SW_PORTC_IO_BASE) while the PL ports are in a similar data structure in a different location, at 0x01f02c00. I found those addresses in the sections 3.21.1 and 3.22.1 in the Allwinner_A64_User_Manual_V1.0.pdf When I re-used the code with this alternate IO base address, I could get the test-program (flash an LED on PL10) to work as expected. Have similar problems shown up with PL9 and PL8 (PI-2-Bus pins 27 and 28)? It might be something else, but having just seen a similar-looking problem here, I thought maybe this is the solution. RE: RPi.GPIO with C - MarkHaysHarris777 - 08-22-2016 Nice work. That explains why just disabling the PL10 pin in the dts does not allow the pin to work as a PI bus IN|OUT pin, because the base register is different (very nice). |