nRF52840 only: Module with types, definitions, and API used by the HID generic class. More...
Modules |
|
| USB HID generic descriptors | |
|
nRF52840 only:
Module with descriptors used by the HID generic class.
|
|
| USB HID generic configuration | |
| USB HID generic internals | |
|
nRF52840 only:
Module with types, definitions, and API used by the HID generic protocol.
|
|
Data Structures |
|
| struct | app_usbd_hid_generic_t |
|
HID generic class instance type.
More...
|
|
Macros |
|
| #define | APP_USBD_HID_GENERIC_GLOBAL_DEF (instance_name,interface_number,user_ev_handler,endpoint_list,hid_dsc_list,report_cnt,report_out_maxsize) |
|
Global definition of
app_usbd_hid_generic_t
class.
More...
|
|
Functions |
|
|
static
app_usbd_class_inst_t
const * |
app_usbd_hid_generic_class_inst_get ( app_usbd_hid_generic_t const *p_generic) |
|
Helper function to get class instance from HID generic class.
More...
|
|
|
static
app_usbd_hid_generic_t
const * |
app_usbd_hid_generic_class_get ( app_usbd_class_inst_t const *p_inst) |
|
Helper function to get HID generic from base class instance.
More...
|
|
| ret_code_t | app_usbd_hid_generic_report_in_set ( app_usbd_hid_generic_t const *p_generic, uint8_t rep_id, const void *p_buff, size_t size) |
|
New IN report trigger.
More...
|
|
| bool | app_usbd_hid_generic_report_in_done ( app_usbd_hid_generic_t const *p_generic, uint8_t rep_id) |
|
Checks whether last IN report transfer has been done.
More...
|
|
| uint8_t | app_usbd_hid_generic_in_report_last_id ( app_usbd_hid_generic_t const *p_generic) |
|
Returns last successful transfered IN report.
More...
|
|
| const void * | app_usbd_hid_generic_out_report_get ( app_usbd_hid_generic_t const *p_generic, size_t *p_size) |
|
Returns last successful transfered OUT report.
More...
|
|
Detailed Description
nRF52840 only: Module with types, definitions, and API used by the HID generic class.
Macro Definition Documentation
| #define APP_USBD_HID_GENERIC_GLOBAL_DEF | ( | instance_name, | |
| interface_number, | |||
| user_ev_handler, | |||
| endpoint_list, | |||
| hid_dsc_list, | |||
| report_cnt, | |||
| report_out_maxsize | |||
| ) |
Global definition of app_usbd_hid_generic_t class.
- Parameters
-
instance_name Name of global instance interface_number Unique interface index user_ev_handler User event handler (optional) endpoint_list Input endpoint list ( nrf_drv_usbd_ep_t ) hid_dsc_list HID descriptor item list APP_USBD_HID_REPORT_ITEM , APP_USBD_HID_PHYSICAL_ITEM report_cnt Report count report_out_maxsize Maximum output report size
- Note
- This macro is just simplified version of APP_USBD_HID_GENERIC_GLOBAL_DEF_INTERNAL
Example class definition:
Function Documentation
|
inline static |
Helper function to get HID generic from base class instance.
- Parameters
-
[in] p_inst Base class instance
- Returns
- HID generic class handle
|
inline static |
Helper function to get class instance from HID generic class.
- Parameters
-
[in] p_generic HID generic class instance (defined by APP_USBD_HID_GENERIC_GLOBAL_DEF )
- Returns
- Base class instance
| uint8_t app_usbd_hid_generic_in_report_last_id | ( | app_usbd_hid_generic_t const * | p_generic | ) |
Returns last successful transfered IN report.
- Note
- Use this call only on APP_USBD_HID_USER_EVT_IN_REPORT_DONE event
- Parameters
-
[in] p_generic HID generic class instance (defined by APP_USBD_HID_GENERIC_GLOBAL_DEF )
- Returns
- Last transfered report ID.
| const void* app_usbd_hid_generic_out_report_get | ( | app_usbd_hid_generic_t const * | p_generic , |
| size_t * | p_size | ||
| ) |
Returns last successful transfered OUT report.
- Warning
- Use this call only on APP_USBD_HID_USER_EVT_OUT_REPORT_READY event.
- Parameters
-
[in] p_generic HID generic class instance (defined by APP_USBD_HID_GENERIC_GLOBAL_DEF ) [out] p_size Last transfered OUT report size.
- Returns
- Last transfered OUT report.
| bool app_usbd_hid_generic_report_in_done | ( | app_usbd_hid_generic_t const * | p_generic , |
| uint8_t | rep_id | ||
| ) |
Checks whether last IN report transfer has been done.
Helper function to check, whether that last IN report transfer is done.
- Parameters
-
[in] p_generic HID generic class instance (defined by APP_USBD_HID_GENERIC_GLOBAL_DEF ) rep_id input Report ID
- Returns
- true if transfer done, false otherwise
| ret_code_t app_usbd_hid_generic_report_in_set | ( | app_usbd_hid_generic_t const * | p_generic , |
| uint8_t | rep_id , | ||
| const void * | p_buff , | ||
| size_t | size | ||
| ) |
New IN report trigger.
- Parameters
-
[in] p_generic HID generic class instance (defined by APP_USBD_HID_GENERIC_GLOBAL_DEF ) [in] rep_id Input report ID [in] p_buff Report buffer [in] size Report size
- Returns
- Standard error code