espressif_idf-extra-components/usb/usb_host_cdc_acm
Daniel Paul 458086bb45 Added badges with version to the README files of components 2022-12-14 12:16:40 +01:00
..
include/usb usb: Allow CDC-ACM copy constructor 2022-11-07 17:32:26 +01:00
test usb: Update USB tests to IDF v5.0 2022-11-08 08:46:35 +01:00
CMakeLists.txt usb: Fix CDC format errors 2022-09-06 16:00:30 +02:00
LICENSE usb_host: Move to idf-extra-components 2022-07-12 08:16:18 +02:00
README.md Added badges with version to the README files of components 2022-12-14 12:16:40 +01:00
cdc_acm_host.c usb: Define CdcAcmDevice methods as virtual 2022-10-01 15:59:56 +02:00
idf_component.yml usb: Allow CDC-ACM copy constructor 2022-11-07 17:32:26 +01:00

README.md

USB Host CDC-ACM Class Driver

Component Registry

This directory contains an implementation of a USB CDC-ACM Host Class Driver that is implemented on top of the USB Host Library.

Supported Devices

The CDC-ACM Host driver supports the following types of CDC devices:

  1. CDC-ACM devices
  2. CDC-like vendor specific devices (usually found on USB to UART bridge devices)

CDC-ACM Devices

The CDC-ACM Class driver supports CDC-ACM devices that meet the following requirements:

  • The device class code must be set to the CDC class 0x02 or implement Interface Association Descriptor (IAD)
  • The CDC-ACM must contain the following interfaces:
    • A Communication Class Interface containing a management element (EP0) and may also contain a notification element (an interrupt endpoint). The driver will check this interface for CDC Functional Descriptors.
    • A Data Class Interface with two BULK endpoints (IN and OUT). Other transfer types are not supported by the driver

CDC-Like Vendor Specific Devices

The CDC-ACM Class driver supports CDC-like devices that meet the following requirements:

  • The device class code must be set to the vendor specific class code 0xFF
  • The device needs to provide and interface containing the following endpoints:
    • (Mandatory) Two Bulk endpoints (IN and OUT) for data
    • (Optional) An interrupt endpoint (IN) for the notification element

For CDC-like devices, users are responsible for ensuring that they only call APIs (e.g., cdc_acm_host_send_break()) that are supported by the target device.

Usage

The following steps outline the typical API call pattern of the CDC-ACM Class Driver

  1. Install the USB Host Library via usb_host_install()
  2. Install the CDC-ACM driver via cdc_acm_host_install()
  3. Call cdc_acm_host_open()/cdc_acm_host_open_vendor_specific() to open a target CDC-ACM/CDC-like device. These functions will block until the target device is connected
  4. To transmit data, call cdc_acm_host_data_tx_blocking()
  5. When data is received, the driver will automatically run the receive data callback
  6. An opened device can be closed via cdc_acm_host_close()
  7. The CDC-ACM driver can be uninstalled via cdc_acm_host_uninstall()

Examples