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.