LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 11-08-2010, 03:27 AM   #1
aneeshradhakrishnan85
LQ Newbie
 
Registered: Apr 2010
Posts: 4

Rep: Reputation: 0
Smile Invoking GPIO's of ARM controller


Hi all,

Can anyone tell me how to access the GPIO's or other peripherals in ARM9 which runs Linux kernel 2.6.XX. Any steps or documentation or suggestions most welcome.

Thanks in advance
 
Old 11-08-2010, 07:15 AM   #2
PehJota
Member
 
Registered: Aug 2010
Distribution: Desktop and netbook: Debian Squeeze; Router: DD-WRT
Posts: 43

Rep: Reputation: 5
Well you haven't given any specifics here. Are you looking to do this in a programming language? If so, which one? Or are you looking to do this from a shell?

The best documentation that I've found for doing this in C is from the kernel documentation itself: Documentation/gpio.txt. If I remember right, you must first request a GPIO pin (gpio_request()), then set its direction (gpio_direction_input() or gpio_direction_output()). If you want to send output, then you can just use gpio_set_value(). If you want to receive input when the state changes, you can map the GPIO to an IRQ number (gpio_to_irq()) and use that number with request_irq() to set a handler. Finally, remember to call gpio_free() to release the GPIO pin.

You may also find this documentation to be a good reference, but it relies heavily on the sys filesystem rather than on the kernel API, so I'd suggest only using it to test GPIO access from a shell rather than in an actual program.
 
1 members found this post helpful.
Old 11-08-2010, 10:01 AM   #3
aneeshradhakrishnan85
LQ Newbie
 
Registered: Apr 2010
Posts: 4

Original Poster
Rep: Reputation: 0
Smile

I wanted to do programming in C language only. I have no idea about shell programming ..thanks for your support. The documents are useful

Last edited by aneeshradhakrishnan85; 11-08-2010 at 10:04 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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] Linux Porting with ARM Controller coolzam Linux - Embedded & Single-board computer 3 11-05-2010 03:26 AM
Compiling debian arm for NSLU2 - arm-linux-gnueabi-objdump not found ergosteur Linux - Kernel 3 10-30-2010 11:24 AM
implementing matrix based keypad on x86 processor using GPIO's nathan Programming 1 02-06-2010 11:32 AM
Compile the linux2.6.14.1 for arm must ues the arm-linux-gcc-3.4.4? frankyue Linux - Embedded & Single-board computer 2 12-20-2008 07:28 AM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration