Skip to content

add Adafruit_USBD_HID::getProtocol #382

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

Merged
merged 1 commit into from
Feb 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/arduino/hid/Adafruit_USBD_HID.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,10 @@ bool Adafruit_USBD_HID::sendReport32(uint8_t report_id, uint32_t num) {
return tud_hid_n_report(_instance, report_id, &num, sizeof(num));
}

uint8_t Adafruit_USBD_HID::getProtocol() {
return tud_hid_n_get_protocol(_instance);
}

//------------- TinyUSB callbacks -------------//
extern "C" {

Expand Down
2 changes: 2 additions & 0 deletions src/arduino/hid/Adafruit_USBD_HID.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ class Adafruit_USBD_HID : public Adafruit_USBD_Interface {
bool ready(void);
bool sendReport(uint8_t report_id, void const *report, uint8_t len);

uint8_t getProtocol();

// Report helpers
bool sendReport8(uint8_t report_id, uint8_t num);
bool sendReport16(uint8_t report_id, uint16_t num);
Expand Down