(newbie..) device driver for a button on at91sam9261ek

This forum is for users of Microchip MPUs and who are interested in using Linux OS.

Moderator: nferre

jramak
Posts: 16
Joined: Fri Feb 02, 2007 9:33 pm

(newbie..) device driver for a button on at91sam9261ek

Thu Apr 19, 2007 12:48 am

Hi Folks,

:D I'm very excited to be learning about writing a linux device driver to capture input when a button is clicked on the AT91SAM9261-EK board. I was wondering what all steps I would have to follow in writing one.. I have Linux Device Drivers 3rd edition by Corbet et al. Is there any relevant device driver code out there that would be helpful as a starting point ?

Any help would be greatly appreciated!

thanks,
iyer
mikrodidakt
Contact:
Location: Sweden
Posts: 26
Joined: Wed Feb 28, 2007 3:51 pm

Thu Apr 26, 2007 2:44 pm

I think you should start by experimenting with the framebuffer that way you can develop it on your pc and then crosscompile for your embedded system and run it there.
I am using the at91sam9261ek board from atmel and the driver for the framebuffer on that board can be found on this site under projects.
You can start playing around with the frambuffer and then after a while try to write your own, there is some info on the net about the frambuffer.
mwolfram
Contact:
Location: Erfurt/Germany
Posts: 87
Joined: Thu Feb 03, 2005 11:41 am

Fri Apr 27, 2007 7:35 am

Hi,

what button is it? A simple push button on the PCB? These are connected to the GPIOs so you will need a driver handling them.

Write a generic GPIO driver and handle button events in your application.

Framebuffer is an output device for LCD, there is no input.

--
Mike
Senior IT Consultant
Germany
jramak
Posts: 16
Joined: Fri Feb 02, 2007 9:33 pm

Mon May 21, 2007 8:58 pm

Hi,

It is one of the simple push buttons on the PCBs. Yes, they are connected to the GPIOs, as per the atmel schematic.

I shall follow your advice of writing a generic GPIO driver, to handle button events, is there any sample code for a GPIO driver ? Is procfs / sysfs way to go for this one ?

Jramak
pkavan
Location: Omaha, Nebraska, USA
Posts: 38
Joined: Wed Mar 21, 2007 4:40 pm

Thu May 24, 2007 6:48 pm

jramak wrote:Hi,

It is one of the simple push buttons on the PCBs. Yes, they are connected to the GPIOs, as per the atmel schematic.

I shall follow your advice of writing a generic GPIO driver, to handle button events, is there any sample code for a GPIO driver ? Is procfs / sysfs way to go for this one ?

Jramak
I did it as a char driver using a /dev entry. You can use the functions in gpio.c in the kernel tree to accomplish it fairly quickly.

Return to “LINUX”

Who is online

Users browsing this forum: No registered users and 4 guests