Pergunta

I'm hoping to find a generic mechanism in Linux to toggle LEDs that are wired up to a GPIO controller in an embedded application.

I'm able to use either JTAG or my bootloader (setting the registers directly). However it'd be awesome to toggle some lights from usermode

I'm not well versed in this on Linux, is there a standard kernel driver that I can call from my usermode application? or do I need to write a driver for my application?

I've done a websearch and found ideas ranging from writing my own driver, to libraries that feel adhoc. I'm hoping to find the most 'standard' way, thought the stackoverflow crowd would have a good opinion

any tips would be great

Foi útil?

Solução

You want to use the sysfs interface to GPIOs

http://www.kernel.org/doc/Documentation/gpio.txt

In that link search for "Sysfs Interface for Userspace"

I have no idea what type of system you are on, or if support for this is already enabled in your kernel or not, but that is where you want to look.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top