Re: [libgpiod] Issue in gpioset (Tag v1.6.3)

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

 



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.



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux