void wk_usb_app_task(void) { /* add user code begin usb_app_task 0 */
/* add user code end usb_app_task 0 */
/* add user code begin usb_app_task 1 */
/* add user code end usb_app_task 1 */
/* hs device custom hid */ /* after the the usb connected, user can use the 'custom_hid_class_send_report' function to report keyboard events, for example, to report a char led on/off event as follows:
ALIGNED_HEAD static uint8_t report_buf[64] ALIGNED_TAIL; if(usbd_connect_state_get(&otg_core_struct_hs.dev) == USB_CONN_STATE_CONFIGURED) { report_buf[0] = HID_REPORT_ID_5; report_buf[1] = 0; custom_hid_class_send_report(&otg_core_struct_hs.dev, report_buf, 64); usb_delay_ms(100); report_buf[0] = HID_REPORT_ID_5; report_buf[1] = 1; custom_hid_class_send_report(&otg_core_struct_hs.dev, report_buf, 64); usb_delay_ms(100); } */
/* add user code begin usb_app_task 2 */ ALIGNED_HEAD static uint8_t report_buf[64] ALIGNED_TAIL; if(usbd_connect_state_get(&otg_core_struct_hs.dev) == USB_CONN_STATE_CONFIGURED) { report_buf[0] = HID_REPORT_ID_5; report_buf[1] = 0; custom_hid_class_send_report(&otg_core_struct_hs.dev, report_buf, 64); usb_delay_ms(100); report_buf[0] = HID_REPORT_ID_5; report_buf[1] = 1; custom_hid_class_send_report(&otg_core_struct_hs.dev, report_buf, 64); usb_delay_ms(100); } /* add user code end usb_app_task 2 */ } |