[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Change direction of a pin on GPIOA from an app???



Hi,
 
>1. Change the direction of a pin on GPIOA from an application and then 
>    how to read and write to the pin using ioctl:s???
 
The GPIO driver (/dev/gpioa) can do this. The driver implements ioctls like
IO_READDIR, IO_SETOUTPUT, IO_SETINPUT,IO_READBITS etc.
Take a look in arch/cris/drivers/gpio.c

>2. Use par0 for I/O?? Can I use the same code as for GPIOA but just open a
diffrent device??
>    Is it possible to first write to a pin and the read from it in my
application?? If so how??
 
In the next developer board release the gpio driver will support this by
opening /dev/gpiog. There is also some documentation regarding controlling
the parallel port pins in
http://developer.axis.com/doc/software/linux/device_drivers-howto.html
<http://developer.axis.com/doc/software/linux/device_drivers-howto.html> 
 
/Mikael
 
 -----Original Message-----
From: owner-dev-etrax@xxxxxxx.com]On">mailto:owner-dev-etrax@xxxxxxx.com]On Behalf Of
Johan Hallberg
Sent: Thursday, September 19, 2002 6:36 PM
To: dev-etrax
Subject: Change direction of a pin on GPIOA from an app???



Hello!!
 
Can anybody tell me how to:
 
1. Change the direction of a pin on GPIOA from an application and then 
    how to read and write to the pin using ioctl:s???
 
2. Use par0 for I/O?? Can I use the same code as for GPIOA but just open a
diffrent device??
    Is it possible to first write to a pin and the read from it in my
application?? If so how??
 
Best regards
/ Johan H