LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices


Reply
  Search this Thread
Old 02-11-2011, 03:20 AM   #1
Gobliins
LQ Newbie
 
Registered: Feb 2011
Posts: 4

Rep: Reputation: 0
AT91 gpio device driver access


Hi embedded developer community,

i got an AT91SAM9RL-EK with a 2.6.30 Linux buildroot running.
The device-drivers (i guess the sources are /arch/arm/mach-at91/leds.c and
drivers/input/keyboard/gpio_keys.c) for the boards LEDs and
Keys(Interrupts)are installed with the Kernel.

I want to write now a C programm to access the LEDS (later to read the
keys) while i am in user-space.

the leds can be found in /sys/class/leds
the keys are located in /dev/input/event0

So far i´ve heard about two options:
1. using open , read , mmap but i could maybe use some help on there.
2. using the device drivers API i really could need help here.

Has anyone some sample code for a similar board or can help me to access
the keys and leds?

thx
 
Old 02-14-2011, 02:08 AM   #2
Gobliins
LQ Newbie
 
Registered: Feb 2011
Posts: 4

Original Poster
Rep: Reputation: 0
Ok got it working with the open, and write functions.
 
Old 11-01-2013, 04:56 AM   #3
rk1genius
LQ Newbie
 
Registered: Nov 2013
Posts: 2

Rep: Reputation: Disabled
Hi,


Could u share the working code please .


Thanks and regards
Rahul
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] ppc4xx gpio driver not loading using arch_initcall max21226 Linux - Kernel 3 08-31-2010 11:04 AM
GPIO driver for MPC837xerdb ramukaka Linux - Kernel 1 08-15-2010 09:29 PM
Using GPIO (from kernel GPIO support) in MY application DannyGilbert Linux - Kernel 2 03-16-2009 07:52 AM
GPIO access from users pace? ra2008 Linux - Embedded & Single-board computer 13 08-05-2008 08:48 AM
GPIO driver for Intel 6300ESB I/O Controller lartip Linux - Software 0 03-13-2007 05:02 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

All times are GMT -5. The time now is 04:22 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration