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

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


dylad 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;

I think you can remove `USB_CTRLA_RUNSTDBY` for now or make it user defined in `periph_conf.h`

-- 
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-201877204
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190209/87a1b381/attachment-0001.html>


More information about the notifications mailing list