USB Gadget
+ -

USB Gadget CDC-ACM串口实例

2025-08-27 本文链接为:http://www.usbzh.com/article/detail-1568.html ,欢迎转载,转载请附上本文链接。

符合USB ACM规范的设备由Windows提供其驱动程序

usbser.sys
userser.inf

Linux Gadget对应的ACM驱动依赖为

root@ATK-IMX6U:/sys/kernel/config/usb_gadget/g1# lsmod
Module                  Size  Used by
usb_f_acm               5204  2
u_serial                9712  1 usb_f_acm
libcomposite           44470  8 usb_f_acm

使用如下的脚本创建ACM串口设备

#!/bin/bash
modprobe libcomposite
modprobe usb_f_acm
mount -t configfs none /sys/kernel/config

mkdir -p /sys/kernel/config/usb_gadget/g1
cd /sys/kernel/config/usb_gadget/g1

# Set USB vendor and product ID
echo 0x1d6b > idVendor  # Linux Foundation
echo 0x0119> idProduct # Multifunction Composite Gadget

# Set device version
echo 0x0100 > bcdDevice
echo 0x0200 > bcdUSB


mkdir -p functions/acm.usb0

mkdir -p configs/c.1
mkdir -p configs/c.1/strings/0x409
echo "USBZH Serial Config" > configs/c.1/strings/0x409/configuration
echo 250 > configs/c.1/MaxPower # 250mA

ln -s functions/acm.usb0 configs/c.1/

# Enable the gadget
udc=$(ls /sys/class/udc/)
echo "$udc" > UDC

使能后将USB OTG插入Windows系统后,在设备管理器中如下:
154612480869
154631669337
通过UsbTreeViewer查看设备信息:


    =========================== USB Port1 ===========================

Connection Status        : 0x01 (Device is connected)
Port Chain               : 2-1-1
Properties               : 0x00
 IsUserConnectable       : no
 PortIsDebugCapable      : no
 PortHasMultiCompanions  : no
 PortConnectorIsTypeC    : no
ConnectionIndex          : 0x01 (Port 1)

      ========================== Summary =========================
Vendor ID                : 0x1D6B (The Linux Foundation)
Product ID               : 0x0119
Manufacturer String      : ---
Product String           : ---
Serial                   : ---
USB Version              : 2.0
Port maximum Speed       : High-Speed
Device maximum Speed     : High-Speed
Device Connection Speed  : High-Speed
Self powered             : no
Demanded Current         : 250 mA
Used Endpoints           : 4

      ======================== USB Device ========================

        +++++++++++++++++ Device Information ++++++++++++++++++
Device Description       : USB Composite Device
Device Path              : \\?\USB#VID_1D6B&PID_0119#6&1c528954&1&1#{a5dcbf10-6530-11d2-901f-00c04fb951ed} (GUID_DEVINTERFACE_USB_DEVICE)
Kernel Name              : \Device\USBPDO-9
Device ID                : USB\VID_1D6B&PID_0119\6&1C528954&1&1
Hardware IDs             : USB\VID_1D6B&PID_0119&REV_0100 USB\VID_1D6B&PID_0119
Driver KeyName           : {36fc9e60-c465-11cf-8056-444553540000}\0014 (GUID_DEVCLASS_USB)
Driver                   : \SystemRoot\System32\drivers\usbccgp.sys (Version: 10.0.18362.1110  Date: 2020-10-17  Company: Microsoft Corporation)
Driver Inf               : C:\Windows\inf\usb.inf
Legacy BusType           : PNPBus
Class                    : USB
Class GUID               : {36fc9e60-c465-11cf-8056-444553540000} (GUID_DEVCLASS_USB)
Service                  : usbccgp
Enumerator               : USB
Location Info            : Port_#0001.Hub_#0002
Address                  : 1
Location IDs             : PCIROOT(0)#PCI(1400)#USBROOT(0)#USB(1)#USB(1), ACPI(_SB_)#ACPI(PCI0)#ACPI(XHC_)#ACPI(RHUB)#ACPI(HS01)#USB(1)
Container ID             : {11702635-82b2-11f0-9ab0-00e04b3be8a5}
Manufacturer Info        : (标准 USB 主控制器)
Capabilities             : 0x84 (Removable, SurpriseRemovalOK)
Status                   : 0x0180600A (DN_DRIVER_LOADED, DN_STARTED, DN_DISABLEABLE, DN_REMOVABLE, DN_NT_ENUMERATOR, DN_NT_DRIVER)
Problem Code             : 0
Address                  : 1
EnhancedPowerMgmtEnabled : 0
Power State              : D0 (supported: D0, D3, wake from D0)

        +++++++++++++++++ Registry USB Flags +++++++++++++++++
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\usbflags\1D6B01190100
 osvc                    : REG_BINARY 00 00

        ---------------- Connection Information ---------------
