1、New USB Device Class API IntroductionEOSS 2023Johann Fischerjohann.fischernordicsemi.nobPrague,Czech Republic/June 27,20231.Contents2/30Contents I1.Status of new USB device support2.API Requirements3.USBD Class Implementation4.Closing2.Status of new USB device support3/30Three UDC drivers and a driv
2、er skeletonNew class implementationsBluetooth HCI USB transport layerUSB CDC ACMUSB CDC ECMUSB Mass Storage ClassClasses that need to be portedAudio(WIP)HID(WIP)USB DFURNDIS-CDC NCMMass Storage Class3.API Requirements4/30Function Example(Device is in configured state)USB device controllerUSB device
3、supportCDC ACM implementationVirtual UART interfaceZephyr applicationUSB host controllerUSB host supportCDC ACM DriverVirtual UART interfaceRemote applicationSerial connectionUSB connectione.g./dev/ttyACM1compatible=zephyr,cdc-acm-uart;USBD Class APICDC ACM Implementationprovides serial functionalit
4、yto the hostControl PipeInterrupt INBulk IN/OUT3.API Requirements5/30Class implementation provides some functionality to the hostCommunication flow through Control,Interrupt,Bulk.pipesInterface descriptors describe implementation interface3.API Requirements6/30/*Fancyinterfacedescriptor*/staticstruc
5、tfoo_iface_desc structusb_if_descriptorif0;structusb_if_descriptorif1;structusb_ep_descriptorif1_in_ep;structusb_ep_descriptorif1_out_ep;struct usb_desc_header term_desc;_packed foo_desc=.if0=.bLength=sizeof(structusb_if_descriptor),.bDescriptorType=USB_DESC_INTERFACE,.bInterfaceNumber=0,.bAlternate
6、Setting=0,.bNumEndpoints=0,.bInterfaceClass=USB_BCC_VENDOR,.bInterfaceSubClass=0,.bInterfaceProtocol=0,.iInterface=0,.if1=.bLength=sizeof(structusb_if_descriptor),.bDescriptorType=USB_DESC_INTERFACE,.bInterfaceNumber=0,.bAlternateSetting=1,.bNumEndpoints=2,/*/.bInterfaceClass=USB_BCC_VENDOR,.bInterf