USBD ROM Stack  1.0
ROM based USB device stack
mw_common/error.h File Reference

Error code returned by Boot ROM drivers/library functions.This file contains unified error codes to be used across driver, middleware, applications, hal and demo software. More...

Go to the source code of this file.

Defines

#define offsetof(s, m)   (int)&(((s *)0)->m)
#define COMPILE_TIME_ASSERT(pred)   switch(0){case 0:case pred:;}

Enumerations

enum  ErrorCode_t {
  LPC_OK = 0, ERR_FAILED = -1, ERR_ISP_BASE = 0x00000000, ERR_ISP_INVALID_COMMAND = ERR_ISP_BASE + 1,
  ERR_ISP_SRC_ADDR_ERROR, ERR_ISP_DST_ADDR_ERROR, ERR_ISP_SRC_ADDR_NOT_MAPPED, ERR_ISP_DST_ADDR_NOT_MAPPED,
  ERR_ISP_COUNT_ERROR, ERR_ISP_INVALID_SECTOR, ERR_ISP_SECTOR_NOT_BLANK, ERR_ISP_SECTOR_NOT_PREPARED_FOR_WRITE_OPERATION,
  ERR_ISP_COMPARE_ERROR, ERR_ISP_BUSY, ERR_ISP_PARAM_ERROR, ERR_ISP_ADDR_ERROR,
  ERR_ISP_ADDR_NOT_MAPPED, ERR_ISP_CMD_LOCKED, ERR_ISP_INVALID_CODE, ERR_ISP_INVALID_BAUD_RATE,
  ERR_ISP_INVALID_STOP_BIT, ERR_ISP_CODE_READ_PROTECTION_ENABLED, ERR_API_BASE = 0x00010000, ERR_API_INVALID_PARAMS = ERR_API_BASE + 1,
  ERR_API_INVALID_PARAM1, ERR_API_INVALID_PARAM2, ERR_API_INVALID_PARAM3, ERR_API_MOD_INIT,
  ERR_SPIFI_BASE = 0x00020000, ERR_SPIFI_DEVICE_ERROR = ERR_SPIFI_BASE+1, ERR_SPIFI_INTERNAL_ERROR, ERR_SPIFI_TIMEOUT,
  ERR_SPIFI_OPERAND_ERROR, ERR_SPIFI_STATUS_PROBLEM, ERR_SPIFI_UNKNOWN_EXT, ERR_SPIFI_UNKNOWN_ID,
  ERR_SPIFI_UNKNOWN_TYPE, ERR_SPIFI_UNKNOWN_MFG, ERR_SPIFI_NO_DEVICE, ERR_SPIFI_ERASE_NEEDED,
  ERR_SEC_BASE = 0x00030000, ERR_SEC_AES_WRONG_CMD = ERR_SEC_BASE+1, ERR_SEC_AES_NOT_SUPPORTED, ERR_SEC_AES_KEY_ALREADY_PROGRAMMED,
  ERR_USBD_BASE = 0x00040000, ERR_USBD_INVALID_REQ = ERR_USBD_BASE + 1, ERR_USBD_UNHANDLED, ERR_USBD_STALL,
  ERR_USBD_SEND_ZLP, ERR_USBD_SEND_DATA, ERR_USBD_BAD_DESC, ERR_USBD_BAD_CFG_DESC,
  ERR_USBD_BAD_INTF_DESC, ERR_USBD_BAD_EP_DESC, ERR_USBD_BAD_MEM_BUF, ERR_USBD_TOO_MANY_CLASS_HDLR,
  ERR_CGU_BASE = 0x00050000, ERR_CGU_NOT_IMPL = ERR_CGU_BASE+1, ERR_CGU_INVALID_PARAM, ERR_CGU_INVALID_SLICE,
  ERR_CGU_OUTPUT_GEN, ERR_CGU_DIV_SRC, ERR_CGU_DIV_VAL, ERR_CGU_SRC,
  ERR_I2C_BASE = 0x00060000, ERR_I2C_NAK = ERR_I2C_BASE+1, ERR_I2C_BUFFER_OVERFLOW, ERR_I2C_BYTE_COUNT_ERR,
  ERR_I2C_LOSS_OF_ARBRITRATION, ERR_I2C_SLAVE_NOT_ADDRESSED, ERR_I2C_LOSS_OF_ARBRITRATION_NAK_BIT, ERR_I2C_GENERAL_FAILURE,
  ERR_I2C_REGS_SET_TO_DEFAULT
}

Detailed Description

Error code returned by Boot ROM drivers/library functions.

This file contains unified error codes to be used across driver, middleware, applications, hal and demo software.


Enumeration Type Documentation

Error code returned by Boot ROM drivers/library functions

Error codes are a 32-bit value with :

  • The 16 MSB contains the peripheral code number
  • The 16 LSB contains an error code number associated to that peripheral
Enumerator:
LPC_OK 

0x00000000 enum value returned on Success

ERR_FAILED 

0xFFFFFFFF enum value returned on general failure

ERR_API_INVALID_PARAMS 

0x00010001 Invalid parameters

ERR_API_INVALID_PARAM1 

0x00010002 PARAM1 is invalid

ERR_API_INVALID_PARAM2 

0x00010003 PARAM2 is invalid

ERR_API_INVALID_PARAM3 

0x00010004 PARAM3 is invalid

ERR_API_MOD_INIT 

0x00010005 API is called before module init

ERR_USBD_INVALID_REQ 

0x00040001 invalid request

ERR_USBD_UNHANDLED 

0x00040002 Callback did not process the event

ERR_USBD_STALL 

0x00040003 Stall the endpoint on which the call back is called

ERR_USBD_SEND_ZLP 

0x00040004 Send ZLP packet on the endpoint on which the call back is called

ERR_USBD_SEND_DATA 

0x00040005 Send data packet on the endpoint on which the call back is called

ERR_USBD_BAD_DESC 

0x00040006 Bad descriptor

ERR_USBD_BAD_CFG_DESC 

0x00040007 Bad config descriptor

ERR_USBD_BAD_INTF_DESC 

0x00040009 Bad interface descriptor

ERR_USBD_BAD_EP_DESC 

0x0004000a Bad endpoint descriptor

ERR_USBD_BAD_MEM_BUF 

0x0004000b Bad alignment of buffer passed.

ERR_USBD_TOO_MANY_CLASS_HDLR 

0x0004000c Too many class handlers.