This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Send key value problem

Hello, I modified the instance in usbd_hid_generic to simulate it as keyboard. I checked the code of NRF52840 on github about the keyboard. It USES the function app_usbd_hid_generic_in_report_set() to send the key value, but I can't port it to generic, please help me

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <stdint.h>
#include "nrf5_usb.h"
#include "ble_service.h"
#include "outputselect.h"
#ifdef NKRO_ENABLE
# include "keycode_config.h"
extern keymap_config_t keymap_config;
#endif
static uint8_t keyboard_led_stats = 0;
static bool m_report_pending;
static const app_usbd_hid_subclass_desc_t *keyboard_hid_report_desc[] = {&kbd_desc};
APP_USBD_HID_GENERIC_GLOBAL_DEF(m_app_hid_kbd, HID_KBD_INTERFACE, hid_kbd_user_ev_handler, (NRF_DRV_USBD_EPIN6), keyboard_hid_report_desc, 1, 1, APP_USBD_HID_SUBCLASS_BOOT, APP_USBD_HID_PROTO_KEYBOARD);
#ifdef NKRO_ENABLE
static const app_usbd_hid_subclass_desc_t *keyboard2_hid_report_desc[] = {&kbd2_desc};
APP_USBD_HID_GENERIC_GLOBAL_DEF(m_app_hid_kbd2, HID_KBD2_INTERFACE, hid_kbd_user_ev_handler, (NRF_DRV_USBD_EPIN2), keyboard2_hid_report_desc, 1, 1, APP_USBD_HID_SUBCLASS_NONE, APP_USBD_HID_PROTO_GENERIC);
#endif
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX