6#include "libxr_type.hpp"
7#include "usb/core/desc_cfg.hpp"
11class DeviceComposition;
37 UNUSED(local_interface_index);
88 bool& ExpectStatusOutZLP() {
return read_zlp; }
89 bool ExpectStatusOutZLP()
const {
return read_zlp; }
91 bool& SendStatusInZLP() {
return write_zlp; }
92 bool SendStatusInZLP()
const {
return write_zlp; }
131 uint16_t wLength, uint16_t wIndex,
188 uint16_t wLength, uint16_t wIndex,
204 void SetInterfaceStringBaseIndex(uint8_t string_index);
常量原始数据封装类。 A class for encapsulating constant raw data.
原始数据封装类。 A class for encapsulating raw data.
BOS 能力接口 / BOS capability interface.
USB 配置项基类(功能块)/ USB configuration item base (functional block)
USB 设备类接口基类 / USB device class interface base.
virtual ErrorCode OnClassRequest(bool in_isr, uint8_t bRequest, uint16_t wValue, uint16_t wLength, uint16_t wIndex, ControlTransferResult &result)
处理 Class-specific 请求(Setup stage)/ Handle class-specific request (Setup stage)
virtual void OnClassInDataStatusComplete(bool in_isr, uint8_t bRequest)
类请求的 IN 数据阶段在 STATUS OUT 完成后回调 Called after the STATUS OUT completes for a Class IN data request.
virtual ErrorCode OnClassData(bool in_isr, uint8_t bRequest, LibXR::ConstRawData &data)
处理 Class request 数据阶段 / Handle class request data stage
virtual ErrorCode OnVendorRequest(bool in_isr, uint8_t bRequest, uint16_t wValue, uint16_t wLength, uint16_t wIndex, ControlTransferResult &result)
处理 Vendor request(Setup stage)/ Handle vendor request (Setup stage)
uint8_t interface_string_base_index_
首个接口字符串索引 / First interface string index
BosCapability * GetBosCapability(size_t index) override
返回指定 BOS capability Return the BOS capability at the given index.
uint8_t GetInterfaceStringIndex(size_t local_interface_index) const
返回已分配的接口字符串索引 Return the assigned USB string index for a local interface.
size_t GetBosCapabilityCount() override
返回本类提供的 BOS capability 数量 Return the number of BOS capabilities exposed by this class.
DeviceClass()=default
默认构造 / Default constructor
virtual ErrorCode OnGetDescriptor(bool in_isr, uint8_t bRequest, uint16_t wValue, uint16_t wLength, ConstRawData &out_data)
处理标准请求 GET_DESCRIPTOR(类特定描述符) Handle standard GET_DESCRIPTOR request (class-specific descriptors).
virtual const char * GetInterfaceString(size_t local_interface_index) const
返回本类暴露的第 N 个接口字符串 Return the string for the Nth local interface exposed by this class.
USB 组合管理器:class 列表、字符串、BOS、配置切换 USB composition manager: class list, strings, BOS,...
USB 设备协议栈核心:EP0 控制传输、描述符、配置、标准/类/厂商请求 USB device core: EP0 control transfer, descriptors,...
@ NOT_SUPPORT
不支持 | Not supported
控制请求(Class/Vendor)处理结果 / Control request (Class/Vendor) handling result
bool write_zlp
发送 STATUS IN(发送 ZLP)/ Send STATUS IN (send ZLP)