Notifications
Clear all

Raspberry Pi pin usage???

85 Posts
4 Users
8 Likes
2,776 Views
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 7008
 

@byron Maybe, but I would be very surprised if the Pi5 with new GPIO hardware didn't then need some software changes to deal with that. It is certainly not uncommon, even some of the most basic libraries are riddled with #ifdefs to deal with AVR vs MBED or SAMD.

I am also fairly sure Joans library is not able to work with the new libgpio-V2.1 yet. I can tell that by the fact she last updated it 2 years ago.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Xylopyrographer
(@xylopyrographer)
Member
Joined: 5 months ago
Posts: 6
 

@inq Really appreciate the extensive reply! Thank-you.

Just yesterday figured out how to do simple GPIO on-off stuff from the command line. Took a bit to wade through the Libre docs and wrap my head around the pin naming conventions. Was (as many things are when you finally get there) quite simple. Now need to figure out how to stuff that inside a C++ program, etc, etc. (Like "where the heck are all the #include files and which one contains which functions??".)

Your example make file and other info should be invaluable in that. I have some experience with those as PlatformIO uses them (doing ESP32 dev work).

I'm certain the stock Debian image has gcc and the tools pre-installed. Next is figuring out how to hook it all together — where your info doing that with Geany will be very useful.

Thanks again!


   
ReplyQuote
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
Topic starter  

Posted by: @xylopyrographer

I'm certain the stock Debian image has gcc and the tools pre-installed. Next is figuring out how to hook it all together — where your info doing that with Geany will be very useful.

I've been trying to load several flavors of Linux on my Orange Pi Zero 2W.  I'm noting that Raspberry Pi organization has done a far better job of creating a cohesive/unified, turn-key solution.  Bare Debian and a couple of others didn't have Geany as part of the basic install.  I can't tell you if RasPi did work to make their Geany work as it did out of the box with C++ or if you'll have to do anything to hook a Geany install with back-end compilers/linkers.  I'd assume if you can do gcc at a command prompt (because it's in the "path") that Geany will inherently be able to work just as well.  Here compiled in command line and by hitting Geany build button.

image

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
ReplyQuote
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
Topic starter  

@xylopyrographer

Posted by: @xylopyrographer

Now need to figure out how to stuff that inside a C++ program, etc, etc. (Like "where the heck are all the #include files and which one contains which functions??".)

I've just discovered how this helps... thought you might be interested.  Put the cursor on the file portion of #include <fcntl.h> , right-click, Open Selected File... get near instant gratification.

image

It doesn't seem to work all the time and I haven't discovered all the why nots?  It doesn't work on the abstracted includes like...

#include <cerrno>... have to use the regular version #include <errno.h>.  I also haven't gotten any of the other context menu options to work.  Like...

int fd = open("/var/lib/InqVault/db/InqBee00009e51/1.tst",
        O_APPEND);

Right clicking O_APPEND and trying Go to Symbol Definition doesn't work as I'd expect.

But, I'm finding Geany to be quite adequate instead of the slow Visual Studio Code and I don't even know if it can be do these kind of features any better.  Haven't tried on Linux.

VBR,

Inq

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 7008
 

@inq Maybe because O_APPEND is a macro? And my foggy brain tells me cerrno is also something weird/special as well.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
Topic starter  

Posted by: @zander

@inq Maybe because O_APPEND is a macro? And my foggy brain tells me cerrno is also something weird/special as well.

I was using that as an example.  @xylopyrographer indicated how hard it is to find includes, libraries, what functions are available and what their parameters are in Linux.  I agree with him.  I've usually have do Google searches like... "Linux C++ binary reading writing".  Always having to prefix with Linux and C++ as Python seems to be default returns otherwise.  I stumbled onto this Geany editor feature to at least bring up the include file.

O_APPEND is a #define to tell to append data to a file.  #define <cerrno> is the equivalent of #define <errno.h> but I have no clue why someone thought we needed to abstract that.

VBR,

Inq

 

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 7008
 

@inq Maybe I am misunderstanding, but in my Arduino IDE, right clicking on an included allows me to peek at a .h file in a sort of overlaid window, but clicking the Goto Definition opens the .h file as a tab in the IDE.

I THINK there are some more rt click tricks on other program elements but not positive.

I am confused by the following, is it a problem only on Linux, because that is not a problem on Win or Mac. I am sure you use Win, so must know how to find any libraries you installed, and that is where the includes are with a list of functions. Also, autocomplete will help but I think you have to type in the first few chars, not sure. 

I am extra confused when you say you do not know what their parameters are, just hover the pointer over the function name and in almost all cases up pops a list of attributes. Some functions that use variable args or similar will not provide much help (like printf)

to find includes, libraries, what functions are available and what their parameters are in Linux.

Sorry to waste bandwidth if I am confused, but I hate not saying anything only to find out I had an answer, so I now tend to over reply.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
Topic starter  

Posted by: @zander

@inq Maybe I am misunderstanding, but in my Arduino IDE...

You and I are all over the place and it can get confusing about the context.  In the context of this thread, this is purely about doing development work ON and writing the code FOR the Raspberry Pi.  Most of it was about using C++ (with some Python sprinkled in) and using the included Geany IDE/Editor.  I'm finding  it does a very good job of mimicking most of the functionality I'm used to using in Visual Studio Professional / Enterprise / Ultimate on Windows.   I have not explored its ability to do real, break-point, step-by-step debugging ability yet.  

Geany is lightning fast on RasPi4 compare to the best Windows PC available using VS or compiling Arduino code!  That I'm doing it with a $70 SBC versus a $4K desktop is mind altering!  I don't have time to take a breath, much less, get coffee during a compile like I can with a typical Arduino upload!  I am seriously  considering doing my desktop applications on this RasPi4.  I'll have to see (someday) what it is like to write GUI apps with 3D graphics on Linux.  

VBR,

Inq

 

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 7008
 

@inq Thank Gitche Gumee, I was really worried.

I have got my office mostly organized, have some extra dongles coming for the wireless Keyboard and mouse plus an HDMI switch so now I can switch between windows 11, Rasberry Pi OS, and a second windows box that will be for an OpenMediaVault server OS (windows will be erased).

Now I can easily play with the Pi, so I will add that to the emergency projects list which hopefully means I can get to it this month.

I will bookmark the relevant posts here so I can try the same things.

Now back to the puppy and a new espresso machine.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Xylopyrographer
(@xylopyrographer)
Member
Joined: 5 months ago
Posts: 6
 

@inq Super duper thing to discover. Thanks very much for the tip! Still in the process of mental shifting into the SBC world.

Got hung up on how to enable bits of the hardware on my board — took me on a tour of device trees, device tree overlays and all that entails, with a side dish of U-Boot as well.

Anyway, I now get how to tell the hardware what pins to assign, for example, an SPI bus, but now need to figure out where to find an actual Debian compatible C++ library/driver for say a 240 x 240 LCD ILI9341SPI display...

As I keep reminding myself, "the joy is in the journey. 😉 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

.." 😉 


   
ReplyQuote
Page 6 / 6