Code: Select all
REG_GPIO = $20000; //For original Pi chip BCM2835 //change to: REG_GPIO = $3F000; //For new Pi2 chip BCM2836
Code: Select all
function TIoDriver.MapIo: boolean; begin Result := True; fd := fpopen('/dev/mem', O_RdWr or O_Sync); // Open the master /dev/memory device if fd < 0 then begin Result := False; // unsuccessful memory mapping end; // end;
I could hazard a guess at what they mean, probably to check the write permissions, but it would be a pointless exercise.Bosse_B wrote:I am just compiling a new trunk version of fpc and lazarus on my pi so I cannot test right away. Takes about 2 hours on a Pi2..
But I would like to ask this:
Over on the fpc mailing list I asked about GPIO access from fpc and got directions to use "echo" on the command line to test the /dev/gpio but they gave no details at all on what to type in etc...
And when I tried to get it they threw me out because it was considered off-topic for the fpc mail list.
Do you have any idea how one can use echo to test the dev "files"?
There will be a way. I don't use the GUI so can not help. If you post that as a separate question someone will answer.Bosse_B wrote: ...
However, in the gui the Lazarus item does not appear under Menu/Programming as it did in Wheezy.
I have to start it now using the Menu/Run... item and then type in lazarus-ide, what a drag!
I just wish there was a way to self-customize the Menu content so I could manually add lazarus to the Programming sub-menu...
Done so. It is located here..joan wrote: There will be a way. I don't use the GUI so can not help. If you post that as a separate question someone will answer.
VERY GOOD ADVICE!joan wrote: /dev/gpiomem should work with an up to date RPi Foundation version of Raspbian.