[riot-notifications] [RIOT-OS/RIOT] usbdev: Introducing a generic USB device driver API (#9830)
notifications at github.com
Wed Feb 13 19:22:37 CET 2019
Reworked a large part of the interface according to my own suggestion from above. I didn't rework the endpoint number/direction into a single `uint8_t`.
With this, there is only a single driver struct remaining covering both the usb device and the endpoint specific api. The `usbdev_ep_t` struct got stripped of the `context`, `driver` and `cb` members, those have been added/merged into the `usbdev_t` struct. I've added a `usbdev_t` ptr to the `usbdev_ep_t` struct. This simplifies the implementation quite a bit and prevents bugs where an `usbdev_ep_t` and `usbdev_t` from two different peripherals are used in a single call.
Helper functions for each call are also available and recommended to use. This:
- prevents things such as `usbdev->dev->driver->init(usbdev->dev);` (actual example) and is used as `usbdev_init(usbdev->dev);` instead.
- allows for a single point to add all preconditions for a function instead of each implementation having to add them.
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the notifications