08-31-2016, 04:14 AM
(This post was last modified: 08-31-2016, 04:16 AM by pfeerick.
Edit Reason: noticed a reply posted while I was writing...
)
(08-31-2016, 03:47 AM)martind1983 Wrote: However, 1 thing I did not understand that pin labeling. I get the point pin(32) is actual physical pin on PI 2 connector of PINE64 board, PineGPIO(68) is gpio used by sysfs when we access it via gpio class. But what is GPIO(12) labeling?
Right now I am going to my actual issue I want to solve.
I want to control GPIOs through my program written in C code or any other programming languages.
What I want to test is direct memory access when I map /dev/mem file image to virtual memory then I would able to directly write/read GPIO registers
What Mark was saying (and it looks like we were both writing this at the same time, and he beat me in hitting reply

Quote:32 - GPIO 12 - GPIO 68 PC4
That's Pin - PI GPIO - PINE GPIO - Pin Name (from the datasheet)
So if you wanted to control the 32nd pin on the RPi connector, you would be wanting to maniplulate GPIO68 on the pine64 (or GPIO12 on the Raspberry Pi).
Now, since it can be toggled from using sysfs calls from the command line... can you not use System calls in your program to manipulate the GPIOs? Is DMA access a must? If not, depending on how sophisticated you want to make the code, you could probably base it off this Raspberry Pi example, or simplify it down since at it's simplest you really only need to send the export, direction and value commands to control the LED.
I don't know enough about the direct memory access interface to comment on that, but I noticed there was an example for that further up that page I just linked, so maybe that will be of some help or give some ideas?