1 /*
2  * Copyright (c) 2022 Nordic Semiconductor ASA
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #ifndef ZEPHYR_INCLUDE_USBD_DESC_H
8 #define ZEPHYR_INCLUDE_USBD_DESC_H
9 
10 #include <zephyr/usb/usbd.h>
11 
12 /**
13  * @brief Get USB descriptor node
14  *
15  * Get descriptor node from internal descriptor list.
16  *
17  * @param[in] ctx    Pointer to USB device support context
18  * @param[in] type   Descriptor type (bDescriptorType)
19  * @param[in] idx    Descriptor index
20  *
21  * @return pointer to descriptor node or NULL if not found.
22  */
23 struct usbd_desc_node *usbd_get_descriptor(struct usbd_context *const uds_ctx,
24 					   const uint8_t type, const uint8_t idx);
25 
26 /**
27  * @brief Remove all descriptors from an USB device context
28  *
29  * This removes all loose descriptors like string descriptors.
30  * Descriptors like configuration, or interface are not touched
31  * by this.
32  *
33  * @param[in] uds_ctx Pointer to device context
34  *
35  * @return 0 on success, other values on fail.
36  */
37 int usbd_desc_remove_all(struct usbd_context *const uds_ctx);
38 
39 #endif /* ZEPHYR_INCLUDE_USBD_DESC_H */
40