I have been able to reproduce the functionality of fastDigitalWrite() in a C program cross-compiled for the Galileo and executed in Linux.
See the attached sample program. Clearly, this is just a quick and dirty test, but it reproduces (and improves just a touch on) the IO rates discussed in Re: I/O speeds?
What I haven't really attempted (because I was hoping somebody else could provide the formulation) is including headers and linking with libraries in /arduino-ide-install-dir/hardware/arduino/x86.
Thus, I can reformulate my original question as:
Is there a formula (includes, #defines, library paths/names, etc.) for leveraging in cross-compiled C programs the existing libraries meant to be used with Arduino sketches ?
togglemap.c.zip 1.1 K
Yes, thanks. I did exactly what you suggested when I wrote the program to benchmark pin 2/3 IO.
My original question was about mixing and matching the headers and libraries under /hardware/arduino/x86/arduino and (in my case) under /opt/arduino/hardware/tools/sysroots/i586-poky-linux-uclibc.
I think I have my answer. There is no systematic way of doing such at this point.