On 2021-04-24 08:21, Kent Gibson wrote: > 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. Excellent suggestion, I'll try that. And now I of course feel silly for not seeing it myself, it's so obvious... Thanks a bunch! Cheers, Peter