3 posts / 0 new
Last post
Joyyqy
Offline
Last seen:3 years 6 months ago
Joined:2017-05-21 11:58
DA14580 customize a gamepad with HID mouse example

Hi support,
I would like to develop a gamepad with several controlling buttons and a joystick-like rocker. I am trying to develop it based on the HID mouse example. I have got a simple self-made hardware circuit board with IOT development board.
As a beginner, I have read HID service specification, USB device class definition for HID, HOGP spec, etc. But still, I have some problems.

1. In the MOUSE example, I see that the reports sent to host were stored in normal_key_report_st[6] and extended_key_report_st[1]. Are they specifically corresponding to the reports whose id = 1 and 2? Since the example has defined report id 3 report map for us, How do I use it? Do I need to expand the array extended_key_report_st? Or create a new array and expand the REPORT_TYPE enum like this?

enum REPORT_TYPE {
NORMAL_REPORT = 0,
EXTENDED_REPORT = 1,
AUXILIARY_REPORT = 2
};

If so, what about the KEY_BUFF_TYPE?

enum KEY_BUFF_TYPE {
FREE,
PRESS,
RELEASE,
EXTENDED
};

2. I have tried to find the answer by studying the procedure of how mouse buttons work. I see their keycode 0xF400, 0xF401, 0xF402. What do these keycodes mean? I have read through kbd_process_keycode function. Does the developer pick a keycode and modify the corresponding progress function or he was flowing some rules of keycode? What if I would like to develop my own buttons? How do I choose the keycode? I have found some explanation of keycode in the KEYBOARD manual but it seems a little bit different for a mouse.

Thank you so much!
Joy

BTW I speak Chinese. So anyone having suggestions are appreciated whether you speak English or Chinese. ^^

Device:
Qinjiny_Dialog
Offline
Last seen:1 week 17 hours ago
Staff
Joined:2016-11-01 05:47
Have you gone through manual

Have you gone through manual UM-B-027 Mouse Reference Application note? It does have some detailed info about the reference design which might help you.

Joyyqy
Offline
Last seen:3 years 6 months ago
Joined:2017-05-21 11:58
Thank you for your reply and

Thank you for your reply and yes I have gone through 027 manual but still, it does not show me how to use the report ID 3 defined in the report map. It seems like the example project is just using report ID 1 and 2.