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

Koen Zandberg notifications at github.com
Mon Mar 18 21:58:14 CET 2019


bergzand commented on this pull request.



> +    _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) {}
+
+    /* Enable USB device */
+    USB->DEVICE.DESCADD.reg = (uint32_t)banks;
+    USB->DEVICE.CTRLA.reg |= USB_CTRLA_ENABLE | USB_CTRLA_RUNSTDBY;

Removed for now

-- 
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_r266638854
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190318/1a908779/attachment.html>


More information about the notifications mailing list