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

Koen Zandberg notifications at github.com
Mon Mar 18 21:52:55 CET 2019


bergzand commented on this pull request.



> +static void _gpio_connect_cb(void *arg)
+{
+    sam0_common_usb_t *usbdev = (sam0_common_usb_t*)arg;
+    usbdev->connect_change = true;
+    usbdev->usbdev.cb(&usbdev->usbdev, USBDEV_EVENT_ESR);
+}
+
+static inline void _poweron(void)
+{
+#if defined(CPU_FAM_SAMD21)
+    PM->AHBMASK.reg |= PM_AHBMASK_USB;
+    PM->APBBMASK.reg |= PM_APBBMASK_USB;
+    GCLK->CLKCTRL.reg = (uint32_t)(GCLK_CLKCTRL_CLKEN |
+                                   GCLK_CLKCTRL_GEN_GCLK0 |
+                                   (GCLK_CLKCTRL_ID(USB_GCLK_ID)));
+#elif defined(CPU_FAM_SAML21)

Thanks!

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


More information about the notifications mailing list