2.3 USB Vendor Class Device

Except for the USB-to-UART function, which uses the CDC-ACM class interface, all other MCP2222 functions use the USB vendor class interface. These functions include:

  • USB-to-I²C communication
  • USB-to-SPI communication
  • GPIO control
  • Device configuration

On Windows systems, the MCP2222 enumerates as a WinUSB vendor-class device and appears in Device Manager as a USB converter. WinUSB is a generic USB driver provided by Microsoft that allows applications to communicate with USB devices without requiring a custom kernel-mode driver. WinUSB includes the kernel-mode driver, Winusb.sys, and the user-mode dynamic link library, Winusb.dll.

On macOS and Linux systems, the MCP2222 enumerates as a libusb vendor-class device. libusb is a portable library that provides generic access to USB devices and allows application software to communicate with USB hardware across multiple operating systems, including Linux, macOS, and Windows.

Vendor-class communication typically begins when the USB host writes a command packet to one of the OUT endpoints associated with Interface 2. The MCP2222 uses the following endpoints for vendor-class functions:

  • Endpoint 3 and 83: I²C communication
  • Endpoint 4 and 84: GPIO control
  • Endpoint 5 and 85: Device configuration
  • Endpoint 6 and 86: SPI communication

The device response is typically a 2-byte packet, although responses of up to 64 bytes may be received from the corresponding IN endpoint, depending on the command.