rust-embedded / linux-embedded-hal

Implementation of the `embedded-hal` traits for Linux devices
Apache License 2.0
232 stars 40 forks source link

CAN trait implementation #72

Open marcelbuesing opened 2 years ago

marcelbuesing commented 2 years ago

I think it would be great to add implementations for the new embedded-hal CAN traits via socketcan. Would you be open for a PR for this?

eldruin commented 2 years ago

That would definitely be interesting!

marcelbuesing commented 2 years ago

Ok I basically created a fork of the socketcan crate, you can find the fork here. Sadly the original crate is no longer maintained but works quite well for me and still sees significant download numbers on crates.io. I reduced the dependencies and removed modules which were not necessary for this use case. A simple example is here. It already works but still needs some minor cleanup.

My suggestion would be to move this project/fork copy to the rust-embedded organization and basically move all the code that is currently in the embedded_hal_impl module to the linux-embedded-hal crate referencing the socketcan crate in the rust-embedded organization, analogous to gpio-cdev or sysfs_gpio. If this an option for the rust-embedded org would this be ok for your @mbr ? I see great potential in e.g. getting started with the embedded-hal socketcan implementation and then e.g. migrating to bxcan in projects.

ryankurte commented 2 years ago

hey thanks for your effort! seems like a fundamental crate so if @mbr (cc. @fpagliughi) are up for handing socketcan over it's a :+1: from me, any other opinions @rust-embedded/tools @rust-embedded/embedded-linux (whoops)?

adamgreig commented 2 years ago

(maybe @rust-embedded/embedded-linux ?)

nastevens commented 2 years ago

Seems logical to me as well :+1:

marcelbuesing commented 2 years ago

Ok since there is no response from the socketcan maintainers, how about a new crate name: linux-socketcan?

fpagliughi commented 2 years ago

Hey All. Apologies. I agreed to share maintainer responsibilities for the socketcan crate last year, then got pretty sick, missed a few months of work, and let my opensource projects go dormant for a while. But I've been catching up recently, and have a CAN project starting soon, so can begin contributing.

fpagliughi commented 2 years ago

BTW... I'll have to track down @mbr. I believe he gave me write access to the GitHub repo, but not crates.io...