Skip to content
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

The twai driver is tightly coupled to the embedded-hal/embedded-can packages #1123

Closed
jessebraham opened this issue Jan 26, 2024 · 3 comments
Labels
peripheral:twai TWAI peripheral status:needs-attention This should be prioritized

Comments

@jessebraham
Copy link
Member

Ideally, all of our drivers should function without using any of the embedded-hal/embedded-can traits; these traits are only interfaces. Unfortunately, our twai driver is currently quite tightly coupled to these dependencies.

This needs to be fixed; I have started looking into this a bit, but unfortunately I think we will need to duplicate quite a few enums/structs from these packages :/

@jessebraham jessebraham added the bug Something isn't working label Jan 26, 2024
@jessebraham
Copy link
Member Author

I don't really see a path forward here other than duplicating all the types from these packages and implementing the From trait as needed for everything. Seems this will be a bit painful.

@ptpaterson
Copy link
Contributor

ptpaterson commented Jan 27, 2024

I will say that using the provided structs and enums from embedded_can is rather convenient. I'm working on a generic CAN library, and it'd be great if I can use ID instead of impl Into<ID> everywhere. But I definitely agree the traits shouldn't be required to use this HAL.

Can traits

#951 does create inherent impls for transmit and receive, which the trait impl then reuses.

Frame trait

It would indeed be nice to have some inherent methods to instantiate and use EspTwaiFrames without the Frame trait.

@jessebraham jessebraham added the help wanted Extra attention is needed label Feb 1, 2024
@jessebraham jessebraham added the peripheral:twai TWAI peripheral label Feb 28, 2024
@jessebraham jessebraham added status:needs-attention This should be prioritized and removed help wanted Extra attention is needed bug Something isn't working labels Mar 12, 2024
@jessebraham
Copy link
Member Author

Let's use #1317 to track progress here moving forward.

@github-project-automation github-project-automation bot moved this from Todo to Done in esp-rs Mar 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
peripheral:twai TWAI peripheral status:needs-attention This should be prioritized
Projects
Archived in project
Development

No branches or pull requests

2 participants