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

Abstract USB device implementation #124

Merged
merged 6 commits into from
Apr 23, 2023
Merged

Abstract USB device implementation #124

merged 6 commits into from
Apr 23, 2023

Conversation

r4gus
Copy link
Contributor

@r4gus r4gus commented Apr 19, 2023

I've extracted the platform independent code from the rp2040 device impl (see ZigEmbeddedGroup/raspberrypi-rp2040#40).

One can create a concrete implementation by calling Usb(F), where F is a struct that contains a set of functions to handle the low level details (register access etc.).

Check out the usb examples in the rp2040 repo!

@MasterQ32 @mattnite

@mattnite
Copy link
Contributor

🤌

@mattnite
Copy link
Contributor

In general I would prefer removing Usb from the beginning of the identifiers since they're in a usb namespace. That being said, I'm also for keeping them as is since I know that's how the USB standard refers to them. What do you think?

@r4gus
Copy link
Contributor Author

r4gus commented Apr 19, 2023

In general I would prefer removing Usb from the beginning of the identifiers since they're in a usb namespace. That being said, I'm also for keeping them as is since I know that's how the USB standard refers to them. What do you think?

You're right, usb.XYZ looks better than usb.UsbXYZ

@r4gus
Copy link
Contributor Author

r4gus commented Apr 19, 2023

Just write everything down you dislike, I'll take care of it

@mattnite
Copy link
Contributor

The only other change I'd like to see is to ensure that the unit tests run when you execute zig build test, once that's done with the removal of Usb we're good to merge :)

@mattnite
Copy link
Contributor

@r4gus is this ready to merge?

@r4gus
Copy link
Contributor Author

r4gus commented Apr 23, 2023

@mattnite yes. Sending multiple packets between Host and Client seems to Work fine (with the rp2040). Adding Support for other Chips will probably reveal some shortcomings.

@mattnite
Copy link
Contributor

Awesome

@mattnite mattnite marked this pull request as ready for review April 23, 2023 15:31
@mattnite mattnite merged commit dd491cc into ZigEmbeddedGroup:main Apr 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants