[Gambas-user] Shared WiringPi library for RasPi

Christer Johansson lists at ...2828...
Mon Feb 18 10:12:39 CET 2013


Since I bumped into problems using Mike McCauley's bcm2835 library
when trying to access the SPI-port on the Raspberry Pi from Gambas 3
I also made a shared lib version of WiringPi.

This C lib is made by a gentleman named Gordon Henderson and _ALL_ credits
belongs to him and not me, I just compiled a shared lib version so we can
use his great work to interface with other hardware from the Raspberry Pi!

Since I know here are a bunch of other Raspberry Pi owners on this list
I just wanted to share the lib with you (along with a question)...

Visit Gordon's website for more information on parameters etc.

  https://projects.drogon.net/raspberry-pi/wiringpi/

Installation
------------

1. Copy "libwiringPi.so.1.0" to /usr/local/lib directory and run the
   following command to install

     ldconfig

2. Verify with following command that lists all shared libraries.

     ldconfig -v

3. Declare the functions in Gambas 3 with EXTERN command...

     Public Extern delay(millis As Integer) In "libwiringPi:1"
     
NOTE: You must run your Gambas3 program as root else it won't work!

Now a question to all the C pro's... I'm hoping to be able to get HW
interrupts working on the GPIO with Gambas 3. Declaring delay() above
was easy enough but the interrupt function looks like...

  int wiringPiISR (int pin, int edgeType, void (*function)(void));

So how do you declare the above in Gambas 3? I.e register a function that
will be called to handle the interrupt? Any pointers appreciated...

/CJ
-------------- next part --------------
A non-text attachment was scrubbed...
Name: shared_libwiringPi_130207.tar.gz
Type: application/x-gzip
Size: 18930 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20130218/238e447b/attachment.bin>


More information about the User mailing list