From: Kent Gibson <warthog618@gmail.com>
To: Ashayam Gupta <ashayamg@gmail.com>
Cc: linux-gpio@vger.kernel.org, Bartosz Golaszewski <brgl@bgdev.pl>
Subject: Re: [libgpiod] Issue in gpioset (Tag v1.6.3)
Date: Thu, 30 Dec 2021 15:14:55 +0800 [thread overview]
Message-ID: <20211230071455.GA37120@sol> (raw)
In-Reply-To: <CAOgBvpkPOaKdwi-eWR2WAzJxQpOqAZWijKKs2twAZ9dUQ+ibgg@mail.gmail.com>
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.
prev parent reply other threads:[~2021-12-30 7:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-25 19:26 [libgpiod] Issue in gpioset (Tag v1.6.3) Ashayam Gupta
2021-12-30 7:14 ` Kent Gibson [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211230071455.GA37120@sol \
--to=warthog618@gmail.com \
--cc=ashayamg@gmail.com \
--cc=brgl@bgdev.pl \
--cc=linux-gpio@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).