It's possible but I've done it many years ago, I don't remember all the details .


From what I see from main.c, I think you'll have to convert the following headers:
#include "clk.h"
#include "gpio.h"
#include "dma.h"
#include "pwm.h"
#include "version.h"
#include "ws2811.h"
And I guess you'll have to add something like {$linklib libws2811.a}  (after looking at https://github.com/rpi-ws281x/rpi-ws281x-python/blob/master/library/Makefile )

May be too if you have object files *.o you can link them with something like {$L ws2811.o}

A tutorial showing how to use object-code and libraries created in C (I found it from https://wiki.lazarus.freepascal.org/Creating_bindings_for_C_libraries )

Le 31/10/2019 à 20:32, James Richters a écrit :

I got my Raspberry pi working with the user space library written in C: at  https://github.com/jgarff/rpi_ws281x with python and got my LED strip to light up with the examples.  I also have FPC 3.0.4 installed on the pi.   I would really like to be able to use the C library with FPC.   I have some other C libraries that I’ve managed to use with FPC, but those were .dlls, but this doesn’t have .dlls.  Would accessing this from FPC even be possible?  And if so does anyone have an example of some C library that doesn’t have .dlls being accessed from FPC?



_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to