1 /* 2 * Copyright (c) 2022 Nordic Semiconductor ASA 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 #ifndef ZEPHYR_INCLUDE_USBD_INTERFACE_H 8 #define ZEPHYR_INCLUDE_USBD_INTERFACE_H 9 10 #include <zephyr/usb/usbd.h> 11 12 /** 13 * @brief Shutdown all interfaces in a configuration. 14 * 15 * @param[in] uds_ctx Pointer to USB device support context 16 * @param[in] cfg_nd Pointer to configuration node 17 * 18 * @return 0 on success, other values on fail. 19 */ 20 int usbd_interface_shutdown(struct usbd_context *const uds_ctx, 21 struct usbd_config_node *const cfg_nd); 22 23 /** 24 * @brief Setup all interfaces in a configuration to default alternate. 25 * 26 * @note Used only for configuration change. 27 * 28 * @param[in] uds_ctx Pointer to USB device support context 29 * @param[in] speed Configuration speed 30 * @param[in] cfg_nd Pointer to configuration node 31 * 32 * @return 0 on success, other values on fail. 33 */ 34 int usbd_interface_default(struct usbd_context *const uds_ctx, 35 const enum usbd_speed speed, 36 struct usbd_config_node *const cfg_nd); 37 38 /** 39 * @brief Set interface alternate 40 * 41 * @note Used only for configuration change. 42 * 43 * @param[in] uds_ctx Pointer to USB device support context 44 * @param[in] iface Interface number (bInterfaceNumber) 45 * @param[in] alternate Interface alternate (bAlternateSetting) 46 * 47 * @return 0 on success, other values on fail. 48 */ 49 int usbd_interface_set(struct usbd_context *uds_ctx, 50 const uint8_t iface, 51 const uint8_t alternate); 52 53 #endif /* ZEPHYR_INCLUDE_USBD_INTERFACE_H */ 54