Connection Index         : 0x01 (Port 1)
Connection Status        : 0x01 (DeviceConnected)
Current Config Value     : 0x01 (Configuration 1)
Device Address           : 0x1C (28)
Is Hub                   : 0x00 (no)
Device Bus Speed         : 0x02 (High-Speed)
Number of open Pipes     : 0x03 (3 pipes to data endpoints)
Pipe[0]                  : EndpointID=2  Direction=IN   ScheduleOffset=0  Type=Interrupt  wMaxPacketSize=0xA     bInterval=9   -> 214 Bits/ms = 26750 Bytes/s
Pipe[1]                  : EndpointID=1  Direction=IN   ScheduleOffset=0  Type=Bulk       wMaxPacketSize=0x200   bInterval=0  
Pipe[2]                  : EndpointID=1  Direction=OUT  ScheduleOffset=0  Type=Bulk       wMaxPacketSize=0x200   bInterval=0  
Data (HexDump)           : 01 00 00 00 12 01 00 02 00 00 00 40 6B 1D 19 01   ...........@k...
                           00 01 00 00 00 01 01 02 00 1C 00 03 00 00 00 01   ................
                           00 00 00 07 05 82 03 0A 00 09 00 00 00 00 07 05   ................
                           81 02 00 02 00 00 00 00 00 07 05 01 02 00 02 00   ................
                           00 00 00 00                                       ....

        --------------- Connection Information V2 -------------
Connection Index         : 0x01 (1)
Length                   : 0x10 (16 bytes)
SupportedUsbProtocols    : 0x03
 Usb110                  : 1 (yes, port supports USB 1.1)
 Usb200                  : 1 (yes, port supports USB 2.0)
 Usb300                  : 0 (no, port not supports USB 3.0)
 ReservedMBZ             : 0x00
Flags                    : 0x00
 DevIsOpAtSsOrHigher     : 0 (Device is not operating at SuperSpeed or higher)
 DevIsSsCapOrHigher      : 0 (Device is not SuperSpeed capable or higher)
 DevIsOpAtSsPlusOrHigher : 0 (Device is not operating at SuperSpeedPlus or higher)
 DevIsSsPlusCapOrHigher  : 0 (Device is not SuperSpeedPlus capable or higher)
 ReservedMBZ             : 0x00
Data (HexDump)           : 01 00 00 00 10 00 00 00 03 00 00 00 00 00 00 00   ................

    ---------------------- Device Descriptor ----------------------
bLength                  : 0x12 (18 bytes)
bDescriptorType          : 0x01 (Device Descriptor)
bcdUSB                   : 0x200 (USB Version 2.0)
bDeviceClass             : 0x00 (defined by the interface descriptors)
bDeviceSubClass          : 0x00
bDeviceProtocol          : 0x00
bMaxPacketSize0          : 0x40 (64 bytes)
idVendor                 : 0x1D6B (The Linux Foundation)
idProduct                : 0x0119
bcdDevice                : 0x0100
iManufacturer            : 0x00 (No String Descriptor)
iProduct                 : 0x00 (No String Descriptor)
iSerialNumber            : 0x00 (No String Descriptor)
bNumConfigurations       : 0x01 (1 Configuration)
Data (HexDump)           : 12 01 00 02 00 00 00 40 6B 1D 19 01 00 01 00 00   .......@k.......
                           00 01                                             ..

    ------------------ Configuration Descriptor -------------------
bLength                  : 0x09 (9 bytes)
bDescriptorType          : 0x02 (Configuration Descriptor)
wTotalLength             : 0x004B (75 bytes)
bNumInterfaces           : 0x02 (2 Interfaces)
bConfigurationValue      : 0x01 (Configuration 1)
iConfiguration           : 0x01 (String Descriptor 1)
 Language 0x0409         : "Serial Config"
bmAttributes             : 0x80
 D7: Reserved, set 1     : 0x01
 D6: Self Powered        : 0x00 (no)
 D5: Remote Wakeup       : 0x00 (no)
 D4..0: Reserved, set 0  : 0x00
MaxPower                 : 0x7D (250 mA)
Data (HexDump)           : 09 02 4B 00 02 01 01 80 7D 08 0B 00 02 02 02 01   ..K.....}.......
                           04 09 04 00 00 01 02 02 01 02 05 24 00 10 01 05   ...........$....
                           24 01 00 01 04 24 02 02 05 24 06 00 01 07 05 82   $....$...$......
                           03 0A 00 09 09 04 01 00 02 0A 00 00 03 07 05 81   ................
                           02 00 02 00 07 05 01 02 00 02 00                  ...........

        ------------------- IAD Descriptor --------------------
bLength                  : 0x08 (8 bytes)
bDescriptorType          : 0x0B (Interface Association Descriptor)
bFirstInterface          : 0x00 (Interface 0)
bInterfaceCount          : 0x02 (2 Interfaces)
bFunctionClass           : 0x02 (Communications and CDC Control)
bFunctionSubClass        : 0x02
bFunctionProtocol        : 0x01
iFunction                : 0x04 (String Descriptor 4)
 Language 0x0409         : "CDC Serial"
Data (HexDump)           : 08 0B 00 02 02 02 01 04                           ........

        ---------------- Interface Descriptor -----------------
bLength                  : 0x09 (9 bytes)
bDescriptorType          : 0x04 (Interface Descriptor)
bInterfaceNumber         : 0x00 (Interface 0)
bAlternateSetting        : 0x00
bNumEndpoints            : 0x01 (1 Endpoint)
bInterfaceClass          : 0x02 (Communications and CDC Control)
bInterfaceSubClass       : 0x02 (Abstract Control Model)
bInterfaceProtocol       : 0x01 (AT Commands defined by ITU-T V.250 etc)
iInterface               : 0x02 (String Descriptor 2)
 Language 0x0409         : "CDC Abstract Control Model (ACM)"
Data (HexDump)           : 09 04 00 00 01 02 02 01 02                        .........

        -------------- CDC Interface Descriptor ---------------
bFunctionLength          : 0x05 (5 bytes)
bDescriptorType          : 0x24 (Interface)
bDescriptorSubType       : 0x00 (Header Functional Descriptor)
bcdCDC                   : 0x110 (CDC Version 1.10)
Data (HexDump)           : 05 24 00 10 01                                    .$...

        -------------- CDC Interface Descriptor ---------------
bFunctionLength          : 0x05 (5 bytes)
bDescriptorType          : 0x24 (Interface)
bDescriptorSubType       : 0x01 (Call Management Functional Descriptor)
bmCapabilities           : 0x00
 D7..2                   : 0x00 (Reserved)
 D1                      : 0x00 (sends/receives call management information only over the Communication Class interface)
 D0                      : 0x00 (does not handle call management itself)
bDataInterface           : 0x01
Data (HexDump)           : 05 24 01 00 01                                    .$...

        -------------- CDC Interface Descriptor ---------------
bFunctionLength          : 0x04 (4 bytes)
bDescriptorType          : 0x24 (Interface)
bDescriptorSubType       : 0x02 (Abstract Control Management Functional Descriptor)
bmCapabilities           : 0x02
 D7..4                   : 0x00 (Reserved)
 D3                      : 0x00 (not supports the notification Network_Connection)
 D2                      : 0x00 (not supports the request Send_Break)
 D1                      : 0x01 (supports the request combination of Set_Line_Coding, Set_Control_Line_State, Get_Line_Coding, and the notification Serial_State)
 D0                      : 0x00 (not supports the request combination of Set_Comm_Feature, Clear_Comm_Feature, and Get_Comm_Feature)
Data (HexDump)           : 04 24 02 02                                       .$..

        -------------- CDC Interface Descriptor ---------------
bFunctionLength          : 0x05 (5 bytes)
bDescriptorType          : 0x24 (Interface)
bDescriptorSubType       : 0x06 (Union Functional Descriptor)
bControlInterface        : 0x00
bSubordinateInterface[0] : 0x01
Data (HexDump)           : 05 24 06 00 01                                    .$...

        ----------------- Endpoint Descriptor -----------------
bLength                  : 0x07 (7 bytes)
bDescriptorType          : 0x05 (Endpoint Descriptor)
bEndpointAddress         : 0x82 (Direction=IN EndpointID=2)
bmAttributes             : 0x03 (TransferType=Interrupt)
wMaxPacketSize           : 0x000A
 Bits 15..13             : 0x00 (reserved, must be zero)
 Bits 12..11             : 0x00 (0 additional transactions per microframe -> allows 1..1024 bytes per packet)
 Bits 10..0              : 0x0A (10 bytes per packet)
bInterval                : 0x09 (256 microframes -> 32 ms)
Data (HexDump)           : 07 05 82 03 0A 00 09                              .......

        ---------------- Interface Descriptor -----------------
bLength                  : 0x09 (9 bytes)
bDescriptorType          : 0x04 (Interface Descriptor)
bInterfaceNumber         : 0x01 (Interface 1)
bAlternateSetting        : 0x00
bNumEndpoints            : 0x02 (2 Endpoints)
bInterfaceClass          : 0x0A (CDC-Data)
bInterfaceSubClass       : 0x00
bInterfaceProtocol       : 0x00
iInterface               : 0x03 (String Descriptor 3)
 Language 0x0409         : "CDC ACM Data"
Data (HexDump)           : 09 04 01 00 02 0A 00 00 03                        .........

        ----------------- Endpoint Descriptor -----------------
bLength                  : 0x07 (7 bytes)
bDescriptorType          : 0x05 (Endpoint Descriptor)
bEndpointAddress         : 0x81 (Direction=IN EndpointID=1)
bmAttributes             : 0x02 (TransferType=Bulk)
wMaxPacketSize           : 0x0200 (max 512 bytes)
bInterval                : 0x00 (never NAKs)
Data (HexDump)           : 07 05 81 02 00 02 00                              .......

        ----------------- Endpoint Descriptor -----------------
bLength                  : 0x07 (7 bytes)
bDescriptorType          : 0x05 (Endpoint Descriptor)
bEndpointAddress         : 0x01 (Direction=OUT EndpointID=1)
bmAttributes             : 0x02 (TransferType=Bulk)
wMaxPacketSize           : 0x0200 (max 512 bytes)
bInterval                : 0x00 (never NAKs)
Data (HexDump)           : 07 05 01 02 00 02 00                              .......

    --------- Device Qualifier Descriptor (for Full-Speed) --------
