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

Implemented tuh_hid_send_report #1889

Merged
merged 4 commits into from Mar 13, 2023
Merged

Implemented tuh_hid_send_report #1889

merged 4 commits into from Mar 13, 2023

Conversation

Tails86
Copy link
Contributor

@Tails86 Tails86 commented Feb 8, 2023

Describe the PR
Defined tuh_hid_send_report using ep_out defined in hidh_interface_t structure.

Additional context
I assume tuh_hid_send_report was originally not defined because hidh_open originally only parsed for ep_in. I don't see any reason why it shouldn't be defined now, so I took a stab at it. I tested it on an RP2040 by sending vibration to a Dualshock 4 HID controller on its OUT endpoint, 3.

Sample output:

HID Send Report 5
  0000:  05 01 00 00 FF FF 00 00 00 00 00 00 00 00 00 00  |................|
  0010:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  |................|
  Queue EP 03 with 32 bytes ... hcd_edpt_xfer dev_addr 1, ep_addr 0x3, len 32
  Prepare BufCtrl: [0] = 0x54304  [1] = 0x0000
OK
Completed transfer of 32 bytes on ep 3 out

@Tails86
Copy link
Contributor Author

Tails86 commented Feb 10, 2023

Sorry for the churn on this. I thought it would be useful to include use of tuh_hid_send_report() in example code. In the example, pressing the left and right triggers should control the left and right motors respectively. I don't plan on pushing anything further.

@hathach
Copy link
Owner

hathach commented Feb 23, 2023

Sorry for the churn on this. I thought it would be useful to include use of tuh_hid_send_report() in example code. In the example, pressing the left and right triggers should control the left and right motors respectively. I don't plan on pushing anything further.

not a problem at all, it is much better to demonstrate API usage with example. Sorry for being late on the review, I will try to review this as soon as I could. Just approve to get ci running (required by github for 1st time contributor)

@Tails86
Copy link
Contributor Author

Tails86 commented Feb 27, 2023

Can someone please check this? The test seemed to fail due to an issue with the test harness

@hathach
Copy link
Owner

hathach commented Feb 27, 2023

ci failed due to hw changes to self-hosted ci runner, don't worry about it for now. I will review this soon, look like we could have an merge easy. Thank you

Copy link
Owner

@hathach hathach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perfect ! Thank you for your PR and patient, there is nothing I could add. I only did a rebase to fix ci and will merge shortly after ci passed.

@hathach hathach merged commit 7cf67b2 into hathach:master Mar 13, 2023
33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants