libeasymcp2221 2.0.3
Enumerations
mcp2221_error_codes.h File Reference

Error codes returned by the libeasymcp2221 v2 API. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum  mcp2221_error_code_t {
  MCP2221_ERR_OK = 0 , MCP2221_ERR_USB = -1 , MCP2221_ERR_TIMEOUT = -2 , MCP2221_ERR_NOT_ACK = -3 ,
  MCP2221_ERR_LOW_SCL = -4 , MCP2221_ERR_LOW_SDA = -5 , MCP2221_ERR_INVALID = -6 , MCP2221_ERR_I2C = -7 ,
  MCP2221_ERR_FLASH_WRITE = -8 , MCP2221_ERR_FLASH_PASSWD = -9 , MCP2221_ERR_GPIO_MODE = -10 , MCP2221_ERR_GENERIC = -11 ,
  MCP2221_ERR_I2C_SHORT_READ = -12 , MCP2221_ERR_FLASH_READ = -13 , MCP2221_ERR_NOT_FOUND = -14 , MCP2221_ERR_NO_MEMORY = -15 ,
  MCP2221_ERR_ACCESS = -16 , MCP2221_ERR_BUSY = -17 , MCP2221_ERR_USB_INIT = -18 , MCP2221_ERR_USB_ENUM = -19 ,
  MCP2221_ERR_USB_OPEN = -20 , MCP2221_ERR_USB_CLAIM = -21 , MCP2221_ERR_COMMAND_FAILED = -22 , MCP2221_ERR_PROTOCOL = -23
}
 Error codes used by libeasymcp2221. More...
 

Detailed Description

Error codes returned by the libeasymcp2221 v2 API.

Definition in file mcp2221_error_codes.h.

Enumeration Type Documentation

◆ mcp2221_error_code_t

Error codes used by libeasymcp2221.

Most public functions return MCP2221_ERR_OK on success or one of the negative values below on failure. The error model is based on the EasyMCP2221 exception hierarchy while providing explicit C return values.

See also
mcp2221_error_code_to_string()
Enumerator
MCP2221_ERR_OK 

No error.

MCP2221_ERR_USB 

Generic USB transport error.

MCP2221_ERR_TIMEOUT 

I2C or USB operation timed out.

MCP2221_ERR_NOT_ACK 

I2C target did not acknowledge.

MCP2221_ERR_LOW_SCL 

SCL remained low.

MCP2221_ERR_LOW_SDA 

SDA remained low.

MCP2221_ERR_INVALID 

Invalid argument, value, state, or device response.

MCP2221_ERR_I2C 

Generic I2C error.

MCP2221_ERR_FLASH_WRITE 

Flash write failed.

MCP2221_ERR_FLASH_PASSWD 

Flash password error.

MCP2221_ERR_GPIO_MODE 

Invalid or unsupported GPIO mode.

MCP2221_ERR_GENERIC 

Unclassified error.

MCP2221_ERR_I2C_SHORT_READ 

I2C read completed before the requested length.

MCP2221_ERR_FLASH_READ 

Flash read failed.

MCP2221_ERR_NOT_FOUND 

Requested MCP2221 device was not found.

MCP2221_ERR_NO_MEMORY 

Memory allocation failed.

MCP2221_ERR_ACCESS 

Access or permission was denied.

MCP2221_ERR_BUSY 

Device or USB interface is busy.

MCP2221_ERR_USB_INIT 

USB backend initialization failed.

MCP2221_ERR_USB_ENUM 

USB device enumeration failed.

MCP2221_ERR_USB_OPEN 

USB device open failed.

MCP2221_ERR_USB_CLAIM 

USB interface claim failed.

MCP2221_ERR_COMMAND_FAILED 

MCP2221 rejected or failed a command.

MCP2221_ERR_PROTOCOL 

Invalid or mismatched MCP2221 protocol response.

Definition at line 18 of file mcp2221_error_codes.h.