bLength                  : 0x0A (10 bytes)
bDescriptorType          : 0x06 (Device_qualifier Descriptor)
bcdUSB                   : 0x200 (USB Version 2.0)bDeviceClass             : 0x00 (defined by the interface descriptors)
bDeviceSubClass          : 0x00
bDeviceProtocol          : 0x00
bMaxPacketSize0          : 0x40 (64 Bytes)
bNumConfigurations       : 0x01 (1 other-speed configuration)
bReserved                : 0x00
Data (HexDump)           : 0A 06 00 02 00 00 00 40 01 00                     .......@..

    ------------ Other Speed Configuration Descriptor -------------
bLength                  : 0x09 (9 bytes)
bDescriptorType          : 0x07 (Other_speed_configuration Descriptor)
wTotalLength             : 0x004B (75 bytes)
bNumInterfaces           : 0x02 (2 Interfaces)
bConfigurationValue      : 0x01 (Configuration 1)
iConfiguration           : 0x01 (String Descriptor 1)
 Language 0x0409         : "Serial Config"
bmAttributes             : 0x80
 D7: Reserved, set 1     : 0x01
 D6: Self Powered        : 0x00 (no)
 D5: Remote Wakeup       : 0x00 (no)
 D4..0: Reserved, set 0  : 0x00
MaxPower                 : 0x7D (250 mA)
Data (HexDump)           : 09 07 4B 00 02 01 01 80 7D 08 0B 00 02 02 02 01   ..K.....}.......
                           04 09 04 00 00 01 02 02 01 02 05 24 00 10 01 05   ...........$....
                           24 01 00 01 04 24 02 02 05 24 06 00 01 07 05 82   $....$...$......
                           03 0A 00 20 09 04 01 00 02 0A 00 00 03 07 05 81   ... ............
                           02 40 00 00 07 05 01 02 40 00 00                  .@......@..

        ------------------- IAD Descriptor --------------------
bLength                  : 0x08 (8 bytes)
bDescriptorType          : 0x0B (Interface Association Descriptor)
bFirstInterface          : 0x00 (Interface 0)
bInterfaceCount          : 0x02 (2 Interfaces)
bFunctionClass           : 0x02 (Communications and CDC Control)
bFunctionSubClass        : 0x02
bFunctionProtocol        : 0x01
iFunction                : 0x04 (String Descriptor 4)
 Language 0x0409         : "CDC Serial"
Data (HexDump)           : 08 0B 00 02 02 02 01 04                           ........

        ---------------- Interface Descriptor -----------------
bLength                  : 0x09 (9 bytes)
bDescriptorType          : 0x04 (Interface Descriptor)
bInterfaceNumber         : 0x00 (Interface 0)
bAlternateSetting        : 0x00
bNumEndpoints            : 0x01 (1 Endpoint)
bInterfaceClass          : 0x02 (Communications and CDC Control)
bInterfaceSubClass       : 0x02 (Abstract Control Model)
bInterfaceProtocol       : 0x01 (AT Commands defined by ITU-T V.250 etc)
iInterface               : 0x02 (String Descriptor 2)
 Language 0x0409         : "CDC Abstract Control Model (ACM)"
Data (HexDump)           : 09 04 00 00 01 02 02 01 02                        .........

        -------------- CDC Interface Descriptor ---------------
bFunctionLength          : 0x05 (5 bytes)
bDescriptorType          : 0x24 (Interface)
bDescriptorSubType       : 0x00 (Header Functional Descriptor)
bcdCDC                   : 0x110 (CDC Version 1.10)
Data (HexDump)           : 05 24 00 10 01                                    .$...

        -------------- CDC Interface Descriptor ---------------
bFunctionLength          : 0x05 (5 bytes)
bDescriptorType          : 0x24 (Interface)
bDescriptorSubType       : 0x01 (Call Management Functional Descriptor)
bmCapabilities           : 0x00
 D7..2                   : 0x00 (Reserved)
 D1                      : 0x00 (sends/receives call management information only over the Communication Class interface)
 D0                      : 0x00 (does not handle call management itself)
