1 /***************************************************************************//**
2  * @file
3  * @brief System API (Generic)
4  *******************************************************************************
5  * # License
6  * <b>Copyright 2023 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 EM_SYSTEM_GENERIC_H
31 #define EM_SYSTEM_GENERIC_H
32 
33 #include <stdint.h>
34 #include <stdbool.h>
35 
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39 
40 /***************************************************************************//**
41  * @addtogroup system
42  * @{
43  ******************************************************************************/
44 
45 /*******************************************************************************
46  ********************************   ENUMS   ************************************
47  ******************************************************************************/
48 
49 /** Family security capability. */
50 typedef enum {
51   securityCapabilityUnknown, /**< Unknown security capability. */
52   securityCapabilityNA,      /**< Security capability not applicable. */
53   securityCapabilityBasic,   /**< Basic security capability. */
54   securityCapabilityRoT,     /**< Root of Trust security capability. */
55   securityCapabilitySE,      /**< Secure Element security capability. */
56   securityCapabilityVault    /**< Secure Vault security capability. */
57 } SYSTEM_SecurityCapability_TypeDef;
58 
59 /*******************************************************************************
60  *******************************   STRUCTS   ***********************************
61  ******************************************************************************/
62 
63 /** DEVINFO calibration address/value pair. */
64 typedef struct {
65   uint32_t address;                       /**< Peripheral calibration register address. */
66   uint32_t calValue;                      /**< Calibration value for register at address. */
67 }
68 SYSTEM_CalAddrVal_TypeDef;
69 
70 /*******************************************************************************
71  *****************************   PROTOTYPES   **********************************
72  ******************************************************************************/
73 
74 bool                              SYSTEM_GetCalibrationValue(volatile uint32_t *regAddress);
75 SYSTEM_SecurityCapability_TypeDef SYSTEM_GetSecurityCapability(void);
76 uint64_t                          SYSTEM_GetUnique(void);
77 uint8_t                           SYSTEM_GetProdRev(void);
78 uint32_t                          SYSTEM_GetSRAMBaseAddress(void);
79 uint16_t                          SYSTEM_GetSRAMSize(void);
80 uint16_t                          SYSTEM_GetFlashSize(void);
81 uint32_t                          SYSTEM_GetFlashPageSize(void);
82 uint16_t                          SYSTEM_GetPartNumber(void);
83 uint8_t                           SYSTEM_GetCalibrationTemperature(void);
84 
85 /** @} (end addtogroup system) */
86 
87 #ifdef __cplusplus
88 }
89 #endif
90 
91 #endif /* EM_SYSTEM_GENERIC_H */
92