[uClinux-dev] Urgent: GPIO usage in device driver

John Willlams jwilliams at itee.uq.edu.au
Tue Mar 25 07:05:01 EST 2003


>Is there any difference in using gpio between normal application and
>device driver in uclinux?
>

I'm not quite sure I understand what you are asking. Yes there is a
difference, what's important is how you choose one over the other.

In uClinux because there is no concept of memory protection, your user
program is able to write directly to the GPIO ports.  Whether you should do
this is another matter.

You could wrap a simple char device driver around the GPIO, and gain some of
the protections that go along with that.

The decision is yours to make, and is effected by considerations of design
effort, performance efficiency, portability and code correctness security
and maintainability.

If you only have one program ever accessing the GPIO, you probably don't
really need to write a driver.  However, a simple char driver is not
difficult to write, and there are plenty of examples around.  In fact, I
think there were some messages about this on the list just a few days ago.

Cheers,

John




More information about the uClinux-dev mailing list