2 * @brief Error code returned by Boot ROM drivers/library functions
\r
5 * This file contains unified error codes to be used across driver,
\r
6 * middleware, applications, hal and demo software.
\r
10 * Copyright(C) NXP Semiconductors, 2012
\r
11 * All rights reserved.
\r
14 * Software that is described herein is for illustrative purposes only
\r
15 * which provides customers with programming information regarding the
\r
16 * LPC products. This software is supplied "AS IS" without any warranties of
\r
17 * any kind, and NXP Semiconductors and its licensor disclaim any and
\r
18 * all warranties, express or implied, including all implied warranties of
\r
19 * merchantability, fitness for a particular purpose and non-infringement of
\r
20 * intellectual property rights. NXP Semiconductors assumes no responsibility
\r
21 * or liability for the use of the software, conveys no license or rights under any
\r
22 * patent, copyright, mask work right, or any other intellectual property rights in
\r
23 * or to any products. NXP Semiconductors reserves the right to make changes
\r
24 * in the software without notification. NXP Semiconductors also makes no
\r
25 * representation or warranty that such application will be suitable for the
\r
26 * specified use without further testing or modification.
\r
29 * Permission to use, copy, modify, and distribute this software and its
\r
30 * documentation is hereby granted, under NXP Semiconductors' and its
\r
31 * licensor's relevant copyrights in the software, without fee, provided that it
\r
32 * is used in conjunction with NXP Semiconductors microcontrollers. This
\r
33 * copyright, permission, and disclaimer notice must appear in all copies of
\r
37 #ifndef __LPC_ERROR_H__
\r
38 #define __LPC_ERROR_H__
\r
40 /** Error code returned by Boot ROM drivers/library functions
\r
42 * Error codes are a 32-bit value with :
\r
43 * - The 16 MSB contains the peripheral code number
\r
44 * - The 16 LSB contains an error code number associated to that peripheral
\r
49 /**\b 0x00000000*/ LPC_OK=0, /**< enum value returned on Success */
\r
50 /**\b 0xFFFFFFFF*/ ERR_FAILED = -1, /**< enum value returned on general failure */
\r
52 /* ISP related errors */
\r
53 ERR_ISP_BASE = 0x00000000,
\r
54 /*0x00000001*/ ERR_ISP_INVALID_COMMAND = ERR_ISP_BASE + 1,
\r
55 /*0x00000002*/ ERR_ISP_SRC_ADDR_ERROR, /* Source address not on word boundary */
\r
56 /*0x00000003*/ ERR_ISP_DST_ADDR_ERROR, /* Destination address not on word or 256 byte boundary */
\r
57 /*0x00000004*/ ERR_ISP_SRC_ADDR_NOT_MAPPED,
\r
58 /*0x00000005*/ ERR_ISP_DST_ADDR_NOT_MAPPED,
\r
59 /*0x00000006*/ ERR_ISP_COUNT_ERROR, /* Byte count is not multiple of 4 or is not a permitted value */
\r
60 /*0x00000007*/ ERR_ISP_INVALID_SECTOR,
\r
61 /*0x00000008*/ ERR_ISP_SECTOR_NOT_BLANK,
\r
62 /*0x00000009*/ ERR_ISP_SECTOR_NOT_PREPARED_FOR_WRITE_OPERATION,
\r
63 /*0x0000000A*/ ERR_ISP_COMPARE_ERROR,
\r
64 /*0x0000000B*/ ERR_ISP_BUSY, /* Flash programming hardware interface is busy */
\r
65 /*0x0000000C*/ ERR_ISP_PARAM_ERROR, /* Insufficient number of parameters */
\r
66 /*0x0000000D*/ ERR_ISP_ADDR_ERROR, /* Address not on word boundary */
\r
67 /*0x0000000E*/ ERR_ISP_ADDR_NOT_MAPPED,
\r
68 /*0x0000000F*/ ERR_ISP_CMD_LOCKED, /* Command is locked */
\r
69 /*0x00000010*/ ERR_ISP_INVALID_CODE, /* Unlock code is invalid */
\r
70 /*0x00000011*/ ERR_ISP_INVALID_BAUD_RATE,
\r
71 /*0x00000012*/ ERR_ISP_INVALID_STOP_BIT,
\r
72 /*0x00000013*/ ERR_ISP_CODE_READ_PROTECTION_ENABLED,
\r
74 /* ROM API related errors */
\r
75 ERR_API_BASE = 0x00010000,
\r
76 /**\b 0x00010001*/ ERR_API_INVALID_PARAMS = ERR_API_BASE + 1, /**< Invalid parameters*/
\r
77 /**\b 0x00010002*/ ERR_API_INVALID_PARAM1, /**< PARAM1 is invalid */
\r
78 /**\b 0x00010003*/ ERR_API_INVALID_PARAM2, /**< PARAM2 is invalid */
\r
79 /**\b 0x00010004*/ ERR_API_INVALID_PARAM3, /**< PARAM3 is invalid */
\r
80 /**\b 0x00010005*/ ERR_API_MOD_INIT, /**< API is called before module init */
\r
82 /* SPIFI API related errors */
\r
83 ERR_SPIFI_BASE = 0x00020000,
\r
84 /*0x00020001*/ ERR_SPIFI_DEVICE_ERROR =ERR_SPIFI_BASE+1,
\r
85 /*0x00020002*/ ERR_SPIFI_INTERNAL_ERROR,
\r
86 /*0x00020003*/ ERR_SPIFI_TIMEOUT,
\r
87 /*0x00020004*/ ERR_SPIFI_OPERAND_ERROR,
\r
88 /*0x00020005*/ ERR_SPIFI_STATUS_PROBLEM,
\r
89 /*0x00020006*/ ERR_SPIFI_UNKNOWN_EXT,
\r
90 /*0x00020007*/ ERR_SPIFI_UNKNOWN_ID,
\r
91 /*0x00020008*/ ERR_SPIFI_UNKNOWN_TYPE,
\r
92 /*0x00020009*/ ERR_SPIFI_UNKNOWN_MFG,
\r
94 /* Security API related errors */
\r
95 ERR_SEC_BASE = 0x00030000,
\r
96 /*0x00030001*/ ERR_SEC_AES_WRONG_CMD=ERR_SEC_BASE+1,
\r
97 /*0x00030002*/ ERR_SEC_AES_NOT_SUPPORTED,
\r
98 /*0x00030003*/ ERR_SEC_AES_KEY_ALREADY_PROGRAMMED,
\r
101 /* USB device stack related errors */
\r
102 ERR_USBD_BASE = 0x00040000,
\r
103 /**\b 0x00040001*/ ERR_USBD_INVALID_REQ = ERR_USBD_BASE + 1, /**< invalid request */
\r
104 /**\b 0x00040002*/ ERR_USBD_UNHANDLED, /**< Callback did not process the event */
\r
105 /**\b 0x00040003*/ ERR_USBD_STALL, /**< Stall the endpoint on which the call back is called */
\r
106 /**\b 0x00040004*/ ERR_USBD_SEND_ZLP, /**< Send ZLP packet on the endpoint on which the call back is called */
\r
107 /**\b 0x00040005*/ ERR_USBD_SEND_DATA, /**< Send data packet on the endpoint on which the call back is called */
\r
108 /**\b 0x00040006*/ ERR_USBD_BAD_DESC, /**< Bad descriptor*/
\r
109 /**\b 0x00040007*/ ERR_USBD_BAD_CFG_DESC,/**< Bad config descriptor*/
\r
110 /**\b 0x00040009*/ ERR_USBD_BAD_INTF_DESC,/**< Bad interface descriptor*/
\r
111 /**\b 0x0004000a*/ ERR_USBD_BAD_EP_DESC,/**< Bad endpoint descriptor*/
\r
112 /**\b 0x0004000b*/ ERR_USBD_BAD_MEM_BUF, /**< Bad alignment of buffer passed. */
\r
113 /**\b 0x0004000c*/ ERR_USBD_TOO_MANY_CLASS_HDLR, /**< Too many class handlers. */
\r
115 /* CGU related errors */
\r
116 ERR_CGU_BASE = 0x00050000,
\r
117 /*0x00050001*/ ERR_CGU_NOT_IMPL=ERR_CGU_BASE+1,
\r
118 /*0x00050002*/ ERR_CGU_INVALID_PARAM,
\r
119 /*0x00050003*/ ERR_CGU_INVALID_SLICE,
\r
120 /*0x00050004*/ ERR_CGU_OUTPUT_GEN,
\r
121 /*0x00050005*/ ERR_CGU_DIV_SRC,
\r
122 /*0x00050006*/ ERR_CGU_DIV_VAL,
\r
123 /*0x00050007*/ ERR_CGU_SRC
\r
129 //#define offsetof(s,m) (int)&(((s *)0)->m)
\r
130 #define COMPILE_TIME_ASSERT(pred) switch(0){case 0:case pred:;}
\r
132 #endif /* __LPC_ERROR_H__ */
\r