[Lazarus] Accessing GPIO on RaspberryPi2 from Lazarus/FPC
Michael Ring
mail at michael-ring.org
Sat Oct 10 14:42:26 CEST 2015
I agree, this is a really, really nice find.
Not only because of the rpi code, their xml parser implementation is the
most easiest to debug I have ever seen, not the usual pointer chaos seen
in all the other implementations.
Hopefully there are even more gems hidden in this library.
Michael
Am 10.10.15 um 00:31 schrieb Bo Berglund:
> On Fri, 09 Oct 2015 07:31:52 +0000, Alfred <alfred at consulab.nl> wrote:
>
>> Please have a look at:
>> http://www.afterwarp.net/products/pxl
>> https://github.com/yunkot/pxl
>>
>> Forum post:
>> http://forum.lazarus.freepascal.org/index.php/topic,29852.0.html?PHPSESSID=bf43911005bf788ab072b3d73d1bfb4f
>>
>> Pxl is a very well written library, capable of doing a lot, with the
>> inclusion of hardware access on RPi(2) !
>>
>> See sample:
>> https://github.com/yunkot/pxl/tree/master/Samples/FreePascal/SingleBoard/RaspberryPI
> Very good suggestion, Thanks!
>
> I noticed in the file PXL.Boards.RPi.pas the following note:
>
> // The following option controls whether the code is optimized for
> Raspberry PI 2.
> {.$DEFINE RPi2}
>
> And further down I found that this define controls the address used
> for GPIO:
> FChipOffsetBase := {$IFDEF RPi2} $3F000 {$ELSE} $20000 {$ENDIF}; //
> in pages (x 4096 bytes)
>
> So it looks like it is going to solve my I/O control on the Pi2!
> Now I just have to figure which files to copy over to the Pi for this
> to work, the complete download is very big and most of it I really do
> not need...
>
>
More information about the Lazarus
mailing list