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

Koen Zandberg notifications at github.com
Sun Feb 10 12:32:13 CET 2019


bergzand commented on this pull request.



> +{
+    UsbDeviceDescBank *bank = _bank_from_ep(ep);
+
+    bank->ADDR.reg = (uint32_t)ep->buf;
+}
+
+void _ep_set_stall(usbdev_ep_t *ep, usbopt_enable_t enable)
+{
+    UsbDeviceEndpoint *ep_reg = &USB->DEVICE.DeviceEndpoint[ep->num];
+
+    if (ep->dir == USB_EP_DIR_IN) {
+        if (enable) {
+            ep_reg->EPSTATUSSET.reg = USB_DEVICE_EPSTATUSSET_STALLRQ1;
+        }
+        else {
+            ep_reg->EPSTATUSCLR.reg = USB_DEVICE_EPSTATUSSET_STALLRQ1;

fixed :blush: 

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


More information about the notifications mailing list