2022-01-03 21:17:32 -05:00
|
|
|
/*
|
|
|
|
* SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
2020-03-06 09:04:06 -05:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <string.h>
|
|
|
|
#include "usb_descriptors.h"
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
//------------- HID Report Descriptor -------------//
|
|
|
|
#if CFG_TUD_HID
|
|
|
|
enum {
|
|
|
|
REPORT_ID_KEYBOARD = 1,
|
|
|
|
REPORT_ID_MOUSE
|
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
|
|
|
//------------- Configuration Descriptor -------------//
|
|
|
|
enum {
|
|
|
|
# if CFG_TUD_CDC
|
|
|
|
ITF_NUM_CDC = 0,
|
|
|
|
ITF_NUM_CDC_DATA,
|
|
|
|
# endif
|
|
|
|
|
2021-12-16 01:50:08 -05:00
|
|
|
# if CFG_TUD_CDC > 1
|
|
|
|
ITF_NUM_CDC1,
|
|
|
|
ITF_NUM_CDC1_DATA,
|
|
|
|
# endif
|
|
|
|
|
2020-03-06 09:04:06 -05:00
|
|
|
# if CFG_TUD_MSC
|
|
|
|
ITF_NUM_MSC,
|
|
|
|
# endif
|
|
|
|
|
|
|
|
# if CFG_TUD_HID
|
|
|
|
ITF_NUM_HID,
|
|
|
|
# endif
|
|
|
|
|
|
|
|
ITF_NUM_TOTAL
|
|
|
|
};
|
|
|
|
|
|
|
|
enum {
|
2020-08-06 08:41:32 -04:00
|
|
|
TUSB_DESC_TOTAL_LEN = TUD_CONFIG_DESC_LEN + CFG_TUD_CDC * TUD_CDC_DESC_LEN + CFG_TUD_MSC * TUD_MSC_DESC_LEN +
|
2020-03-06 09:04:06 -05:00
|
|
|
CFG_TUD_HID * TUD_HID_DESC_LEN
|
|
|
|
};
|
|
|
|
|
2021-07-08 23:15:26 -04:00
|
|
|
void tusb_set_descriptor(tusb_desc_device_t *desc, const char **str_desc);
|
2020-03-06 09:04:06 -05:00
|
|
|
tusb_desc_device_t *tusb_get_active_desc(void);
|
|
|
|
char **tusb_get_active_str_desc(void);
|
|
|
|
void tusb_clear_descriptor(void);
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|