PINE64
GPIO, SPI and I2C C++ Lib - 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: GPIO, SPI and I2C C++ Lib (/showthread.php?tid=4471)



GPIO, SPI and I2C C++ Lib - databit - 04-20-2017

Hi to everyone! I'm a CS teacher and for some time I playing with my Pine64+. Last week, I built a C++ library (in object oriented paradigm) for manage GPIO, I2C and SPI.


https://github.com/databit/Pine64-CPP


This lib is based on the work of Eric Ptak <trouch@trouch.com>, Stefan Mavrodiev <support@olimex.com> and Kamil Trzcinski <ayufan@ayufan.eu>

I hope this library can be of help to you!

Send me yours comments and eventual bugs.


RE: GPIO, SPI and I2C C++ Lib - xalius - 04-20-2017

Nice work ;-)

Thanks for taking the time to post this to the forums too...

I will have a closer look over the weekend...


RE: GPIO, SPI and I2C C++ Lib - MarkHaysHarris777 - 04-21-2017

(04-20-2017, 04:00 PM)databit Wrote: Hi to everyone! I'm a CS teacher and for some time I playing with my Pine64+. Last week, I built a C++ library (in object oriented paradigm) for manage GPIO, I2C and SPI.


https://github.com/databit/Pine64-CPP

Thanks so much, really 'preciate the effort;  will take a look closer this weekend, thanks for posting !

Shy


RE: GPIO, SPI and I2C C++ Lib - databit - 04-21-2017

I'm glad you like it!! Smile


RE: GPIO, SPI and I2C C++ Lib - ealbers - 05-01-2017

(04-20-2017, 04:00 PM)databit Wrote: Hi to everyone! I'm a CS teacher and for some time I playing with my Pine64+. Last week, I built a C++ library (in object oriented paradigm) for manage GPIO, I2C and SPI.


https://github.com/databit/Pine64-CPP


This lib is based on the work of Eric Ptak <trouch@trouch.com>, Stefan Mavrodiev <support@olimex.com> and Kamil Trzcinski <ayufan@ayufan.eu>

I hope this library can be of help to you!

Send me yours comments and eventual bugs.

Very cool!  Does anyone know exactly how many IO lines you can use as general purpose IO on the PINE64??

My sons science fair project needs 192 IO lines (96 in, 96 out) and we are trying to figure out how many Pine's to buy, the IO is straight digital signals going to high speed DAC and ADC's
Thanks!


RE: GPIO, SPI and I2C C++ Lib - Zoidiano0 - 05-01-2017

Maybe u can use io expansion ic's and control them via spi or i2c

Sent from my Moto G (4) using Tapatalk

Good job with lt he library and so far it's have be n fun still working to make it work with some devices that I have but works good thanks @databit


Sent from my Moto G (4) using Tapatalk


RE: GPIO, SPI and I2C C++ Lib - jomoengineer - 03-18-2018

I've grabbed the files from github and the sample works fine.  It is intersting that there seems to be some similarities to what Derek Molloy had done for the Raspberry Pi but I do like the use of "/dev/gpiomem" to avoid having to be root when accessing the gpio pins.  Is there a reason why there are still references for the Raspberry Pi hardware "BCM2708" instead of the Pine64 harware?
Are there any SPI and i2c examples for this?

Thanks.


RE: GPIO, SPI and I2C C++ Lib - Jeff R - 02-04-2019

Just in case someone is still following this old post, I created a new thread regarding segmentation faults I am getting while trying to use the Pine64-cpp library.

https://forum.pine64.org/showthread.php?tid=7126
Thanks!