1 /***************************************************************************//**
2  * @file
3  * @brief Energy Aware drivers error code definitions.
4  *******************************************************************************
5  * # License
6  * <b>Copyright 2018 Silicon Laboratories Inc. www.silabs.com</b>
7  *******************************************************************************
8  *
9  * SPDX-License-Identifier: Zlib
10  *
11  * The licensor of this software is Silicon Laboratories Inc.
12  *
13  * This software is provided 'as-is', without any express or implied
14  * warranty. In no event will the authors be held liable for any damages
15  * arising from the use of this software.
16  *
17  * Permission is granted to anyone to use this software for any purpose,
18  * including commercial applications, and to alter it and redistribute it
19  * freely, subject to the following restrictions:
20  *
21  * 1. The origin of this software must not be misrepresented; you must not
22  *    claim that you wrote the original software. If you use this software
23  *    in a product, an acknowledgment in the product documentation would be
24  *    appreciated but is not required.
25  * 2. Altered source versions must be plainly marked as such, and must not be
26  *    misrepresented as being the original software.
27  * 3. This notice may not be removed or altered from any source distribution.
28  *
29  ******************************************************************************/
30 #ifndef __SILICON_LABS_ECODE_H__
31 #define __SILICON_LABS_ECODE_H__
32 
33 #include <stdint.h>
34 
35 /***************************************************************************//**
36  * @addtogroup ecode ECODE - Error Codes
37  * @details ECODE is set of error and status codes related to DMA, RTC, SPI,
38  *        NVM, USTIMER, UARTDRV, EZRADIO, TEMP, and NVM3 drivers. These error and
39  *        status codes are used by the above listed drivers to update the layer
40  *        (using the driver) about an error or status.
41  *
42  * @{
43  ******************************************************************************/
44 
45 /***************************************************************************//**
46  * @brief Typedef for API function error code return values.
47  *
48  * @details
49  *        Bit 24-31:  Component, for example emdrv @n
50  *        Bit 16-23:  Module, for example @ref uartdrv or @ref spidrv @n
51  *        Bit 0-15:   Error code
52  ******************************************************************************/
53 typedef uint32_t Ecode_t;
54 
55 #define ECODE_EMDRV_BASE  (0xF0000000U)   ///< Base value for all EMDRV errorcodes.
56 
57 #define ECODE_OK          (0U)            ///< Generic success return value.
58 
59 #define ECODE_EMDRV_SPIDRV_BASE      (ECODE_EMDRV_BASE | 0x00002000U)   ///< Base value for SPIDRV error codes.
60 #define ECODE_EMDRV_NVM_BASE         (ECODE_EMDRV_BASE | 0x00003000U)   ///< Base value for NVM error codes.
61 #define ECODE_EMDRV_USTIMER_BASE     (ECODE_EMDRV_BASE | 0x00004000U)   ///< Base value for USTIMER error codes.
62 #define ECODE_EMDRV_UARTDRV_BASE     (ECODE_EMDRV_BASE | 0x00007000U)   ///< Base value for UARTDRV error codes.
63 #define ECODE_EMDRV_DMADRV_BASE      (ECODE_EMDRV_BASE | 0x00008000U)   ///< Base value for DMADRV error codes.
64 #define ECODE_EMDRV_EZRADIODRV_BASE  (ECODE_EMDRV_BASE | 0x00009000U)   ///< Base value for EZRADIODRV error codes.
65 #define ECODE_EMDRV_TEMPDRV_BASE     (ECODE_EMDRV_BASE | 0x0000D000U)   ///< Base value for TEMPDRV error codes.
66 #define ECODE_EMDRV_NVM3_BASE        (ECODE_EMDRV_BASE | 0x0000E000U)   ///< Base value for NVM3 error codes.
67 
68 /** @} (end addtogroup ecode) */
69 
70 #endif // __SILICON_LABS_ECODE_H__
71