GPIO, SPI and I2C C++ Lib
#1
Star 
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.
Master's degree in Computer Science. Teacher technical-practical computering at #Miur. Research Interests: Web tecnologies and programming cross-platform
https://twitter.com/Dat4BIT
http://www.danielecontarino.it
  Reply
#2
Nice work ;-)

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

I will have a closer look over the weekend...
Come have a chat in the Pine IRC channel >>
  Reply
#3
(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
marcushh777    Cool

please join us for a chat @  irc.pine64.xyz:6667   or ssl  irc.pine64.xyz:6697

( I regret that I am not able to respond to personal messages;  let's meet on irc! )
  Reply
#4
I'm glad you like it!! Smile
Master's degree in Computer Science. Teacher technical-practical computering at #Miur. Research Interests: Web tecnologies and programming cross-platform
https://twitter.com/Dat4BIT
http://www.danielecontarino.it
  Reply
#5
(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!
  Reply
#6
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
By. Zoidiano0!
Installed:
LAMP: Linux , Apache2.4 , Mariadb, phpMyadmin, PHP5 
Java 8 arm by oracle
Netbeans 8.1
chromium (uses way toooo much Ram)

Pine64 Head Unit Project.!
  Reply
#7
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.
  Reply
#8
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!
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  RPi.GPIO python module for Pine A64/A64+ aquilegia 98 147,576 10-26-2024, 07:17 AM
Last Post: Garesdq1d
  fm transmitter with gpio weasel18 2 5,443 09-10-2019, 04:28 AM
Last Post: desai_amogh
  How to use dts or other setup to declare gpio pin Interrupt (e.g. a button)? dkebler 1 3,967 06-12-2019, 10:37 AM
Last Post: dkebler
Lightbulb Sample GPIO codes highlighting RPi.GPIO-PineA64 and the PI bus MarkHaysHarris777 6 12,324 06-07-2019, 12:37 AM
Last Post: tllim
Information Howto: Controlling Pine64 GPIO via the filesystem (sysfs) on linux pfeerick 4 12,745 01-24-2019, 03:36 AM
Last Post: Fifth
  GPIO and SPI SamR1 20 34,920 03-15-2018, 10:32 AM
Last Post: jomoengineer
Question GPIO shockr 7 16,236 03-11-2018, 01:52 AM
Last Post: jomoengineer
  Read GPIO problem shworker 14 23,744 08-17-2017, 01:21 PM
Last Post: martinayotte
  GPIO fiq capability joseph 3 6,762 11-10-2016, 06:07 PM
Last Post: joseph
  RPI2-GPIO mus1c 6 10,212 09-22-2016, 05:28 AM
Last Post: mus1c

Forum Jump:


Users browsing this thread: 1 Guest(s)