Nicolas,
Thanks for the suggestion. Now I am able to
change the state of some GPIO pins. But I couldn't
change the state of following pins.
GPIO pins:1, 13-15, 21-22, 29-31,48-55, 58-84.
Suppose if a pin is already configured for alternative
function, will this matter while changing
the state of pin?
I have a written driver with IOCTL routine. The
IOCTL
routine supports GPIO_GET ( get the gpio pin state)
and
GPIO_SET (set the gpio pin state) commands from
user space programs.
From user space program, I am able to change
the state of some GPIO pins. But one thing that I
observed is that, from user space program I
couldn't change the state of some GPIO pins, for
which I was able to change the state from the driver
directly.
Any idea about this?
thanks,
Seshu
> > Hi,
> > I am using Lubbock board (PXA255 based) and
> > linux-2.4.19-rmk7-pxa1.
> > I am trying to set the state of GPIO pin using
> > GPSR/GPCR registers. But the state I am trying to
> set
> > is not reflected on the GPIO pin. The pin always
> > reatins its old state.
> >
> > I am using the following piece of code in
> > the driver.
> >
> > set_GPIO_mode(81 | GPIO_OUT);
> > old_state = ( GPLR(81) & GPIO_bit(81))?1:0 ;
> > /* old_state is zero */
> > GPSR(81) |= GPIO_bit(81); /*set pin state to
> 1*/
>
> With GPSR and GPCR you only need to perform a direct
> assignment, e.g.:
>
> GPSR(81) = GPIO_bit(81);
>
> > new_state = ( GPLR(81) & GPIO_bit(81))?1:0 ;
> >
> > But I always get new_state as zero.
>
> What about the level on the actual GPIO line?
>
> > I tried with other GPIO pins and found the same
> thing.
> >
> > Any idea why the GPIO pin state is not
> > changing even after setting in GPSR/GPCR
> registers?
> > Did I miss any settings in some other
> registers?
>
> Your code seems to be right (besides the minor
> detail above).
>
>
> Nicolas
>
__________________________________
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree
-------------------------------------------------------------------
Subscription options: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm
FAQ/Etiquette: http://www.arm.linux.org.uk/armlinux/mailinglists.php
|