💡[FEATURE] Sample code for writing to HID device without tinyusb
samartzidis opened this issue · 0 comments
samartzidis commented
Hi,
I have seen your capture_hid_report sample showing how to receive HID reports using the low-level pio_usb_get_in_data() function, without the tinyusb stack (typically done via tuh_hid_report_received_cb()).
Writing back to the device via tinyusb would be achieved via the tuh_hid_set_report() function. For instance, if the hosted device is a keyboard, turning the caps lock led on would be achieved by something like this:
static uint8_t leds = 2;
tuh_hid_set_report(dev_addr, instance, 0, HID_REPORT_TYPE_OUTPUT, &leds, sizeof(leds));
What would be the equivalent code for writing the out report to the keyboard without tinyusb, by using the Pico-PIO-USB API? Can you point me in the right direction for which Pico-PIO-USB API function to look at? Maybe pio_usb_set_out_data?
Thank you!