Hi Mathias,
On Tue, Dec 7, 2010 at 10:37 AM, Mathias Kriebel
<mathias_kriebel@...> wrote:
> Hello again,
>
> I've used successfully used ' read(fileno(fs), &value, 1) ' to block my C
> program until an interruption line is high.
> But I have one more question: Can I use the gpio-event driver to write on a
> pin?
> Or will I have to use something like ' system("echo 1 >
> /sys/class/gpio/gpio146/value") '
> I think writing this way would be slower.
Or you can just open /sys/class/gpio/gpio146/value once in your program:
int fd;
fd = open( "/sys/class/gpio/gpio146/value", O_RDWR );
and do something like:
write( fd, "1", 1 );
when you want to set it.
Or you can use the gpio driver that I wrote over here:
<http://www.gumstix.net/wiki/index.php?title=User_GPIO_Driver>
which reflects the kernel gpiolib API into user-space.
--
Dave Hylands
Shuswap, BC, Canada
http://www.DaveHylands.com/
|