I use F # on Raspberry Pi 2 (ARM 7 and therefore mono). I am currently trying to use the WiringPi library written in C. I was able to successfully use some functions using P / Invoke.
Now I'm trying to use interrupts (see http://wiringpi.com/reference/priority-interrupts-and-threads/ ), but I'm confused by this function with the following C signature
int wiringPiISR (int pin, int edgeType, void (*function)(void));
What has been translated (see https://github.com/danriches/WiringPi.Net/blob/master/WiringPi/WrapperClass.cs ) by Daniel Rish to a C # library like this
public delegate void ISRCallback();
[DllImport("libwiringPi.so", EntryPoint = "wiringPiISR")]
public static extern int wiringPiISR(int pin, int mode, ISRCallback method);
How would I do this in F #? I think the DllImport line looks like this (the "method" is reserved in F #)
[<DllImport("libwiringPi.so", EntryPoint = "wiringPiISR")>]
extern int wiringPiISR(int pin, int mode, ISRCallback callBack);
What does type determination for ISRCallback look like?
. "a", , void.