[CDC + HID] CDC interface number mismatch — tud_cdc_n_*() always requires 0 #3212
Unanswered
fikririzal
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
I have implemented a USB device with two interfaces, based on cdc_dual_port :
Everything works as expected, but I noticed something strange:
In order to make CDC communication work, I always need to pass
0
as the interface index totud_cdc_n_*()
API, even though in my descriptor the CDC interface number is not zero.Interface enum and descriptors
CDC task code
HID Keyboard code
(taken from TinyUSB HID example, works fine with ITF_NUM_KEYBOARD)
Question
Why does
tud_cdc_n_*()
require passing0
for the interface index, instead of the actual CDC interface number from my enum? Is the parameter fortud_cdc_n_*()
referring to the CDC instance index rather than the USB interface number? If so, what is the correct way to match them?Thank you!
Beta Was this translation helpful? Give feedback.
All reactions