bDataInterface           : 0x01
Data (HexDump)           : 05 24 01 00 01                                    .$...

        -------------- CDC Interface Descriptor ---------------
bFunctionLength          : 0x04 (4 bytes)
bDescriptorType          : 0x24 (Interface)
bDescriptorSubType       : 0x02 (Abstract Control Management Functional Descriptor)
bmCapabilities           : 0x02
 D7..4                   : 0x00 (Reserved)
 D3                      : 0x00 (not supports the notification Network_Connection)
 D2                      : 0x00 (not supports the request Send_Break)
 D1                      : 0x01 (supports the request combination of Set_Line_Coding, Set_Control_Line_State, Get_Line_Coding, and the notification Serial_State)
 D0                      : 0x00 (not supports the request combination of Set_Comm_Feature, Clear_Comm_Feature, and Get_Comm_Feature)
Data (HexDump)           : 04 24 02 02                                       .$..

        -------------- CDC Interface Descriptor ---------------
bFunctionLength          : 0x05 (5 bytes)
bDescriptorType          : 0x24 (Interface)
bDescriptorSubType       : 0x06 (Union Functional Descriptor)
bControlInterface        : 0x00
bSubordinateInterface[0] : 0x01
Data (HexDump)           : 05 24 06 00 01                                    .$...

        ----------------- Endpoint Descriptor -----------------
bLength                  : 0x07 (7 bytes)
bDescriptorType          : 0x05 (Endpoint Descriptor)
bEndpointAddress         : 0x82 (Direction=IN EndpointID=2)
bmAttributes             : 0x03 (TransferType=Interrupt)
wMaxPacketSize           : 0x000A (10 bytes)
bInterval                : 0x20 (32 ms)
Data (HexDump)           : 07 05 82 03 0A 00 20                              ...... 

        ---------------- Interface Descriptor -----------------
bLength                  : 0x09 (9 bytes)
bDescriptorType          : 0x04 (Interface Descriptor)
bInterfaceNumber         : 0x01 (Interface 1)
bAlternateSetting        : 0x00
bNumEndpoints            : 0x02 (2 Endpoints)
bInterfaceClass          : 0x0A (CDC-Data)
bInterfaceSubClass       : 0x00
bInterfaceProtocol       : 0x00
iInterface               : 0x03 (String Descriptor 3)
 Language 0x0409         : "CDC ACM Data"
Data (HexDump)           : 09 04 01 00 02 0A 00 00 03                        .........

        ----------------- Endpoint Descriptor -----------------
bLength                  : 0x07 (7 bytes)
bDescriptorType          : 0x05 (Endpoint Descriptor)
bEndpointAddress         : 0x81 (Direction=IN EndpointID=1)
bmAttributes             : 0x02 (TransferType=Bulk)
wMaxPacketSize           : 0x0040 (64 bytes)
bInterval                : 0x00 (ignored)
Data (HexDump)           : 07 05 81 02 40 00 00                              ....@..

        ----------------- Endpoint Descriptor -----------------
bLength                  : 0x07 (7 bytes)
bDescriptorType          : 0x05 (Endpoint Descriptor)
bEndpointAddress         : 0x01 (Direction=OUT EndpointID=1)
bmAttributes             : 0x02 (TransferType=Bulk)
wMaxPacketSize           : 0x0040 (64 bytes)
bInterval                : 0x00 (ignored)
Data (HexDump)           : 07 05 01 02 40 00 00                              ....@..

      -------------------- String Descriptors -------------------
             ------ String Descriptor 0 ------
bLength                  : 0x04 (4 bytes)
bDescriptorType          : 0x03 (String Descriptor)
Language ID[0]           : 0x0409 (English - United States)
Data (HexDump)           : 04 03 09 04                                       ....
             ------ String Descriptor 1 ------
