SILICON LABS Usb Device Cdc Acm Class
Litlhaloso
- Sesebediswa sa USB CDC ACM Sehlopha
- Sesebelisoa sa USB CDC Base Class Overview
Tlhahisoleseding ya Sehlahiswa
This product is a USB device that supports the Communications Device Class (CDC) class and the associated CDC subclass, specifically the Abstract Control Model (ACM) subclass for serial emulation.
CDC Device Composition
A CDC device consists of at least one Communication Class Interface (CCI) and zero or more Data Class Interfaces (DCIs) to provide communication capabilities. In a CDC composite device,multiple functions can be implemented with different sets of CCI and DCI(s).
Endpoints Usage
The CDC device typically uses the following combination ofendpoints:
- A pair of control IN and OUT endpoints for default communication.
- An optional bulk or interrupt IN endpoint.
- A pair of bulk or isochronous IN and OUT endpoints (isochronous endpoints are not currently supported by Silicon Labs USB device
stack).
CDC Endpoint Usage Table
| Qetello | Tataiso | Tšebeliso ea Interface |
|---|---|---|
| Laola IN | Device-to-CCI | Standard requests for enumeration, class-specific requests, device management, and optionally call management. |
| Laola TSOA | Host-to-CCI | Standard requests for enumeration, class-specific requests, device management, and optionally call management. |
| Interrupt or bulk IN | Device-to-CCI | Events notification, such as ring detect, serial line status, boemo ba marang-rang. |
| Bulk or isochronous IN | Device-to-DCI | Khokahano ea data e tala kapa e hlophisitsoeng. |
| Bulk or isochronous OUT | Host-to-DCI | Khokahano ea data e tala kapa e hlophisitsoeng. |
Litaelo tsa Tšebeliso ea Sehlahisoa
Seta le Khokahano
- Connect the USB device to your computer using an appropriate USB cable.
Puisano ea Boitsebiso
- Use the provided software to establish communication with the USB device.
Teko ea Ts'ebetso
Send/receive data through the designated endpoints to test the functionality of the CDC device.
Sesebediswa sa USB CDC ACM Sehlopha
This section describes the Communications Device Class (CDC) class and the associated CDC subclass supported by Silicon Labs’ USB Device stack. Silicon Labs USB-Device currently supports the Abstract Control Model (ACM) subclass, which is commonly used for serial emulation. CDC includes various telecommunication and networking devices. Telecommunication devices encompass analog modems, analog and digital telephones, ISDN terminal adapters, etc. For example, networking devices contain ADSL and cable modems, Ethernet adapters, and hubs. CDC defines a framework to encapsulate existing communication services standards, such as V.250 (for modems over telephone network) and Ethernet (for local area network devices), using a USB link. A communication device is in charge of device management, call management when needed, and data transmission. CDC defines seven major groups of devices. Each group belongs to a model of communication, which may include several subclasses. Each group of devices has its own specification document besides the CDC base class. The seven groups are:
- Public Switched Telephone Network (PSTN), devices including voiceband modems, telephones, and serial emulation devices. Integrated Services Digital Network (ISDN) devices, including terminal adaptors and telephones.
- Ethernet Control Model (ECM) devices, including devices supporting the IEEE 802 family (ex.: cable and ADSL modems, WiFi adapters).
- Asynchronous Transfer Mode (ATM) devices, including ADSL modems and other devices connected to ATM networks (workstations, routers, LAN switches).
- Wireless Mobile Communications (WMC) devices, including multi-function communications handset devices used to manage voice and data communications.
- Ethernet Emulation Model (EEM) devices which exchange Ethernet-framed data.
- Network Control Model (NCM) devices, including high-speed network devices (High Speed Packet Access modems, Line Terminal Equipment)
- CDC le ts'ebetsong e amanang le eona e tsamaisana le lintlha tse latelang:
- Universal Serial Bus, Class Definitions for Communications Devices, Revision 1.2, November 3 2010. Universal Serial Bus, Communications, Subclass for PSTN Devices, Revision 1.2, February 9 2007.
Sesebelisoa sa USB CDC Base Class Overview
Sesebelisoa sa CDC se entsoe ka likhokahano tse latelang ho kenya tšebetsong bokhoni ba puisano:
- Communications Class Interface (CCI) is responsible for the device management and optionally the call management. The device management enables the general configuration and control of the device and the notification of events to the host. The call management enables calls establishment and termination. Call management might be multiplexed through a DCI. A CCI is mandatory for all CDC devices. It identifies the CDC function by specifying the communication model supported by the CDC device. The interface(s) following the CCI can be any defined USB class interface, such as Audio or a vendor-specific interface. The vendor-specific interface is represented specifically by a DCI. Data Class Interface (DCI) is responsible for data transmission. Data transmitted and/or received do not follow a specific format. Data could be raw data from a communication line, data following a proprietary format, etc. All the DCIs following the CCI can be seen as subordinate interfaces.
- A CDC device must have at least one CCI and zero or more DCIs. One CCI and any subordinate DCI together provide a feature to the host. This capability is also referred to as a function. In a CDC composite device, you could have several functions. Therefore, the device would be composed of several sets of CCI and DCI(s) as shown in Figure – CDC Composite Device.

