[riot-notifications] [RIOT-OS/RIOT] [WIP] sam0_common: Add USB peripheral driver (#10915)

Dylan Laduranty notifications at github.com
Sat Feb 9 21:57:21 CET 2019


dylad commented on this pull request.



> +
+/**
+ * @brief   Event callback for signaling usbdev event to upper layers
+ *
+ * @param[in] usbdev        usbdev context
+ * @param[in] event         type of the event
+ */
+typedef void (*usbdev_event_cb_t)(usbdev_t *usbdev, usbdev_event_t event);
+
+/**
+ * @brief usbdev device descriptor
+ */
+struct usbdev {
+    const struct usbdev_driver *driver;     /**< usbdev driver struct   */
+    usbdev_event_cb_t cb;                   /**< Event callback supplied by
+                                              *  upper layer */

What about adding `UsbDevice` struct from atmel vendor files ? In the current state, this driver works fine with one USB device instance but maybe one day we will have several USB within a MCU.
This way we can replace all USB->DEVICE from the driver by a more generic call.

-- 
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/10915#pullrequestreview-201877900
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190209/1fe5fc63/attachment.html>


More information about the notifications mailing list