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

Attachment: shared_libwiringPi_130207.tar.gz
Description: GNU Zip compressed data

------------------------------------------------------------------------------
The Go Parallel Website, sponsored by Intel - in partnership with Geeknet, 
is your hub for all things parallel software development, from weekly thought 
leadership blogs to news, videos, case studies, tutorials, tech docs, 
whitepapers, evaluation guides, and opinion stories. Check out the most 
recent posts - join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to