ADuCM302x Device Drivers API Reference Manual  Release 3.1.2.0
system_ADuCM3029.h
1 
30 #ifndef SYSTEM_ADUCM3029_H
31 #define SYSTEM_ADUCM3029_H
32 
33 #include <stddef.h> /* for 'NULL' */
34 #include <stdint.h>
35 #include <stdbool.h>
36 #include <adi_processor.h>
37 
38 #ifdef __cplusplus
39 extern "C" {
40 #endif /* __cplusplus */
41 
43 #define SUCCESS 0u
44 
45 #define FAILURE 1u
46 
47 /* System clock constant */
48 #define __HFOSC 26000000u
49 
50 /* System clock constant (may also be 16000000) */
51 #define __HFXTAL 26000000u
52 
53 /*System clock constant (same whether internal osc or external xtal) */
54 #define __LFCLK 32768u
55 
56 /* Selecting HFOSC as input for generating root clock*/
57 #define HFMUX_INTERNAL_OSC_VAL (0u << BITP_CLKG_CLK_CTL0_CLKMUX)
58 
59 /* Selecting HFXTL as input for generating root clock*/
60 #define HFMUX_EXTERNAL_XTAL_VAL (1u << BITP_CLKG_CLK_CTL0_CLKMUX)
61 
62 /* Selecting SPLL as input for generating root clock*/
63 #define HFMUX_SYSTEM_SPLL_VAL (2u << BITP_CLKG_CLK_CTL0_CLKMUX)
64 
65 /* Selecting GPIO as input for generating root clock*/
66 #define HFMUX_GPIO_VAL (3u << BITP_CLKG_CLK_CTL0_CLKMUX)
67 
68 /*
69  * Security options
70  */
71 typedef struct {
72  const uint32_t ReadProtectKeyHash[4];
73  const uint32_t CrcOfReadProtectKeyHash;
74  const uint32_t LastCRCPage;
75  const uint32_t InCircuitWriteProtectCode;
76  const uint32_t FlashBlockWriteProtect;
77 
78 } ADI_ADUCM302X_SECURITY_OPTIONS;
79 
83 #define CACHE_CONTROLLER_KEY 0xF123F456u
84 
85 #define PWRKEY_VALUE_KEY 0x4859u
86 
88 #define NVIC_INTS (65u)
89 
93 typedef uint32_t ADI_SRAM_BANK;
94 
96 #define ADI_SRAM_BANK_0 (1u << 0)
97 
98 #define ADI_SRAM_BANK_1 (1u << 1)
99 
100 #define ADI_SRAM_BANK_2 (1u << 2)
101 
102 #define ADI_SRAM_BANK_3 (1u << 3)
103 
104 #define ADI_SRAM_BANK_4 (1u << 4)
105 
106 #define ADI_SRAM_BANK_5 (1u << 5)
107 
108 #define ADI_SRAM_BANK_6 (1u << 6)
109 
110 #define ADI_SRAM_BANK_7 (1u << 7)
111 
112 extern void SystemInit(void);
113 extern void SystemCoreClockUpdate(void);
114 void adi_system_EnableCache(bool bEnable);
115 uint32_t adi_system_EnableRetention(ADI_SRAM_BANK eBank, bool bEnable);
116 
117 
118 #ifdef __GNUC__
119 #define KEEP_VAR(var) var __attribute__((used))
120 #define SECTION_PLACE(def,sectionname) __attribute__ ((section(sectionname))) def
121 #endif // __GNUC__
122 
123 #ifdef __ARMCC_VERSION
124 #define KEEP_VAR(var) var __attribute__((used))
125 #define SECTION_PLACE(def,sectionname) __attribute__ ((section(sectionname))) def
126 #endif // __ARMCC_VERSION
127 
128 #ifdef __ICCARM__
129 
130 /*
131 * Pm154 (rule 19.10): in the definition of a function-like macro, each instance
132 * of a parameter shall be enclosed in parentheses
133 * The parameters in the following macros cannot be enclosed in parentheses.
134 */
135 #pragma diag_suppress=Pm154
136 
137 #define KEEP_VAR(var) __root var
138 #define SECTION_PLACE(def,sectionname) def @ sectionname
139 
140 #endif /* __ICCARM__ */
141 
142 #if !defined(KEEP_VAR) || !defined(SECTION_PLACE)
143 #error "This compiler is not yet supported"
144 #endif
145 
146 
147 #if defined (__ICCARM__)
148 #pragma diag_default=Pm011
149 #pragma diag_default=Pm154
150 #endif /* __ICCARM__ */
151 
152 #ifdef __cplusplus
153 }
154 #endif
155 
156 #endif /* SYSTEM_ADUCM3029_H */
157 
160 /*
161 ** EOF
162 */
void SystemInit(void)
Sets up the microcontroller system. Initializes the System and updates the relocate vector table...
void SystemCoreClockUpdate(void)
Updates the variable SystemCoreClock and must be called whenever the core clock is changed during pro...
void adi_system_EnableCache(bool bEnable)
This enables or disables the cache.
uint32_t adi_system_EnableRetention(ADI_SRAM_BANK eBank, bool bEnable)
This enables/disable SRAM retention during the hibernation.
uint32_t ADI_SRAM_BANK