Host HID example how to control caps lock LED on USB keyboard #1191
jeroentaverne
started this conversation in
General
Replies: 3 comments 4 replies
-
|
you can use the following API. typically for boot mode, // Set Report using control endpoint
// report_type is either Intput, Output or Feature, (value from hid_report_type_t)
bool tuh_hid_set_report(uint8_t dev_addr, uint8_t instance, uint8_t report_id, uint8_t report_type, void* report, uint16_t len);
typedef enum
{
KEYBOARD_LED_NUMLOCK = TU_BIT(0), ///< Num Lock LED
KEYBOARD_LED_CAPSLOCK = TU_BIT(1), ///< Caps Lock LED
KEYBOARD_LED_SCROLLLOCK = TU_BIT(2), ///< Scroll Lock LED
KEYBOARD_LED_COMPOSE = TU_BIT(3), ///< Composition Mode
KEYBOARD_LED_KANA = TU_BIT(4) ///< Kana mode
}hid_keyboard_led_bm_t; |
Beta Was this translation helpful? Give feedback.
2 replies
-
|
Thanks, I will give it a try. |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
@hathach Could you please provide a full example so I can fix my code here and here, thanks! |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Using the host_cdc_msc_hid example I would also like to control the capslock LED on a USB keyboard. What lines of code would I need to add to control it? Turning it on would already be great.
Beta Was this translation helpful? Give feedback.
All reactions