1 // Copyright 2019-2020 Espressif Systems (Shanghai) PTE LTD
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 //     http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #pragma once
16 
17 #include <stdint.h>
18 #include <stdbool.h>
19 
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23 
24 #define USB_DESCRIPTOR_TYPE_ACM 0
25 #define USB_DESCRIPTOR_TYPE_DFU 1
26 
27 void usb_set_current_descriptor(int descriptor_type);
28 
29 bool usb_get_descriptor(uint16_t type_index, uint16_t lang_id,
30                         int32_t *len, uint8_t **data);
31 
32 #ifdef __cplusplus
33 }
34 #endif
35