fix(usb): support bidirectional endpoints on RP2 and SAMD21/51.

Remap CDC and MSC endpoints to share physical endpoint numbers. This change separates IN/OUT directional states for RP2 endpoints to prevent cross-talk, ensures SAMD21 and SAMD51 endpoint configuration merging does not overwrite bidirectionally shared registers, implements missing SAMD endpoint stall and clear methods, and corrects SAMD interrupt loop bounds to iterate over physical endpoint numbers rather than dynamic configuration entries.
This commit is contained in:
Konstantin Sharlaimov
2026-06-08 20:37:33 +02:00
committed by Ron Evans
parent c3f1832d9a
commit eab43851ac
7 changed files with 152 additions and 77 deletions
+7 -3
View File
@@ -2,10 +2,14 @@
package cdc
import (
"machine/usb"
)
const (
cdcEndpointACM = 1
cdcEndpointOut = 2
cdcEndpointIn = 3
cdcEndpointACM = usb.CDC_ENDPOINT_ACM
cdcEndpointOut = usb.CDC_ENDPOINT_OUT
cdcEndpointIn = usb.CDC_ENDPOINT_IN
)
// New returns USBCDC struct.