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

Koen Zandberg notifications at github.com
Sun Feb 10 12:29:17 CET 2019


bergzand commented on this pull request.



> +
+void usbdev_init(usbdev_t *dev)
+{
+    /* Only one usb device on this board */
+    _usbdev = (sam0_common_usb_t *)dev;
+    _usbdev->used = 0;
+    /* Set GPIO */
+    gpio_init(GPIO_PIN(PA, 24), GPIO_IN);
+    gpio_init(GPIO_PIN(PA, 25), GPIO_IN);
+    gpio_init_mux(GPIO_PIN(PA, 24), GPIO_MUX_G);
+    gpio_init_mux(GPIO_PIN(PA, 25), GPIO_MUX_G);
+    poweron();
+    /* Reset peripheral */
+    USB->DEVICE.CTRLA.reg |= USB_CTRLA_SWRST;
+    while (usb_swrst_syncing()) {}
+    while (USB->DEVICE.CTRLA.bit.SWRST) {}

Duplicate something something...

-- 
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#discussion_r255333555
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190210/2d7eb61e/attachment.html>


More information about the notifications mailing list