[riot-notifications] [RIOT-OS/RIOT] usbdev: Add low level initialization to `periph_init()` (#11213)

Koen Zandberg notifications at github.com
Wed Mar 20 22:28:16 CET 2019


bergzand commented on this pull request.



> @@ -355,6 +355,22 @@ typedef struct usbdev_driver {
     int (*ready)(usbdev_ep_t *ep, size_t len);
 } usbdev_driver_t;
 
+/**
+ * @brief Low level USB peripheral driver initialization
+ *
+ * This function prepares all usbdev peripherals available for initialization
+ */
+void usbdev_init_lowlevel(void);
+
+/**
+ * @brief Retrieve usbdev context from the peripheral
+ *
+ * @param num   usbdev peripheral number to retrieve
+ *
+ * @returns     the usbdev context at index @p num
+ */
+usbdev_t *usbdev_get_ctx(unsigned num);

I'd rather keep this `unsigned`( or `unsigned int`). The size here doesn't really matter, I'd be suprised to see an mcu with more than 255 USB peripherals. With this in mind I'd like to leave it up to the platform to pick a decent size.

-- 
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/11213#discussion_r267553921
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190320/7bb0314b/attachment.html>


More information about the notifications mailing list