smblackledge
Posts: 8
Joined: Mon Jan 12, 2015 6:56 pm

GPIO API documentation

Tue Mar 21, 2017 9:36 pm

Where can I get a complete description of the GPIO API, preferably for both Python and C/C++? I have found either the most cursory description of a couple of functions or programs which show only what is needed for the program to use.

mattmiller
Posts: 2236
Joined: Thu Feb 05, 2015 11:25 pm

Re: GPIO API documentation

Tue Mar 21, 2017 9:45 pm

There are at least 4 Python GPIO libraries in common use RPi.GPIO, wiringPi, pigpio and GPIOZero and each person/team that supplies them provides quite a bit of documentation.

I don't normally suggest this but I think you need to try this http://lmgtfy.com/?q=rpi.gpio

smblackledge
Posts: 8
Joined: Mon Jan 12, 2015 6:56 pm

Re: GPIO API documentation

Wed Mar 22, 2017 5:38 am

Hi Matt,

I thank you for the information you gave me. Unfortunately, you had to be insulting by assuming I didn't look for the GPIO API documentation and gave me a link to something like lmgtfy. I used the Bing search string "raspberry pi gpio api" and "raspberry pi gpio api documentation". I also continued on by actually clicking on the links and examining the search results. I apparently made the unforgivable sin of not using the same search string that you used. Please forgive me, oh search string expert.

What did I find from my sites? I found non-coding sites that gave almost no information, along with coding sites that showed the calls they needed to do their program functions and not a lot of other information. This is why I asked for sites to help me find the information myself, not to have you do the work for me.

Anyway, I'm glad you replied. Just wish you could think better of people that ask for help.

User avatar
rpdom
Posts: 17029
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: GPIO API documentation

Wed Mar 22, 2017 6:40 am

Actually Matt was trying to be helpful by pointing out that there is no single API for GPIO, but a variety of libraries that people have written. He helpfully provided one useful search term (as find the right one can be difficult) which will probably link to handy articles like this one https://www.raspberrypi.org/blog/gpio-z ... computing/ You may well find that gpiozero is already installed.

There is also the WiringPi API, which is designed to be similar to the Adruino "Wiring" scheme.

mattmiller
Posts: 2236
Joined: Thu Feb 05, 2015 11:25 pm

Re: GPIO API documentation

Wed Mar 22, 2017 6:44 am

Like I say - I don't normally do it but I was amazed you'd not managed to turn up some useful info.

I find (and this is genuine advice) that
1. Bing isn't much good

2. Use less terms when searching e.g raspberry gpio

Also, your OP came across as quite arrogant with your going to the trouble of putting "complete" in bold letters (and use of word "cursory" )

But your right - I shouldn't have been smarmy - sorry :)

User avatar
gordon@drogon.net
Posts: 2020
Joined: Tue Feb 07, 2012 2:14 pm
Location: Devon, UK
Contact: Website

Re: GPIO API documentation

Wed Mar 22, 2017 7:06 am

smblackledge wrote:Where can I get a complete description of the GPIO API, preferably for both Python and C/C++? I have found either the most cursory description of a couple of functions or programs which show only what is needed for the program to use.
There is no one "GPIO API"... There are many different GPIO libraries and many more wrappers for different languages that use these underlying libraries.

Most of the GPIO libraries are written and maintained by enthusiasts in our own time, so sometimes complete documentation is a little lacking. However the source code is fully available for both main C libraries; wiringPi (mine) and pigpio, so in times of desperation, that's the place you look.

-Gordon
--
Gordons projects: https://projects.drogon.net/

smblackledge
Posts: 8
Joined: Mon Jan 12, 2015 6:56 pm

Re: GPIO API documentation

Fri Mar 24, 2017 7:29 am

Matt,

Just asking for the sake of discussion, not because I'm ticked or anything.

I'm curious as to how you believe I should have made my OP. First, I'd suggest for you to assume the poster is not mad/sarcastic/arrogant/etc. This is certainly true in my case. At least I believe I am none of those. Second, based on how little I found given my search strings, I would have no problem with the word "complete", bolded or not. It does clarify the type of response I really am looking for. Lastly, what is wrong with the word "cursory"? I believe it means "brief" which, again, describes the information that I did find. I mean, jeez, do you really need to be critical of a word I chose?

Given all of the above, do you still think my post was arrogant or is it that you were a bit thin-skinned? Btw, I could try using more than one search engine but I just don't like dealing with a company that tracks everything we type.

Scott

mattmiller
Posts: 2236
Joined: Thu Feb 05, 2015 11:25 pm

Re: GPIO API documentation

Fri Mar 24, 2017 7:51 am

I'm curious as to how you believe I should have made my OP.
cutting out on complete and cursory

Where can I get a description of the GPIO API, preferably for both Python and C/C++? I have only found the description of a couple of functions or programs which show only what is needed for the program to use.

or a very nice one

Hello,

I'm starting off using my Raspberry Pi but i'm struggling to find out information on the GPIO API (for both Python and C/C++)
I've found examples of programs that use it but I can't find the main source on the API
Can anyone help me please?

The thing that made me give a smarmy answer was the mainly the word "complete" in bold - it came across as DEMANDING EVERYTHING

Remember, with text - no-one knows what an OP intentions/thoughts are - people only go on what they think the OP is meaning