Sesebelisoa sa CDC se kanna sa sebelisa motsoako o latelang oa li-endpoints:
- A pair of control IN and OUT endpoints called the default endpoint.
- An optional bulk or interrupt IN endpoint.
- A pair of bulk or isochronous IN and OUT endpoints. Note that Silicon Labs USB device stack does not currently support isochronous endpoints.
Tafole e ka tlase e bonts'a ts'ebeliso ea li-endpoints tse fapaneng le hore na li sebelisoa ka sebopeho sefe sa CDC.
Tafole - CDC Endpoint Tšebeliso
| Qetello | Tataiso | Sehokedi | Tšebeliso |
| Laola IN | Device-to- host | CCI | Standard requests for enumeration, class-specific requests, device management, and optionally call management. |
| Laola TSOA | Host-to- device | CCI | Standard requests for enumeration, class-specific requests, device management, and optionally call management. |
| Interrupt or bulk IN | Device-to- host | CCI | Tsebiso ea diketsahalo, joalo ka ring detect, serial line status, network status. |
| Bulk or isochronous IN | Device-to- host | DCI | Khokahano ea data e tala kapa e hlophisitsoeng. |
| Bulk or isochronous OUT | Host-to- device | DCI | Khokahano ea data e tala kapa e hlophisitsoeng. |
- Lisebelisuoa tse ngata tsa puisano li sebelisa sebaka sa ho qetela ho tsebisa bongata ba liketsahalo. Li-endpoints tsa Isochronous ha lia lokela ho sebelisoa bakeng sa phetisetso ea data ha protocol ea mong'a ntlo e itšetleha ka phetiso ea data ha ho ka ba le liphoso tsa protocol ea USB. Puisano ea Isochronous e ka lahleheloa ke data ka tlhaho kaha ha e na mekhoa ea ho leka hape.
- Mefuta e supileng e meholo ea puisano e akaretsa likaroloana tse 'maloa. Sehlopha se senyenyane se hlalosa tsela eo sesebelisoa se lokelang ho sebelisa CCI ho sebetsana le tsamaiso ea lisebelisoa le tsamaiso ea mohala. Tafole e ka tlase e bonts'a lihlotšoana tsohle tse ka khonehang le mokhoa oa puisano oo ba leng ho oona.
Tafole - CDC Subclasses
|
Sehlopha se tlase |
Mohlala oa puisano |
Example ea Lisebelisoa tse Sebelisang Sehlopheng sena |
| Direct Line Control Model | PSTN | Lisebelisoa tsa modem tse laoloang ka kotloloho ke moamoheli oa USB |
| Abstract Control Model | PSTN | Lisebelisoa tsa serial emulation, lisebelisoa tsa modem tse laoloang ka sete ea taelo ea serial |
Fetileview
|
Sehlopha se tlase |
Mohlala oa puisano |
Example ea Lisebelisoa tse Sebelisang Sehlopheng sena |
| Mohlala oa Taolo ea Mohala | PSTN | Lisebelisoa tsa mohala oa lentsoe |
| Multi-Channel Control Model | ISDN | Li-adapter tsa li-terminal tsa litekanyetso tsa mantlha, li-adapter tsa litekanyetso tsa mantlha, mehala |
| CAPI Control Model | ISDN | Li-adapter tsa li-terminal tsa litekanyetso tsa mantlha, li-adapter tsa litekanyetso tsa mantlha, mehala |
| Ethernet Networking Control Model | ECM | DOC-SIS cable modems, ADSL modems that support PPPoE emulation, Wi-Fi adaptors (IEEE 802.11-family), IEEE 802.3 adaptors |
| ATM Networking Control Model | ATM | ADSL modems |
| Wireless Handset Control Model | WMC | Thepa ea mohala e hokelang lisebelisoa tse se nang mohala |
| Tsamaiso ea Sesebelisoa | WMC | Thepa ea mohala e hokelang lisebelisoa tse se nang mohala |
| Mobile Direct Line Model | WMC | Thepa ea mohala e hokelang lisebelisoa tse se nang mohala |
| OBEX | WMC | Thepa ea mohala e hokelang lisebelisoa tse se nang mohala |
| Ethernet Emulation Model | EEM | Devices using Ethernet frames as the next layer of transport. Not intended for routing and Internet connectivity devices |
| Mohlala oa Taolo ea Marang-rang | NCM | IEEE 802.3 adaptors carrying high-speed data bandwidth on network |
Sesebediswa sa USB CDC ACM Class Resource Litlhoko ho tloha Core
Nako le nako ha u eketsa mohlala oa sehlopha sa CDC ACM ho tlhophiso ea USB ka mohala ho ts'ebetso sl_usbd_cdc_acm_add_to_configuration() , lisebelisoa tse latelang li tla abeloa ho tloha mantlha.
| Mohlodi | Bongata |
| Li-interface | 2 |
| Alternate interfaces | 2 |
| Lintlha tsa ho qetela | 3 |
| Interface groups | 1 |
Hlokomela
that those numbers are per configuration. When setting up your SL_USBD_INTERFACE_QUANTITY, SL_USBD_ALT_INTERFACE_QUANTITY, SL_USBD_INTERFACE_GROUP_QUANTITY and SL_USBD_DESCRIPTOR_QUANTITY configuration values, don’t forget to take into account on how many configurations the class will be added. For the SL_USBD_OPEN_ENDPOINTS_QUANTITY configuration value, since endpoints are opened only when a configuration is set by the host, you just need to take into account the number of needed endpoints for a class instance.
Sesebelisoa sa USB CDC ACM Subclass Overview
Sehlopha sa motheo sa CDC se entsoe ka Interface Class Class (CCI) le Data Class Interface (DCI), tse tšohloang ka botlalo ho USB Device CDC Base Class Over.view . Karolo ena e bua ka CCI ea mofuta oa ACM. E na le ntlha ea kamehla ea ho qetela bakeng sa karolo ea tsamaiso le ntlha e sitisang ea karolo ea tsebiso. Li-endpoints tse ngata li sebelisoa ho tsamaisa data e sa hlalosoang holim'a DCI.
ACM subclass e sebelisoa ke mefuta e 'meli ea lisebelisoa tsa puisano:
- Lisebelisoa tse tšehetsang litaelo tsa AT (mohlala, li-modem tsa voiceband). Lisebelisoa tsa serial emulation tseo hape li bitsoang lisebelisoa tsa boema-kepe tsa Virtual COM.
Ho na le likopo tse 'maloa tse ikhethileng tsa sehlopha sa ACM. Li u lumella ho laola le ho lokisa sesebelisoa. Lethathamo le felletseng le tlhaloso ea likopo tsohle tsa ACM li ka fumanoa ho tse boletsoeng
Fetileview
Subclass for PSTN Devices, revision 1.2, February 9, 2007=, section 6.2.2. From this list, Silicon Labs9 ACM subclass supports the following:
Tafole - Likopo tsa ACM tse Tšehetsoeng ke Silicon Labs
Sehlopha sa ACM
ACM subclass e na le tlhophiso e le 'ngoe ea nako ea pokello e bontšitsoeng tafoleng e ka tlase.
Tafole - Sesebediswa sa USB CDC ACM Configuration Define
Lebitso la Tlhophiso
- SL_USBD_CDC_ACM_SUBCLASS_I NSTANCE_QUANTITY
Tlhaloso
- Configures the number of subclass instances you will allocate via a call to the function sl_usbd_cdc_acm_create_instance() .
Default Value
- 2
Sesebelisoa sa USB CDC ACM Class Instance Configurations
This section defines the configurations related to the CDC ACM serial class instances.
- Pōpo ea Boemo ba Sehlopha
- line state interval
- call mgmt capabilities
- p_acm_callbacks
Pōpo ea Boemo ba Sehlopha
To create a CDC ACM serial class instance, call the function configuration arguments, as described here.
line_state_interval
This is the interval (in milliseconds) that your CDC ACM serial class instance will report the line state notifications to the host. This value must be a power of two (1, 2, 4, 8, 16, etc).
call_mgmt_capabilities
Bitmap ea Bokhoni ba Tsamaiso ea Call. Lintlha tse ka bang teng tsa bitmap ke tse latelang:
| Boleng (bit) | Tlhaloso |
| SL_USBD_ACM_SERIAL_CALL_MGMT_DEV | Device handles call management itself. |
| SL_USBD_ACM_SERIAL_CALL_MGMT_DATA_CCI_DCI | Device can send/receive call management information over a Data Class interface. |
p_acm_callbacks
Fetileview
p_acm_callbacks is a pointer to a structure of type sl_usbd_cdc_acm_callbacks_t . Its purpose is to give the CDC ACM Class a set of callback functions to be called when a CDC ACM event occurs. Not all callbacks are mandatory and a null pointer ( NULL ) can be passed in the callbacks structure variable when the callback is not needed. The table below describes each configuration field available in this configuration structure.
Table – sl_usbd_cdc_acm_callbacks_t Configuration Structure
See section Registering Event Notification Callbacks for the callback functions example.
Sesebelisoa sa USB CDC ACM Class Programming Guide
- This section explains how to use the CDC Abstract Control Model class.
- Ho qala Sesebediswa sa USB CDC ACM Sehlopha
- Ho eketsa Sesebediswa sa USB CDC ACM Class Instance ho sesebelisoa sa hau
- Ho Buisana ka ho Sebelisa Sehlopha sa CDC ACM
Ho qala Sesebediswa sa USB CDC ACM Sehlopha
To add CDC ACM class functionality to your device, you must first initialize the CDC base class and the ACM subclass by calling the functions sl_usbd_cdc_init() and sl_usbd_cdc_acm_init() . The example below shows how to call sl_usbd_cdc_init() and sl_usbd_cdc_acm_init() using default arguments. Example - Ho qalisoa ha Sehlopha sa CDC ACM![]()
Ho eketsa Sesebediswa sa USB CDC ACM Class Instance ho sesebelisoa sa hau
Ho kenya ts'ebetso ea sehlopha sa CDC ACM sesebelisoa sa hau, o tlameha ho theha mohlala, ebe o o kenya ho litlhophiso tsa sesebelisoa sa hau.
- Ho theha Boemo ba Sehlopha sa CDC ACM
- E kenyelletsa Boemo ba Sehlopha sa CDC ACM ho Litlhophiso tsa Sesebediswa sa Hao
- Ho Ngolisa Mehala ea Tsebiso ea Ketsahalo
Fetileview
Ho theha Boemo ba Sehlopha sa CDC ACM
Create a CDC ACM class instance by calling the function sl_usbd_cdc_acm_create_instance() . The example below shows how to create a CDC ACM class instance via sl_usbd_cdc_acm_create_instance() .
Example
Creating a CDC ACM Function via sl_usbd_cdc_acm_create_instance()![]()
E kenyelletsa Boemo ba Sehlopha sa CDC ACM ho Litlhophiso tsa Sesebediswa sa Hao
After you have created a CDC ACM class instance, you can add it to a configuration by calling the function sl_usbd_cdc_acm_add_to_configuration() . The example below shows how to call sl_usbd_cdc_acm_add_to_configuration() .
Example
Call to USBD ACM sl_usbd_cdc_acm_add_to_configuration()![]()
- Class number to add to the configuration returned by sl_usbd_cdc_acm_create_instance() .
- Configuration number (here adding it to a Full-Speed configuration).
Ho Ngolisa Mehala ea Tsebiso ea Ketsahalo
The CDC ACM Serial class can notify your application of any changes in line control or coding via notification callback functions. A callback functions structure can be passed as argument during the ACM instance creation. Note that those callbacks are optional.
Example
CDC ACM Callbacks Registration illustrates the use of the callback registration functions. Example – CDC ACM Callbacks Implementation bontša e example ts'ebetsong ea mesebetsi ea callback.
Fetileview
![]()
Example – CDC ACM Callbacks Kemplementation
![]()
- It is important to return false to this function if the line coding applying failed. Otherwise, return true.
Ho Buisana ka ho Sebelisa Sehlopha sa CDC ACM
- Boemo ba serial
- Line Coding
- Taolo ea Line
- Line State
- Subclass Instance Communication
Boemo ba serial
Line Coding
Moamoheli oa USB o laola likhoutu tsa mohala (sekhahla sa baud, parity, joalo-joalo) ea sesebelisoa sa CDC ACM. Ha ho hlokahala, kopo e na le boikarabelo ba ho beha line coding. Ho na le mesebetsi e 'meli e fanoeng ho khutlisa le ho seta likhoutu tsa mohala oa hajoale, joalo ka ha ho hlalositsoe tafoleng e ka tlase.
Letlapa - CDC ACM Line Coding Functions![]()
Taolo ea Line
Moamoheli oa USB o laola taolo ea mohala (RTS le DTR pin, lets'oao la khefu, joalo-joalo) ea sesebelisoa sa CDC ACM. Ha ho hlokahala, kopo ea hau e na le boikarabello ba ho sebelisa li-line controls. Ho fanoe ka ts'ebetso ea ho khutlisa le ho seta litaolo tsa mela ea hajoale, joalo ka ha ho hlalositsoe tafoleng e ka tlase.
Letlapa - CDC ACM Line Control Functions
![]()
Line State
Moamoheli oa USB o khutlisa boemo ba mohala ka nako e itseng. Kopo ea hau e tlameha ho ntlafatsa boemo ba mohala nako le nako ha e fetoha. Ha ho hlokahala, kopo ea hau e na le boikarabello ba ho beha boemo ba mohala. Ho fanoe ka mesebetsi e 'meli ea ho khutlisa le ho beha li-control tsa morao-rao tsa mela, joalo ka ha ho hlalositsoe tafoleng e ka tlase.
Table – CDC ACM Line State Functions![]()
Subclass Instance Communication
Silicon Labs 'ACM subclass e fana ka mesebetsi e latelang ho buisana le moamoheli. Bakeng sa lintlha tse ling mabapi le liparamente tsa function9, bona CDC ACM Subclass Functions reference.![]()
Fetileview
Table – CDC ACM Communication API Summary
sl_usbd_cdc_acm_read() and sl_usbd_cdc_acm_write() provide synchronous communication, which means that the transfer is blocking. In other words, upon calling the function, the application blocks until the transfer is complete with or without an error. A timeout can be specified to avoid waiting forever. The example ka tlase e bonts'a ex ea ho bala le ho ngolaample e amohelang data ho tsoa ho moamoheli a sebelisa boholo ba OUT endpoint mme e romella data ho moamoheli a sebelisa bongata IN endpoint.
Lenane - Serial Bala 'me Ngola Example![]()
- The class instance number created with sl_usbd_cdc_acm_create_instance() provides an internal reference to the ACM subclass to route the transfer to the proper bulk OUT or IN endpoint.
- Your application must ensure that the buffer provided to the function is large enough to accommodate all the data. Otherwise, synchronization issues might happen.
- To avoid an infinite blocking situation, specify a timeout expressed in milliseconds. A value of 809 makes the application task wait forever.
- The application provides the initialized transmit buffer.
FAQs
Q: Can this product support isochronous endpoints?
A: No, the Silicon Labs USB device stack does not currently support isochronous endpoints.
Q: How many functions can be implemented in a CDC composite device?
A: A CDC composite device can have several functions by combining different sets of CCI and DCI(s).
Litokomane / Lisebelisoa
![]() |
SILICON LABS Usb Device Cdc Acm Class [pdf] Bukana ea Mosebelisi Usb Device Cdc Acm Class, Usb Device Cdc Acm Class, Usb Device, Cdc Acm, Class |
