add tuh_hid_itf_get_info() and change tuh_cdc_itf_get_info() to use new tuh_itf_info_t

This commit is contained in:
hathach
2023-03-22 10:00:42 +07:00
parent f8a5cde3c7
commit f27486e19a
8 changed files with 58 additions and 24 deletions

View File

@@ -71,21 +71,13 @@
// Application API
//--------------------------------------------------------------------+
typedef struct
{
uint8_t daddr;
uint8_t bInterfaceNumber;
uint8_t bInterfaceSubClass;
uint8_t bInterfaceProtocol;
} tuh_cdc_itf_info_t;
// Get Interface index from device address + interface number
// return TUSB_INDEX_INVALID_8 (0xFF) if not found
uint8_t tuh_cdc_itf_get_index(uint8_t daddr, uint8_t itf_num);
// Get Interface information
// return true if index is correct and interface is currently mounted
bool tuh_cdc_itf_get_info(uint8_t idx, tuh_cdc_itf_info_t* info);
bool tuh_cdc_itf_get_info(uint8_t idx, tuh_itf_info_t* info);
// Check if a interface is mounted
bool tuh_cdc_mounted(uint8_t idx);