Hi falks,
Is possibile to implement multiple usb hid interface? Kayboard + mouse
Thanks and regards,
F.
Multiple Usb HID interface
-
- Posts: 89
- Joined: Fri Sep 11, 2015 10:47 pm
- Location: Italy
Re: Multiple Usb HID interface
Unfortunately I don't think so... the pyb.usb_mode can only be given either hid=pyb.hid_keyboard or hid=pyb.hid_mouse.pagano.paganino wrote: ↑Mon Jan 25, 2021 11:03 amIs possibile to implement multiple usb hid interface? Kayboard + mouse
This could probably be added though -- look in stm32/usb.c
STATIC mp_obj_t pyb_usb_mode(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
-
- Posts: 89
- Joined: Fri Sep 11, 2015 10:47 pm
- Location: Italy
Re: Multiple Usb HID interface
Reading the documentation https://www.usb.org/sites/default/files/hid1_11.pdf regarding the usb hid I found that it is possible to declare more reports but specifying a report id.
Can this feature be used in micropython?
the current implementation of the mouse and keyboard report ignore the report id (as per specification since it is only one report)
How complicated is it to implement this functionality?
https://github.com/micropython/micropyt ... hid.c#L340
https://github.com/micropython/micropyt ... id.c#L381
Thanks and regards,
F.
Can this feature be used in micropython?
the current implementation of the mouse and keyboard report ignore the report id (as per specification since it is only one report)
How complicated is it to implement this functionality?
https://github.com/micropython/micropyt ... hid.c#L340
https://github.com/micropython/micropyt ... id.c#L381
Thanks and regards,
F.
Re: Multiple Usb HID interface
It can be done using an adequate HID descriptor.
-
- Posts: 89
- Joined: Fri Sep 11, 2015 10:47 pm
- Location: Italy
Re: Multiple Usb HID interface
We are using it on PYBD SW6 to emulate a combination of TOUCH & KEYBOARD. It works perfect.
-
- Posts: 89
- Joined: Fri Sep 11, 2015 10:47 pm
- Location: Italy
Re: Multiple Usb HID interface
Can you share an example of hid descriptor?
-
- Posts: 89
- Joined: Fri Sep 11, 2015 10:47 pm
- Location: Italy