[riot-notifications] [RIOT-OS/RIOT] usbdev: Introducing a generic USB device driver API (#9830)

Koen Zandberg 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:
https://github.com/RIOT-OS/RIOT/pull/9830#issuecomment-463309979
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190213/24ddca90/attachment.html>


More information about the notifications mailing list