| 
    Zephyr Project API
    3.4.0
    
   A Scalable Open Source RTOS 
   | 
 
New experimental USB device stack APIs and structures. More...
#include <zephyr/device.h>#include <zephyr/usb/usb_ch9.h>#include <zephyr/net/buf.h>#include <zephyr/sys/byteorder.h>#include <zephyr/sys/slist.h>#include <zephyr/logging/log.h>#include <zephyr/sys/iterable_sections.h>Go to the source code of this file.
Data Structures | |
| struct | usbd_desc_node | 
| struct | usbd_config_node | 
| struct | usbd_ch9_data | 
| struct | usbd_status | 
| struct | usbd_contex | 
| struct | usbd_cctx_vendor_req | 
| Vendor Requests Table.  More... | |
| struct | usbd_class_api | 
| USB device support class instance API.  More... | |
| struct | usbd_class_data | 
| USB device support class data.  More... | |
| struct | usbd_class_node | 
Macros | |
| #define | USB_BSTRING_LENGTH(s) (sizeof(s) * 2 - 2) | 
| #define | USB_STRING_DESCRIPTOR_LENGTH(s) (sizeof(s) * 2) | 
| #define | USBD_NUMOF_INTERFACES_MAX 16U | 
| #define | USBD_CCTX_REGISTERED 0 | 
| #define | USBD_DEVICE_DEFINE(device_name, uhc_dev, vid, pid) | 
| #define | USBD_CONFIGURATION_DEFINE(name, attrib, power) | 
| #define | USBD_DESC_LANG_DEFINE(name) | 
| Create a string descriptor node and language string descriptor.  More... | |
| #define | USBD_DESC_STRING_DEFINE(d_name, d_string, d_utype) | 
| #define | USBD_DESC_MANUFACTURER_DEFINE(d_name, d_string) USBD_DESC_STRING_DEFINE(d_name, d_string, USBD_DUT_STRING_MANUFACTURER) | 
| Create a string descriptor node and manufacturer string descriptor.  More... | |
| #define | USBD_DESC_PRODUCT_DEFINE(d_name, d_string) USBD_DESC_STRING_DEFINE(d_name, d_string, USBD_DUT_STRING_PRODUCT) | 
| Create a string descriptor node and product string descriptor.  More... | |
| #define | USBD_DESC_SERIAL_NUMBER_DEFINE(d_name, d_string) USBD_DESC_STRING_DEFINE(d_name, d_string, USBD_DUT_STRING_SERIAL_NUMBER) | 
| Create a string descriptor node and serial number string descriptor.  More... | |
| #define | USBD_DEFINE_CLASS(class_name, class_api, class_data) | 
| #define | VENDOR_REQ_DEFINE(_reqs, _len) | 
| Helper to declare request table of usbd_cctx_vendor_req.  More... | |
| #define | USBD_VENDOR_REQ(_reqs...) | 
| Helper to declare supported vendor requests.  More... | |
Enumerations | |
| enum | usbd_desc_usage_type {  USBD_DUT_STRING_LANG , USBD_DUT_STRING_MANUFACTURER , USBD_DUT_STRING_PRODUCT , USBD_DUT_STRING_SERIAL_NUMBER , USBD_DUT_STRING_INTERFACE }  | 
| enum | usbd_ch9_state { USBD_STATE_DEFAULT = 0 , USBD_STATE_ADDRESS , USBD_STATE_CONFIGURED } | 
Functions | |
| int | usbd_add_descriptor (struct usbd_contex *uds_ctx, struct usbd_desc_node *dn) | 
| Add common USB descriptor.  More... | |
| int | usbd_add_configuration (struct usbd_contex *uds_ctx, struct usbd_config_node *cd) | 
| Add a USB device configuration.  More... | |
| int | usbd_register_class (struct usbd_contex *uds_ctx, const char *name, uint8_t cfg) | 
| Register an USB class instance.  More... | |
| int | usbd_unregister_class (struct usbd_contex *uds_ctx, const char *name, uint8_t cfg) | 
| Unregister an USB class instance.  More... | |
| int | usbd_init (struct usbd_contex *uds_ctx) | 
| Initialize USB device.  More... | |
| int | usbd_enable (struct usbd_contex *uds_ctx) | 
| Enable the USB device support and registered class instances.  More... | |
| int | usbd_disable (struct usbd_contex *uds_ctx) | 
| Disable the USB device support.  More... | |
| int | usbd_shutdown (struct usbd_contex *const uds_ctx) | 
| Shutdown the USB device support.  More... | |
| int | usbd_ep_set_halt (struct usbd_contex *uds_ctx, uint8_t ep) | 
| Halt endpoint.  More... | |
| int | usbd_ep_clear_halt (struct usbd_contex *uds_ctx, uint8_t ep) | 
| Clear endpoint halt.  More... | |
| bool | usbd_ep_is_halted (struct usbd_contex *uds_ctx, uint8_t ep) | 
| Checks whether the endpoint is halted.  More... | |
| struct net_buf * | usbd_ep_ctrl_buf_alloc (struct usbd_contex *const uds_ctx, const uint8_t ep, const size_t size) | 
| Allocate buffer for USB device control request.  More... | |
| struct net_buf * | usbd_ep_buf_alloc (const struct usbd_class_node *const c_nd, const uint8_t ep, const size_t size) | 
| Allocate buffer for USB device request.  More... | |
| int | usbd_ep_ctrl_enqueue (struct usbd_contex *const uds_ctx, struct net_buf *const buf) | 
| Queue USB device control request.  More... | |
| int | usbd_ep_enqueue (const struct usbd_class_node *const c_nd, struct net_buf *const buf) | 
| Queue USB device request.  More... | |
| int | usbd_ep_dequeue (struct usbd_contex *uds_ctx, const uint8_t ep) | 
| Remove all USB device controller requests from endpoint queue.  More... | |
| int | usbd_ep_buf_free (struct usbd_contex *uds_ctx, struct net_buf *buf) | 
| Free USB device request buffer.  More... | |
| bool | usbd_is_suspended (struct usbd_contex *uds_ctx) | 
| Checks whether the USB device controller is suspended.  More... | |
| int | usbd_wakeup_request (struct usbd_contex *uds_ctx) | 
| Initiate the USB remote wakeup (TBD)  More... | |
| int | usbd_device_set_bcd (struct usbd_contex *const uds_ctx, const uint16_t bcd) | 
| Set USB device descriptor value bcdUSB.  More... | |
| int | usbd_device_set_vid (struct usbd_contex *const uds_ctx, const uint16_t vid) | 
| Set USB device descriptor value idVendor.  More... | |
| int | usbd_device_set_pid (struct usbd_contex *const uds_ctx, const uint16_t pid) | 
| Set USB device descriptor value idProduct.  More... | |
| int | usbd_device_set_class (struct usbd_contex *const uds_ctx, const uint8_t value) | 
| Set USB device descriptor value bDeviceClass.  More... | |
| int | usbd_device_set_subclass (struct usbd_contex *const uds_ctx, const uint8_t value) | 
| Set USB device descriptor value bDeviceSubClass.  More... | |
| int | usbd_device_set_proto (struct usbd_contex *const uds_ctx, const uint8_t value) | 
| Set USB device descriptor value bDeviceProtocol.  More... | |
| int | usbd_config_attrib_rwup (struct usbd_contex *const uds_ctx, const uint8_t cfg, const bool enable) | 
| Setup USB device configuration attribute Remote Wakeup.  More... | |
| int | usbd_config_attrib_self (struct usbd_contex *const uds_ctx, const uint8_t cfg, const bool enable) | 
| Setup USB device configuration attribute Self-powered.  More... | |
| int | usbd_config_maxpower (struct usbd_contex *const uds_ctx, const uint8_t cfg, const uint8_t power) | 
| Setup USB device configuration power consumption.  More... | |
New experimental USB device stack APIs and structures.
This file contains the USB device stack APIs and structures.