Re: [PATCH V2 2/4] libgpiod: Add rust wrappers

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

 



On Fri, Dec 17, 2021 at 10:41:33AM +0530, Viresh Kumar wrote:
> On 17-12-21, 08:12, Kent Gibson wrote:
> > I'm of the opinion that a rust implementation would be better targetting
> > the ioctls directly rather than libgpiod, as my Go library does and for
> > essentially the same reasons.
> 
> I remember asking Linus initially about this and I was suggested to use libgpiod
> instead :)
> 
> > To test that theory, and as an exercise to learn rust, I've been writing
> > one, and so far I've been calling it gpiod :-|.
> > 

In case you are interested, the first pass of my take on a Rust GPIO
library[1] has finally gotten to the point of being core feature complete,
and may be usable, although it is sorely lacking any integration tests.
And the documentation is still pretty light, or even non-existant for
github.
And the event interface is either polled or blocking - haven't gotten to
an async interface yet.

Anyway, there are three crates there:
 - gpiod-uapi provides a thin and safe wrapper around the ioctls and
   file reads, for both uAPI versions.
 - gpiod provides a more idiomatic abstraction, and hides the uAPI
   version being used - unless you need v2 specific features.
 - gpiodctl provides a binary that bundles all the gpio tools into one.

There are a couple of minimal example apps in the gpiod crate, in
addition to the example that gpiodctl provides.

Cheers,
Kent.

[1] https://github.com/warthog618/gpiod-rs




[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