zephyr/subsys/usb/device_next/usbd_interface.h
Johann Fischer cb8b9ad38a usb: add new experimental USB device stack
The device supprt brings support for multiple stack instances,
multiple configuration, asynchronous transfer model, ability to
change most of the properties of a device at runtime and
the composition of configuration and classes at runtime.

The stack requires new UDC driver API and is not compatible
with old driver API (usb_dc_). The classes (functions) of old
(current) USB device stack cannot be used with new ones and must
be ported.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2022-12-02 12:55:18 +01:00

52 lines
1.4 KiB
C

/*
* Copyright (c) 2022 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ZEPHYR_INCLUDE_USBD_INTERFACE_H
#define ZEPHYR_INCLUDE_USBD_INTERFACE_H
#include <zephyr/usb/usbd.h>
/**
* @brief Shutdown all interfaces in a configuration.
*
* @param[in] uds_ctx Pointer to USB device support context
* @param[in] cfg_nd Pointer to configuration node
*
* @return 0 on success, other values on fail.
*/
int usbd_interface_shutdown(struct usbd_contex *const uds_ctx,
struct usbd_config_node *const cfg_nd);
/**
* @brief Setup all interfaces in a configuration to default alternate.
*
* @note Used only for configuration change.
*
* @param[in] uds_ctx Pointer to USB device support context
* @param[in] cfg_nd Pointer to configuration node
*
* @return 0 on success, other values on fail.
*/
int usbd_interface_default(struct usbd_contex *const uds_ctx,
struct usbd_config_node *const cfg_nd);
/**
* @brief Set interface alternate
*
* @note Used only for configuration change.
*
* @param[in] uds_ctx Pointer to USB device support context
* @param[in] iface Interface number (bInterfaceNumber)
* @param[in] alternate Interface alternate (bAlternateSetting)
*
* @return 0 on success, other values on fail.
*/
int usbd_interface_set(struct usbd_contex *uds_ctx,
const uint8_t iface,
const uint8_t alternate);
#endif /* ZEPHYR_INCLUDE_USBD_INTERFACE_H */