3.6 Device Configuration Commands and Their Responses

The MCP2222 supports device configuration through the USB vendor-class interface.

The command and response formats are as given below:

  • Command format: bCommandCode + Payload
  • Response format: wResponseCode + Payload

The following endpoints are used for configuration commands and responses:

  • Endpoint 0x05 (OUT) — Used by the USB host to send configuration commands.
  • Endpoint 0x85 (IN) — Used by the USB host to read command responses.
  • CommandEffect

    CNFG_SetUSBParameters

    Saves the USB parameters to NVM. The changes are applied during the next enumeration.

    CNFG_SetManufacturer

    Saves the manufacturer name to NVM. The changes are applied during the next enumeration.

    CNFG_SetProductName

    Saves the product name to NVM. The changes are applied during the next enumeration.

    CNFG_SetSerialNumber

    Saves the serial number to NVM. The changes are applied during the next enumeration.

    CNFG_GetUSBParameters

    Reads the USB parameters from NVM

    CNFG_GetManufacturer

    Reads the manufacturer name from NVM

    CNFG_GetProductName

    Reads the product name from NVM

    CNFG_GetSerialNumber

    Reads the serial number from NVM

    CNFG_SetIOConfiguration

    Saves the six I/O pin configuration to NVM

    CNFG_GetIOConfiguration

    Reads the configuration of the six I/O pins saved in SRAM or NVM

    CNFG_SetI2CConfiguration

    Saves the I2C configuration to NVM

    CNFG_GetI2CConfiguration

    Reads the I2C configuration from SRAM or NVM

    CNFG_SetSPICConfiguration

    Saves the SPI configuration to NVM

    CNFG_GetSPICConfiguration

    Reads the SPI configuration from SRAM or NVM

    CNFG_ResetToFactoryDefault

    Restores the NVM settings to their factory-default values

    CNFG_SetPassword

    Enables password protection and saves the password to NVM

    CNFG_DisablePassword

    Disables password protection

    CNFG_LockConfiguration

    Locks the password-protected configuration

    CNFG_UnlockConfiguration

    Unlocks the password-protected configuration

    CNFG_ChangePassword

    Changes the password and saves the new password to NVM

    CNFG_PermanentLockCfg

    Permanently locks the device configuration

    CNFG_GetCfgProtectionLevel

    Reads the current device configuration protection level

    CNFG_SetNVMasCurrent

    Makes the power-up I/O, I2C and SPI current settings

    CNFG_GetRevID

    Reads the device revision ID

    CNFG_SoftReset

    Resets the device and causes it to re-enumerate