bLength                  : 0x1C (28 bytes)
bDescriptorType          : 0x03 (String Descriptor)
Language 0x0409          : "Serial Config"
Data (HexDump)           : 1C 03 53 00 65 00 72 00 69 00 61 00 6C 00 20 00   ..S.e.r.i.a.l. .
                           43 00 6F 00 6E 00 66 00 69 00 67 00               C.o.n.f.i.g.
             ------ String Descriptor 2 ------
bLength                  : 0x42 (66 bytes)
bDescriptorType          : 0x03 (String Descriptor)
Language 0x0409          : "CDC Abstract Control Model (ACM)"
Data (HexDump)           : 42 03 43 00 44 00 43 00 20 00 41 00 62 00 73 00   B.C.D.C. .A.b.s.
                           74 00 72 00 61 00 63 00 74 00 20 00 43 00 6F 00   t.r.a.c.t. .C.o.
                           6E 00 74 00 72 00 6F 00 6C 00 20 00 4D 00 6F 00   n.t.r.o.l. .M.o.
                           64 00 65 00 6C 00 20 00 28 00 41 00 43 00 4D 00   d.e.l. .(.A.C.M.
                           29 00                                             ).
             ------ String Descriptor 3 ------
bLength                  : 0x1A (26 bytes)
bDescriptorType          : 0x03 (String Descriptor)
Language 0x0409          : "CDC ACM Data"
Data (HexDump)           : 1A 03 43 00 44 00 43 00 20 00 41 00 43 00 4D 00   ..C.D.C. .A.C.M.
                           20 00 44 00 61 00 74 00 61 00                      .D.a.t.a.
             ------ String Descriptor 4 ------
bLength                  : 0x16 (22 bytes)
bDescriptorType          : 0x03 (String Descriptor)
Language 0x0409          : "CDC Serial"
Data (HexDump)           : 16 03 43 00 44 00 43 00 20 00 53 00 65 00 72 00   ..C.D.C. .S.e.r.
                           69 00 61 00 6C 00                                 i.a.l.

测试:
在Linux端可以看到如下设备

root@ATK-IMX6U:/dev# ls /dev/ttyGS*
/dev/ttyGS0

发送数据到Windows端:

root@ATK-IMX6U:/dev# echo "hello www.usbzh.com" > ttyGS0

在Windows端打开串口5,可以收到数据

Connecting to COM5...
Connected.

hello www.usbzh.com
本文链接为:http://www.usbzh.com/article/detail-1568.html ,欢迎转载,转载请附上本文链接。

0 篇笔记 写笔记

