linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [libgpiod] Issue in gpioset (Tag v1.6.3)
@ 2021-12-25 19:26 Ashayam Gupta
  2021-12-30  7:14 ` Kent Gibson
  0 siblings, 1 reply; 2+ messages in thread
From: Ashayam Gupta @ 2021-12-25 19:26 UTC (permalink / raw)
  To: linux-gpio

Hi All,
I have used the v1.6.3 Tag from the website
https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/?h=v1.6.3,
for doing a simple testing on the breadboard(Hobby Project).
The source code has been compiled with these flags: ./autogen.sh
--enable-tools=yes --prefix=/home/pi/gpio/install
--enable-bindings-cxx.
I am facing the below mentioned issue with this build.

Issue:
Command used: ./gpioset --mode=time --sec=1 pinctrl-bcm2711 27=1
As per my understanding, after 1 sec the pin @27 should switch to 0 ,
but the LED keeps glowing even after the command is complete and later
on when I run the
./gpioget gpiochip0 27, the LED switches off  and the value printed is 0.
Is this supposed to be the desired behavior for the above set command,
or it is supposed to EXIT on default after the mentioned time limit.

Setup:
A simple LED connected using a resistor with GPIO @27 for output pin,
and a GND pin used.

Please let me know if some more information is needed, or if there is
some help I can provide in testing the library further with my small
setup, also kindly let me know if my format for filling issue/bugs is
not correct, and in case it needs to be posted elsewhere.

Thanks
Ashayam Gupta

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [libgpiod] Issue in gpioset (Tag v1.6.3)
  2021-12-25 19:26 [libgpiod] Issue in gpioset (Tag v1.6.3) Ashayam Gupta
@ 2021-12-30  7:14 ` Kent Gibson
  0 siblings, 0 replies; 2+ messages in thread
From: Kent Gibson @ 2021-12-30  7:14 UTC (permalink / raw)
  To: Ashayam Gupta; +Cc: linux-gpio, Bartosz Golaszewski

On Sun, Dec 26, 2021 at 12:56:09AM +0530, Ashayam Gupta wrote:
> Hi All,
> I have used the v1.6.3 Tag from the website
> https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/?h=v1.6.3,
> for doing a simple testing on the breadboard(Hobby Project).
> The source code has been compiled with these flags: ./autogen.sh
> --enable-tools=yes --prefix=/home/pi/gpio/install
> --enable-bindings-cxx.
> I am facing the below mentioned issue with this build.
> 
> Issue:
> Command used: ./gpioset --mode=time --sec=1 pinctrl-bcm2711 27=1
> As per my understanding, after 1 sec the pin @27 should switch to 0 ,
> but the LED keeps glowing even after the command is complete and later
> on when I run the
> ./gpioget gpiochip0 27, the LED switches off  and the value printed is 0.
> Is this supposed to be the desired behavior for the above set command,
> or it is supposed to EXIT on default after the mentioned time limit.
> 

Hi Ashayam,

You misunderstand gpioset and gpioget - what you are seeing is expected
behaviour.

gpioset does not restore the line to its original state when it exits, nor
make any other guarantees about the line state after it exits.
Quite the opposite - as the line is no longer under your control you
should make no assumptions regarding its state.
The timer on gpioset is intended to guarantee the minimum time the line
will stay set, not to schedule a transition.

And gpioget sets the line direction to input so, as you have a load
attached, the LED will switch off and the line will get pulled low and
report the 0 you are seeing.

That is my understanding - I'm sure Bart will correct if I'm mistaken.

Cheers,
Kent.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-12-30  7:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-25 19:26 [libgpiod] Issue in gpioset (Tag v1.6.3) Ashayam Gupta
2021-12-30  7:14 ` Kent Gibson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).