Re: [libgpiod] Request an output line, without modifying the value

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

 



On Fri, Apr 23, 2021 at 05:32:15PM +0200, Peter Rosin wrote:
> Hi!
> 
> I'm wondering if there is a way to request an output line using
> libgpiod without clobbering the previous value. I would like for
> an application to take a peek at this previous value of an output
> gpio and behave slightly different for 0/1.
> 
> Cheers,
> Peter

Assuming it is still an output then GPIOD_LINE_REQUEST_DIRECTION_AS_IS
should do what you are after.
But there is no guarantee that the line state is preserved across
requests, so YMMV.

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