USB转串口芯片选型
型号协议串口数量最大波特率IO电压工作温度封装CH3432.0 全速 Device16Mbps5V/3.3V/2.5V/1.8V-40~+85℃QFN16/ESSOP10/SOP16 CH91022.0 全速 Device14MbpsCH910......
USB控制类芯片选型
型号接口USBHostDeviceSD卡功能工作电压 CH378并口/SPI/串口2.0高速支持支持支持1.8V/3.3VLQFP128/LQFP64M硬件集成文件系统库,高速读写U盘/SD卡。占用外部RAM、FLASH资源很少。支持USB2.0读卡器方式......
USB通信设备类CDC简介
什么是USB CDC?USB CDC(Communications Device Class,通信设备类)是USB标准中的一类,专门用于支持各种通信设备(如调制解调器、网络适配器、串口设备等)在USB总线上与主机进行数据和控制信息的交换。CDC规范为这些设备在USB上的识别、配置、管理和数据传输提供......
CDC-NCM 简介
USB CDC-NCM(Network Control Model)是 USB CDC(Communication Device Class) 的一个子类协议,专为高效网络数据传输设计,主要用于移动宽带设备(如4G/5G调制解调器、USB网卡等),以提升 USB 总线上的网络吞吐量。1. 核心特......
USB CDC-NCM和USB CDC-ECM的区别与关系
USB CDC-NCM(Network Control Model)和USB CDC-ECM(Ethernet Control Model)是USB规范中定义的两种网络通信协议,均属于USB CDC(Communication Device Class)的子类。它们的主要区别和关系如下:1. 设......
USB-CDC-ECM 简介
CDC-ECM全称:Universal Serial Bus Communications Class Subclass Specification for Ethernet Control Model Devices。1. 概述USB CDC ECM(Ethernet Networking Co......
CDC 通信设备类协议代码表
USB通信设备的描述符(如bDeviceClass、bInterfaceClass、bInterfaceSubClass、bInterfaceProtocol)需要填写特定的类、子类和协议代码。下面分别梳理各类代码的含义和用途。1. 通信设备类代码(Communication Device Cl......
CDC 标准USB描述符
5.1 标准USB描述符定义本节规定了通信设备类(CDC)、通信接口类和数据接口类的标准USB描述符要求。5.1.1 设备描述符(Device Descriptor)通信设备功能主要体现在接口级别,但设备描述符中的bDeviceClass字段用于标识该设备为通信设备。设备级别的类代码(bDev......
CDC 头部功能描述符
头部功能描述符(Header Functional Descriptor)用于标识该接口及其相关描述符所遵循的CDC规范版本,是所有CDC类特定描述符的起始部分。类特定描述符必须以一个头部开始,其格式如下表所示。bcdCDC 字段用于标识该接口及其描述符所遵循的《USB通信设备类规范》的版本号。......
CDC 呼叫管理功能描述符
呼叫管理功能描述符(Call Management Functional Descriptor)用于描述设备是否支持自身呼叫管理、是否可通过数据类接口收发呼叫管理信息,以及相关数据接口号。呼叫管理功能描述符用于描述通信类接口的呼叫处理能力。它只能出现在接口描述符的类特定部分。偏移字段名......
CDC 功能描述符
功能描述符功能描述符Functional Descriptors用于描述接口描述符中类特定信息的内容。所有功能描述符都以一个通用的头部描述符开始,这样主机软件可以方便地解析类特定描述符的内容。每个类特定描述符由一个或多个功能描述符组成。目前,通信类定义了类特定描述符信息,而数据类没有定义。功能描......
CDC 抽象控制管理功能描述符
抽象控制管理功能描述符(Abstract Control Management Functional Descriptor)用于标识设备支持哪些CDC ACM(如虚拟串口)相关的标准请求和通知,主机据此决定可用的控制命令。用于描述通信类接口(SubClass为抽象控制模型,Abstract Cont......
CDC 直连线路管理功能描述符
直连线路管理功能描述符 (Direct Line Management Functional Descriptor)用于描述通信类接口(SubClass为直连线路控制模型,Direct Line Control Model)所支持的命令。它只能出现在接口描述符的类特定部分。直连线路管理功能描述符用......
CDC 电话铃声功能描述符
电话铃声功能描述符(Telephone Ringer Functional Descriptor)用于描述设备支持的铃声音量调节级数和铃声模式数量,主机可据此实现对电话设备铃声的控制和管理。该描述符用于描述通信类接口(SubClass为电话控制,Telephone Control)所支持的铃声能力......
CDC 电话操作模式功能描述符
电话操作模式功能描述符(Telephone Operational Modes Functional Descriptor)用于描述设备支持的电话操作模式,主机可据此实现对电话设备不同工作模式的管理和切换。该描述符用于描述通信类接口(SubClass为电话控制,Telephone Control)......
关注公众号
  • HID人机交互
  • Linux&USB
  • UAC音频
  • CDC
  • TYPE-C
  • USB规范
  • USB大容量存储
  • USB百科
  • USB周边
  • UVC摄像头
  • Windows系统USB
  • 音视频博客
  • 取消
    感谢您的支持,我会继续努力的!
    扫码支持
    扫码打赏,你说多少就多少

    打开支付宝扫一扫,即可进行扫码打赏哦

    您的支持,是我们前进的动力!