Anyway - hope you've got some useful information from all of this :)
Last edited by mattmiller on Fri Mar 24, 2017 8:37 am, edited 1 time in total.

mattmiller
Posts: 2236
Joined: Thu Feb 05, 2015 11:25 pm

Re: GPIO API documentation

Fri Mar 24, 2017 7:52 am

I could try using more than one search engine but I just don't like dealing with a company that tracks everything we type.
I'd recommend DuckDuckGo in that case

User avatar
bensimmo
Posts: 4577
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: GPIO API documentation

Fri Mar 24, 2017 9:18 am

To be honest, it would have been better to have just read matts post and just said thanks. It was just trying to be helpful.
On a forum like this, there are all levels from first time users, to writing everything from scratch themselves.


Anyway as other may also find this on a search
Python/C and other PiGPIO http://abyz.co.uk/rpi/pigpio/ Everything under the sun as far as I can see, you'll just need to rummage around and read the source code or look for user Joan.

Python then GPIOZero https://gpiozero.readthedocs.io/ in house RaspberryPi simplified usage and can also be a wrapper for all the other's mentioned.

WiringPi as the bloke up there ^ http://wiringpi.com/ I've never looked at so cannot comment.
rpi.gpio https://sourceforge.net/p/raspberry-gpi ... wiki/Home/ but just examples shown, used by many though.

and I'm sure others may crop up. But these are probably the main ones. Fully complete, have to work it out or read the source to get what you need is just the way it is at the moment.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 26442
Joined: Sat Jul 30, 2011 7:41 pm

Re: GPIO API documentation

Fri Mar 24, 2017 10:44 am

Just use Google, they don't give a damn about what you search for, they just use it to serve targeted ads, and they have the best search engine.

and for REAL documentation on the GPIO's, read this...

https://www.raspberrypi.org/wp-content/ ... herals.pdf


In other news to everyone posting, keep it polite. Problem with a post? Don't whinge in a post, that never helps, report.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

User avatar
DougieLawson
Posts: 38882
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: GPIO API documentation

Fri Mar 24, 2017 12:32 pm

jamesh wrote:Just use Google, they don't give a damn about what you search for, they just use it to serve targeted ads, and they have the best search engine.
Try using the Google App on your phone, they're doing more than you think. They read my email and tell me interesting things (that parcel is out for delivery, you need to check in for flight EY12, you've got a hotel booked for 1st April, etc.). They may not give a damn but they are trawling every last thing they see that belongs to me.

There's no way to avoid Google collecting that stuff, it can be useful and, personally, I don't give two hoots about the privacy thing (as long as the Google App is useful).

The tin-foil hat brigade are going to see Google as 1984 turned into a distopian reality and be exceedingly paranoid, we can't avoid those wonks thinking that way and bleating about it on public forums.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 26442
Joined: Sat Jul 30, 2011 7:41 pm

Re: GPIO API documentation

Fri Mar 24, 2017 1:26 pm

DougieLawson wrote:
jamesh wrote:Just use Google, they don't give a damn about what you search for, they just use it to serve targeted ads, and they have the best search engine.
Try using the Google App on your phone, they're doing more than you think. They read my email and tell me interesting things (that parcel is out for delivery, you need to check in for flight EY12, you've got a hotel booked for 1st April, etc.). They may not give a damn but they are trawling every last thing they see that belongs to me.

There's no way to avoid Google collecting that stuff, it can be useful and, personally, I don't give two hoots about the privacy thing (as long as the Google App is useful).

The tin-foil hat brigade are going to see Google as 1984 turned into a distopian reality and be exceedingly paranoid, we can't avoid those wonks thinking that way and bleating about it on public forums.
'Reading' in my view implies understanding - that doesn't seem to me what they do as that need AI. They keyword search, and use the results, but they don't 'understand' the content.

Yet.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

smblackledge
Posts: 8
Joined: Mon Jan 12, 2015 6:56 pm

Re: GPIO API documentation

Fri Mar 24, 2017 9:14 pm

Matt,

I believe you are a good person and have a lot to offer this site. You did offer valuable information and I appreciate it. You do need to lighten up a bit, though. Granted, I asked for your opinion, but you read a really polite post, one that explained what I was asking about (a complete set of docs) and to some degree, why (what I already found was cursory), insulted me (you already apologized, thank you), and then criticized my using those two words. The alternative post that you suggested added nothing and accomplished nothing other than to avoid those two words and, of course, making the post both longer and more pleading/sucking up. Should being direct and using a vocabulary open me up to that kind of response?

Look at it this way. If I didn't use the word "complete" then I would have been asking for just any ol' documentation and I would have gotten what I already found: INcomplete references. What would possibly make me want to ask for complete docs? Well, the fact that the docs I did find were brief, INcomplete, or to say it another way, cursory.

Now, is the problem one of vocabulary? Did I use a fairly simple word but one that may not be on the tip of your tongue? Big Flippin' Deal! Grow a vocabulary. Go nitpick someone else.

Scott

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 13009
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: GPIO API documentation

Sat Mar 25, 2017 12:51 pm

I see this is going downhill, so locking.
I think there were enough pointers where you can find all the documentation you can find, just not in one place, because as said there are several *competing* solutions.

Return to “Python”