PINE64

Full Version: GPIO, SPI and I2C C++ Lib
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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.
Nice work ;-)

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

I will have a closer look over the weekend...
(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
I'm glad you like it!! Smile
(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!
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


Sent from my Moto G (4) using Tapatalk
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.
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!