Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

transferring hid packets larger than CFG_TUD_HID_EP_BUFSIZE #2951

Closed
1 task done
CNflysky opened this issue Jan 16, 2025 · 1 comment
Closed
1 task done

transferring hid packets larger than CFG_TUD_HID_EP_BUFSIZE #2951

CNflysky opened this issue Jan 16, 2025 · 1 comment

Comments

@CNflysky
Copy link

CNflysky commented Jan 16, 2025

Related area

hid class driver

Hardware specification

rp2040

Is your feature request related to a problem?

hello,
im currently developing hid-compatible touchscreen on custom RP2040 boards. my issue is, the size of touchscreen hid report (83 bytes) is too big for CFG_TUD_HID_EP_BUFSIZE, as it can't be larger than 64 otherwise tinyusb init will fail.

Describe the solution you'd like

Would you developers add some kind of "mechanism" that can deal oversized hid buffer transfer requests ,like split them into multiple chunks to transfer?

btw some vendor required report size is also larger than 64 bytes, like this binary blob found on msdn.

I have checked existing issues, dicussion and documentation

  • I confirm I have checked existing issues, dicussion and documentation.
@CNflysky
Copy link
Author

ugly workaround:
assume CFG_TUD_HID_EP_BUFSIZE is 64.

uint8_t buffer[83] = {0x00};
tud_hid_report(1, &buffer, CFG_TUD_HID_EP_BUFSIZE - 1);
bool part_transfered = true;

void tud_hid_report_complete_cb(uint8_t instance, uint8_t const *report,
                                uint16_t len) {
  if (part_transfered) {
    tud_hid_report(
        0, (void *)((uint32_t)&buffer + CFG_TUD_HID_EP_BUFSIZE - 1),
        sizeof(buffer) + 1 - CFG_TUD_HID_EP_BUFSIZE);
    part_transfered = false;
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant