change HID config, move HID boot config to part of auto descriptor only

This commit is contained in:
hathach
2018-07-28 12:38:45 +07:00
parent 456506045f
commit 9f61493020
11 changed files with 120 additions and 93 deletions

View File

@@ -49,8 +49,19 @@
//--------------------------------------------------------------------+
// KEYBOARD APPLICATION API
// HID GENERIC API
//--------------------------------------------------------------------+
bool tud_hid_generic_ready(void);
bool tud_hid_generic_report(void);
/*------------- Callbacks -------------*/
ATTR_WEAK uint16_t tud_hid_get_report_cb(uint8_t report_id, hid_report_type_t report_type, uint8_t* buffer, uint16_t reqlen);
ATTR_WEAK void tud_hid_set_report_cb(uint8_t report_id, hid_report_type_t report_type, uint8_t const* buffer, uint16_t bufsize);
//--------------------------------------------------------------------+
// KEYBOARD API
//--------------------------------------------------------------------+
#if CFG_TUD_HID_KEYBOARD
/** \addtogroup ClassDriver_HID_Keyboard Keyboard
* @{ */
/** \defgroup Keyboard_Device Device
@@ -78,7 +89,9 @@ typedef struct{
extern const hid_ascii_to_keycode_entry_t HID_ASCII_TO_KEYCODE[128];
#endif
/*------------- Callbacks, ATTR_WEAK means optional -------------*/
#endif
/*------------- Callbacks -------------*/
/** Callback invoked when USB host request \ref HID_REQ_CONTROL_GET_REPORT.
* \param[in] report_type specify which report (INPUT, OUTPUT, FEATURE) that host requests
@@ -109,8 +122,9 @@ ATTR_WEAK void tud_hid_keyboard_set_report_cb(hid_report_type_t report_type, uin
/** @} */
//--------------------------------------------------------------------+
// MOUSE APPLICATION API
// MOUSE API
//--------------------------------------------------------------------+
#if CFG_TUD_HID_MOUSE
/** \addtogroup ClassDriver_HID_Mouse Mouse
* @{ */
/** \defgroup Mouse_Device Device
@@ -141,10 +155,10 @@ static inline bool tud_hid_mouse_button_release(void)
/*------------- Callbacks -------------*/
/** \brief Callback function that is invoked when USB host request \ref HID_REQUEST_CONTROL_GET_REPORT
* via control endpoint.
/**
* Callback function that is invoked when USB host request \ref HID_REQ_CONTROL_GET_REPORT.
* \param[in] report_type specify which report (INPUT, OUTPUT, FEATURE) that host requests
* \param[out] buffer buffer that application need to update, value must be accessible by USB controller (see \ref CFG_TUSB_ATTR_USBRAM)
* \param[out] buffer buffer that application need to update, value must be accessible by USB controller (see \ref CFG_TUSB_ATTR_USBRAM)
* \param[in] reqlen number of bytes that host requested
* \retval non-zero Actual number of bytes in the response's buffer.
* \retval zero indicates the current request is not supported. Tinyusb device stack will reject the request by
@@ -154,8 +168,8 @@ static inline bool tud_hid_mouse_button_release(void)
*/
ATTR_WEAK uint16_t tud_hid_mouse_get_report_cb(hid_report_type_t report_type, uint8_t* buffer, uint16_t reqlen);
/** \brief Callback function that is invoked when USB host request \ref HID_REQUEST_CONTROL_SET_REPORT
* via control endpoint.
/**
* Callback function that is invoked when USB host request \ref HID_REQ_CONTROL_SET_REPORT.
* \param[in] report_type specify which report (INPUT, OUTPUT, FEATURE) that host requests
* \param[in] buffer buffer containing the report's data
* \param[in] bufsize number of bytes in the \a p_report_data
@@ -166,13 +180,15 @@ ATTR_WEAK void tud_hid_mouse_set_report_cb(hid_report_type_t report_type, uint8_
//ATTR_WEAK void tud_hid_mouse_set_protocol_cb(bool boot_protocol);
#endif
/** @} */
/** @} */
//--------------------------------------------------------------------+
// USBD-CLASS DRIVER API
// INTERNAL API
//--------------------------------------------------------------------+
#ifdef _TINY_USB_SOURCE_FILE_