2022-01-05 13:44:48 +01:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2022 Nordic Semiconductor ASA
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef ZEPHYR_INCLUDE_USBD_DESC_H
|
|
|
|
#define ZEPHYR_INCLUDE_USBD_DESC_H
|
|
|
|
|
|
|
|
#include <zephyr/usb/usbd.h>
|
|
|
|
|
|
|
|
/**
|
2024-04-26 17:56:47 +02:00
|
|
|
* @brief Get USB descriptor node
|
2022-01-05 13:44:48 +01:00
|
|
|
*
|
2024-04-26 17:56:47 +02:00
|
|
|
* Get descriptor node from internal descriptor list.
|
2022-01-05 13:44:48 +01:00
|
|
|
*
|
|
|
|
* @param[in] ctx Pointer to USB device support context
|
|
|
|
* @param[in] type Descriptor type (bDescriptorType)
|
|
|
|
* @param[in] idx Descriptor index
|
|
|
|
*
|
2024-04-26 17:56:47 +02:00
|
|
|
* @return pointer to descriptor node or NULL if not found.
|
2022-01-05 13:44:48 +01:00
|
|
|
*/
|
2024-05-29 14:06:25 +02:00
|
|
|
struct usbd_desc_node *usbd_get_descriptor(struct usbd_context *const uds_ctx,
|
2024-04-26 17:56:47 +02:00
|
|
|
const uint8_t type, const uint8_t idx);
|
2022-01-05 13:44:48 +01:00
|
|
|
|
2023-05-15 11:52:25 +02:00
|
|
|
/**
|
|
|
|
* @brief Remove all descriptors from an USB device context
|
|
|
|
*
|
|
|
|
* This removes all loose descriptors like string descriptors.
|
|
|
|
* Descriptors like configuration, or interface are not touched
|
|
|
|
* by this.
|
|
|
|
*
|
|
|
|
* @param[in] uds_ctx Pointer to device context
|
|
|
|
*
|
|
|
|
* @return 0 on success, other values on fail.
|
|
|
|
*/
|
2024-05-29 14:06:25 +02:00
|
|
|
int usbd_desc_remove_all(struct usbd_context *const uds_ctx);
|
2023-05-15 11:52:25 +02:00
|
|
|
|
2022-01-05 13:44:48 +01:00
|
|
|
#endif /* ZEPHYR_INCLUDE_USBD_DESC_H */
|