device_status.h 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. /* Copyright Statement:
  2. *
  3. * This software/firmware and related documentation ("AutoChips Software") are
  4. * protected under relevant copyright laws. The information contained herein is
  5. * confidential and proprietary to AutoChips Inc. and/or its licensors. Without
  6. * the prior written permission of AutoChips inc. and/or its licensors, any
  7. * reproduction, modification, use or disclosure of AutoChips Software, and
  8. * information contained herein, in whole or in part, shall be strictly
  9. * prohibited.
  10. *
  11. * AutoChips Inc. (C) 2021. All rights reserved.
  12. *
  13. * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
  14. * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("AUTOCHIPS SOFTWARE")
  15. * RECEIVED FROM AUTOCHIPS AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
  16. * ON AN "AS-IS" BASIS ONLY. AUTOCHIPS EXPRESSLY DISCLAIMS ANY AND ALL
  17. * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
  18. * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
  19. * NONINFRINGEMENT. NEITHER DOES AUTOCHIPS PROVIDE ANY WARRANTY WHATSOEVER WITH
  20. * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
  21. * INCORPORATED IN, OR SUPPLIED WITH THE AUTOCHIPS SOFTWARE, AND RECEIVER AGREES
  22. * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
  23. * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
  24. * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN AUTOCHIPS
  25. * SOFTWARE. AUTOCHIPS SHALL ALSO NOT BE RESPONSIBLE FOR ANY AUTOCHIPS SOFTWARE
  26. * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
  27. * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND AUTOCHIPS'S
  28. * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE AUTOCHIPS SOFTWARE
  29. * RELEASED HEREUNDER WILL BE, AT AUTOCHIPS'S OPTION, TO REVISE OR REPLACE THE
  30. * AUTOCHIPS SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
  31. * CHARGE PAID BY RECEIVER TO AUTOCHIPS FOR SUCH AUTOCHIPS SOFTWARE AT ISSUE.
  32. */
  33. /*!
  34. * @file device_status.h
  35. *
  36. * @brief This file provides all device status enum.
  37. *
  38. */
  39. #ifndef _DEVICE_STATUS_H
  40. #define _DEVICE_STATUS_H
  41. #ifdef __cplusplus
  42. extern "C" {
  43. #endif /* __cplusplus */
  44. typedef enum
  45. {
  46. /* Generic error codes */
  47. STATUS_SUCCESS = 0x000U, /*!< Generic operation success status */
  48. STATUS_ERROR = 0x001U, /*!< Generic operation failure status */
  49. STATUS_BUSY = 0x002U, /*!< Generic operation busy status */
  50. STATUS_TIMEOUT = 0x003U, /*!< Generic operation timeout status */
  51. STATUS_UNSUPPORTED = 0x004U, /*!< Generic operation unsupported status */
  52. /* MCU specific error codes */
  53. STATUS_MCU_GATED_OFF = 0x100U, /*!< Module is gated off */
  54. STATUS_MCU_TRANSITION_FAILED = 0x101U, /*!< Error occurs during transition. */
  55. STATUS_MCU_INVALID_STATE = 0x102U, /*!< Unsupported in current state. */
  56. STATUS_MCU_NOTIFY_BEFORE_ERROR = 0x103U, /*!< Error occurs during send "BEFORE" notification. */
  57. STATUS_MCU_NOTIFY_AFTER_ERROR = 0x104U, /*!< Error occurs during send "AFTER" notification. */
  58. /* I2C specific error codes */
  59. STATUS_I2C_RECEIVED_NACK = 0x200U, /*!< NACK signal received */
  60. STATUS_I2C_TX_UNDERRUN = 0x201U, /*!< TX underrun error */
  61. STATUS_I2C_RX_OVERRUN = 0x202U, /*!< RX overrun error */
  62. STATUS_I2C_ARBITRATION_LOST = 0x203U, /*!< Arbitration lost */
  63. STATUS_I2C_ABORTED = 0x204U, /*!< A transfer was aborted */
  64. STATUS_I2C_BUS_BUSY = 0x205U, /*!< I2C bus is busy, cannot start transfer */
  65. /* Security specific error codes */
  66. STATUS_SEC_SEQUENCE_ERROR = 0x402U, /*!< The sequence of commands or subcommands is out of
  67. sequence */
  68. STATUS_SEC_KEY_NOT_AVAILABLE = 0x403U, /*!< A key is locked due to failed boot measurement or
  69. an active debugger */
  70. STATUS_SEC_KEY_INVALID = 0x404U, /*!< A function is called to perform an operation with
  71. a key that is not allowed for the given operation */
  72. STATUS_SEC_KEY_EMPTY = 0x405U, /*!< Attempt to use a key that has not been initialized yet */
  73. STATUS_SEC_NO_SECURE_BOOT = 0x406U, /*!< The conditions for a secure boot process are not met */
  74. STATUS_SEC_KEY_WRITE_PROTECTED = 0x407U, /*!< Request for updating a write protected key slot,
  75. or activating debugger with write protected key(s) */
  76. STATUS_SEC_KEY_UPDATE_ERROR = 0x408U, /*!< Key update did not succeed due to errors in
  77. verification of the messages */
  78. STATUS_SEC_RNG_SEED = 0x409U, /*!< Returned by CMD_RND and CMD_DEBUG if the seed has not
  79. been initialized before */
  80. STATUS_SEC_NO_DEBUGGING = 0x40AU, /*!< DEBUG command authentication failed */
  81. STATUS_SEC_MEMORY_FAILURE = 0x40CU, /*!< General memory technology failure
  82. (multibit ECC error, common fault detected) */
  83. STATUS_SEC_HSM_INTERNAL_MEMORY_ERROR = 0x410U, /*!< An internal memory error encountered while
  84. executing the command */
  85. STATUS_SEC_INVALID_COMMAND = 0x411U, /*!< Command value out of range */
  86. STATUS_SEC_TRNG_ERROR = 0x412U, /*!< One or more statistical tests run on the TRNG output failed */
  87. STATUS_SEC_HSM_FLASH_BLOCK_ERROR = 0x413U, /*!< Error reading, programming or erasing one of the HSM flash blocks */
  88. STATUS_SEC_INTERNAL_CMD_ERROR = 0x414U, /*!< An internal command processor error while executing a command */
  89. STATUS_SEC_MAC_LENGTH_ERROR = 0x415U, /*!< MAC/Message length out of range */
  90. STATUS_SEC_INVALID_ARG = 0x421U, /*!< Invalid command argument */
  91. STATUS_SEC_TRNG_CLOCK_ERROR = 0x423U, /*!< TRNG not provided with a stable clock */
  92. /* SPI specific error codes */
  93. STATUS_SPI_TX_UNDERRUN = 0x500U, /*!< TX underrun error */
  94. STATUS_SPI_RX_OVERRUN = 0x501U, /*!< RX overrun error */
  95. STATUS_SPI_ABORTED = 0x502U, /*!< A transfer was aborted */
  96. /* UART specific error codes */
  97. STATUS_UART_TX_UNDERRUN = 0x600U, /*!< TX underrun error */
  98. STATUS_UART_RX_OVERRUN = 0x601U, /*!< RX overrun error */
  99. STATUS_UART_ABORTED = 0x602U, /*!< A transfer was aborted */
  100. STATUS_UART_FRAMING_ERROR = 0x603U, /*!< Framing error */
  101. STATUS_UART_PARITY_ERROR = 0x604U, /*!< Parity error */
  102. STATUS_UART_BREAK_ERROR = 0x605U, /*!< Break error */
  103. STATUS_UART_NOISE_ERROR = 0x606U, /*!< Noise error */
  104. /* I2S specific error codes */
  105. STATUS_I2S_TX_UNDERRUN = 0x700U, /*!< TX underrun error */
  106. STATUS_I2S_RX_OVERRUN = 0x701U, /*!< RX overrun error */
  107. STATUS_I2S_ABORTED = 0x702U, /*!< A transfer was aborted */
  108. } status_t;
  109. #ifdef __cplusplus
  110. }
  111. #endif /* __cplusplus */
  112. #endif /* _DEVICE_STATUS_H */
  113. /* ============================================= EOF ============================================== */