-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switch to gpiocdev-rs for GPIO uAPI v2 support? #92
Comments
I've been testing giocdev the last few days and am really impressed with what @warthog618 has done, especially with him claiming to be a Rust newcomer when he started the project! And though I hate throwing away good work (including my own), I'm leaning toward moving my own apps to gpiocdev. I also found some additional Pro's:
|
If you have any doubts I was a Rust newbie you can always look at some of the earlier commits - they are sure to be pretty ugly. The API probably feels like the C and C++ libgpiod v2 APIs as I had a hand in those as well (Bart did the work, I did some reviewing and updated the tools), so I probably pushed him in the direction of the Go API I wrote while developing the GPIO uAPI v2 itself (I needed something to drive it from userspace, didn't know Rust then, and updating libgpiod was way too much work - which is one of the reasons libgpiod v2 only just released. So Go did the job at the time.) Though the constraints of writing an extensible and backwardly compatible library interface in those languages adds a whole load of ugliness (maybe not warts, but definitely plenty of pimpls), so my apologies to anyone that has to use them. My Rust API followed the Go, more or less, though as Rust understands ownership the resulting API is clearer, IMHO. Anyway, enough history. Let me know if you find any issues with gpiocdev or need additional features, and I'll see what I can do. Same goes for the uAPI itself. |
nice work @warthog618! and thank you @fpagliughi for digging into this ^_^ i'm oki with the idea of a swap (and async will be really nice to have!), if we really wanted to we could plug in both backends for the moment and feature gate a swap in case anyone is very attached to the prior version, but, e-h 1.x.y-alpha is still an adventure in breaking changes so it's probably not necessary. perhaps it's worth a PR here to see how it looks? and if we are adopting this it would be good to add the e-h team to the repo as maintainers with a goal of one day adopting it here if you're open to this @warthog618? (or equally, moving it here and adopting @warthog618 :-P) |
Not something I had considered and, not having much familiarity with rust-embedded team, not something I'm open to at the moment. |
Context:
Our gpio-cdev crate only supports GPIO uAPI v1, which has been deprecated in the kernel. There is a new crate gpiocdev which does support it in newer kernels.
Preliminary analysis of switching to the newer gpiocdev in no particular order:
See rust-embedded/gpio-cdev#68
The text was updated successfully, but these errors were encountered: