PINE64
read/write gpio in c example? - Printable Version

+- PINE64 (https://forum.pine64.org)
+-- Forum: PINE A64(+) (https://forum.pine64.org/forumdisplay.php?fid=4)
+--- Forum: General Discussion on PINE A64(+) (https://forum.pine64.org/forumdisplay.php?fid=3)
+--- Thread: read/write gpio in c example? (/showthread.php?tid=4796)



read/write gpio in c example? - ealbers - 07-23-2017

Can someone please point me to where theres a simple GPIO example in C?

Is the GPIO memory mapped somewhere?  I need to read/write the pins at very high speed, so I'd like access as close to the hardware as possible.
Thanks


RE: read/write gpio in c example? - MarkHaysHarris777 - 07-23-2017

(07-23-2017, 05:46 AM)ealbers Wrote: Can someone please point me to where theres a simple GPIO example in C?

Is the GPIO memory mapped somewhere?  I need to read/write the pins at very high speed, so I'd like access as close to the hardware as possible.
Thanks

see this link for C++ library

see this link for python gpio control

Both links are useful for C.  The Python module is a wrapper;  the underlying C code is useful.  The C++ library is a good start too.  Yes, the gpio(s) are mapped in /dev/mem

Please see the A64 datasheet, and the A64 user manual also.