[Gambas-devel] Raspberry Pi & Gambas.
d4t4full at ...176...
Wed Oct 21 12:53:08 CEST 2015
Using the wiringPi 2 library <http://wiringpi.com/> , a C program can
fiddle with the I/O pins in (I think) all Raspberry Pi (RasPi for short)
models. A C program could also set "triggers" so that the program is
"interrupted" whenever pin(s) change state (low-to-high or high-to-low).
The first part, twiddling with output pins and reading their state is
achievable in Gambas with help of EXTERN calls. Unfortunately, the interrupt
part does not play along with Gambas. Some time ago (coupla months) I read
why, but the reason why was over my head.
Since many Gambas components are actually C adapting and rerouting things
back and forth between low-level drivers and stuff to/from BASIC code (yes,
I know I'm oversimplifying), I wonder if a RasPi-specific component could be
developed that take advantage of the interrupts in form of Gambas Events.
Point is, this component would work and be meaningful exclusively on the
RasPi and not useable on -say- x86 for example. Is there any way a component
can be disabled based on machine architecture? This would be the
hardware-equivalent to disabling gb.qt5 on Ubuntu, for example.
I have a PDF paper explaining how to create a Gambas component in C. I'm
afraid it does not cover events, though. If a simple explanation is given on
how to raise Events from C code, I may risk my ar$e and try to do it if the
platform restriction is doable.
View this message in context: http://gambas.8142.n7.nabble.com/Raspberry-Pi-Gambas-tp54165.html
Sent from the gambas-devel mailing list archive at Nabble.com.
More information about the Devel