1 
2 //------------------------------------------------------------------------------
3 // Copyright 2012 (c) Silicon Laboratories Inc.
4 //
5 // SPDX-License-Identifier: Zlib
6 //
7 // This siHAL software is provided 'as-is', without any express or implied
8 // warranty. In no event will the authors be held liable for any damages
9 // arising from the use of this software.
10 //
11 // Permission is granted to anyone to use this software for any purpose,
12 // including commercial applications, and to alter it and redistribute it
13 // freely, subject to the following restrictions:
14 //
15 // 1. The origin of this software must not be misrepresented; you must not
16 //    claim that you wrote the original software. If you use this software
17 //    in a product, an acknowledgment in the product documentation would be
18 //    appreciated but is not required.
19 // 2. Altered source versions must be plainly marked as such, and must not be
20 //    misrepresented as being the original software.
21 // 3. This notice may not be removed or altered from any source distribution.
22 //------------------------------------------------------------------------------
23 
24 #ifndef __SIM3U1XX_H__
25 #define __SIM3U1XX_H__
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
31 #define __MPU_PRESENT             0
32 #define __NVIC_PRIO_BITS          4
33 #define __Vendor_SysTickConfig    0
34 
35 typedef enum IRQn
36 {
37   // CPU
38   NonMaskableInt_IRQn   = -14, // 2
39   MemoryManagement_IRQn = -12, // 4
40   BusFault_IRQn         = -11, // 5
41   UsageFault_IRQn       = -10, // 6
42   SVCall_IRQn           = -5,  // 11
43   DebugMonitor_IRQn     = -4,  // 12
44   PendSV_IRQn           = -2,  // 14
45   SysTick_IRQn          = -1,  // 15
46   // MCU
47   WDTIMER0_IRQn         = 0,
48   PBEXT0_IRQn           = 1,
49   PBEXT1_IRQn           = 2,
50   RTC0ALRM_IRQn         = 3,
51   DMACH0_IRQn           = 4,
52   DMACH1_IRQn           = 5,
53   DMACH2_IRQn           = 6,
54   DMACH3_IRQn           = 7,
55   DMACH4_IRQn           = 8,
56   DMACH5_IRQn           = 9,
57   DMACH6_IRQn           = 10,
58   DMACH7_IRQn           = 11,
59   DMACH8_IRQn           = 12,
60   DMACH9_IRQn           = 13,
61   DMACH10_IRQn          = 14,
62   DMACH11_IRQn          = 15,
63   DMACH12_IRQn          = 16,
64   DMACH13_IRQn          = 17,
65   DMACH14_IRQn          = 18,
66   DMACH15_IRQn          = 19,
67   TIMER0L_IRQn          = 20,
68   TIMER0H_IRQn          = 21,
69   TIMER1L_IRQn          = 22,
70   TIMER1H_IRQn          = 23,
71   EPCA0_IRQn            = 24,
72   PCA0_IRQn             = 25,
73   PCA1_IRQn             = 26,
74   USART0_IRQn           = 27,
75   USART1_IRQn           = 28,
76   SPI0_IRQn             = 29,
77   SPI1_IRQn             = 30,
78   SPI2_IRQn             = 31,
79   I2C0_IRQn             = 32,
80   I2C1_IRQn             = 33,
81   USB0_IRQn             = 34,
82   SARADC0_IRQn          = 35,
83   SARADC1_IRQn          = 36,
84   CMP0_IRQn             = 37,
85   CMP1_IRQn             = 38,
86   CAPSENSE0_IRQn        = 39,
87   I2S0RX_IRQn           = 40,
88   I2S0TX_IRQn           = 41,
89   AES0_IRQn             = 42,
90   VDDLOW_IRQn           = 43,
91   RTC0FAIL_IRQn         = 44,
92   PMATCH_IRQn           = 45,
93   UART0_IRQn            = 46,
94   UART1_IRQn            = 47,
95   IDAC0_IRQn            = 48,
96   IDAC1_IRQn            = 49,
97   LPTIMER0_IRQn         = 50,
98   PLL0_IRQn             = 51,
99   VBUSINVALID_IRQn      = 52,
100   VREG0LOW_IRQn         = 53,
101 } IRQn_Type;
102 
103 #include <core_cm3.h>
104 #include <system_sim3u1xx.h>
105 
106 //-----------------------------------------------------------------------------
107 
108 #include <SI32_AES_A_Registers.h>
109 #include <SI32_CAPSENSE_A_Registers.h>
110 #include <SI32_CMP_A_Registers.h>
111 #include <SI32_CRC_A_Registers.h>
112 #include <SI32_DMACTRL_A_Registers.h>
113 #include <SI32_DMADESC_A_Registers.h>
114 #include <SI32_EMIF_A_Registers.h>
115 #include <SI32_EMIFIF_A_Registers.h>
116 #include <SI32_EPCA_A_Registers.h>
117 #include <SI32_EPCACH_A_Registers.h>
118 #include <SI32_EXTOSC_A_Registers.h>
119 #include <SI32_EXTVREG_A_Registers.h>
120 #include <SI32_FLASHCTRL_A_Registers.h>
121 #include <SI32_I2C_A_Registers.h>
122 #include <SI32_I2S_A_Registers.h>
123 #include <SI32_IDAC_A_Registers.h>
124 #include <SI32_IVC_A_Registers.h>
125 #include <SI32_LPTIMER_A_Registers.h>
126 #include <SI32_PCA_A_Registers.h>
127 #include <SI32_PCACH_A_Registers.h>
128 #include <SI32_PLL_A_Registers.h>
129 #include <SI32_RTC_A_Registers.h>
130 #include <SI32_SARADC_A_Registers.h>
131 #include <SI32_SPI_A_Registers.h>
132 #include <SI32_SSG_A_Registers.h>
133 #include <SI32_TIMER_A_Registers.h>
134 #include <SI32_USART_A_Registers.h>
135 #include <SI32_UART_A_Registers.h>
136 #include <SI32_USB_A_Registers.h>
137 #include <SI32_USBEP_A_Registers.h>
138 #include <SI32_VMON_A_Registers.h>
139 #include <SI32_VREF_A_Registers.h>
140 #include <SI32_VREG_A_Registers.h>
141 #include <SI32_WDTIMER_A_Registers.h>
142 
143 #include <SI32_SIM3U1XX_CLKCTRL_A_Registers.h>
144 #include <SI32_SIM3U1XX_DEVICEID_A_Registers.h>
145 #include <SI32_SIM3U1XX_DMAXBAR_A_Registers.h>
146 #include <SI32_SIM3U1XX_LDO_A_Registers.h>
147 #include <SI32_SIM3U1XX_LOCK_A_Registers.h>
148 #include <SI32_SIM3U1XX_PBCFG_A_Registers.h>
149 #include <SI32_SIM3U1XX_PBSTD_A_Registers.h>
150 #include <SI32_SIM3U1XX_PBHD_A_Registers.h>
151 #include <SI32_SIM3U1XX_PMU_A_Registers.h>
152 #include <SI32_SIM3U1XX_RSTSRC_A_Registers.h>
153 #include <SI32_SIM3U1XX_SCONFIG_A_Registers.h>
154 
155 //-----------------------------------------------------------------------------
156 // Define constants for the chip's memory regions.
157 #define SI32_MCU_FLASH_BASE             0x00000000
158 #define SI32_MCU_RAM_BASE               0x20000000
159 
160 #if defined(SI32_MCU_SIM3U16X)
161 # define SI32_MCU_FLASH_SIZE            0x0003FFFC
162 # define SI32_MCU_RAM_SIZE              0x00008000
163 #elif defined(SI32_MCU_SIM3U15X)
164 # define SI32_MCU_FLASH_SIZE            0x00020000
165 # define SI32_MCU_RAM_SIZE              0x00008000
166 #elif defined(SI32_MCU_SIM3U14X)
167 # define SI32_MCU_FLASH_SIZE            0x00010000
168 # define SI32_MCU_RAM_SIZE              0x00004000
169 #else //defined(SI32_MCU_SIM3U13X)
170 # define SI32_MCU_FLASH_SIZE            0x00008000
171 # define SI32_MCU_RAM_SIZE              0x00002000
172 #endif
173 
174 #define SI32_MCU_RETENTION_RAM_BASE     SI32_MCU_RAM_BASE
175 #define SI32_MCU_RETENTION_RAM_SIZE     0x00001000
176 
177 #define SI32_MCU_EMIF_CS0_BASE          0x60000000
178 #define SI32_MCU_EMIF_CS1_BASE          0x68000000
179 #define SI32_MCU_EMIF_SIZE              0x08000000
180 
181 //------------------------------------------------------------------------------
182 // ARM RealView
183 #if defined (__CC_ARM)
184 
185 #define __SI32_RETENTION_REGION __attribute__ ((section(".SI32.RETENTION"), zero_init))
186 #define __SI32_EMIF_CS0_REGION __attribute__ ((section(".SI32.EMIF_CS0")))
187 #define __SI32_EMIF_CS1_REGION __attribute__ ((section(".SI32.EMIF_CS1")))
188 
189 //------------------------------------------------------------------------------
190 // IAR
191 #elif defined (__ICCARM__)
192 
193 #define __SI32_RETENTION_REGION _Pragma("location=\".SI32.RETENTION\"")
194 #define __SI32_EMIF_CS0_REGION _Pragma("location=\".SI32.EMIF_CS0\"")
195 #define __SI32_EMIF_CS1_REGION _Pragma("location=\".SI32.EMIF_CS1\"")
196 
197 //------------------------------------------------------------------------------
198 // GCC
199 #elif defined (__GNUC__)
200 
201 #define __SI32_RETENTION_REGION __attribute__ ((section(".bss.$RESERVED")))
202 #define __SI32_EMIF_CS0_REGION
203 #define __SI32_EMIF_CS1_REGION
204 
205 #endif
206 
207 //-----------------------------------------------------------------------------
208 // Define the instances of the peripherals
209 
210 // USART
211 #define SI32_USART_0 ((SI32_USART_A_Type*)0x40000000)
212 #define SI32_USART_1 ((SI32_USART_A_Type*)0x40001000)
213 
214 // UART
215 #define SI32_UART_0 ((SI32_UART_A_Type*)0x40002000)
216 #define SI32_UART_1 ((SI32_UART_A_Type*)0x40003000)
217 
218 // SPI
219 #define SI32_SPI_0 ((SI32_SPI_A_Type*)0x40004000)
220 #define SI32_SPI_1 ((SI32_SPI_A_Type*)0x40005000)
221 #define SI32_SPI_2 ((SI32_SPI_A_Type*)0x40006000)
222 
223 // I2C
224 #define SI32_I2C_0 ((SI32_I2C_A_Type*)0x40009000)
225 #define SI32_I2C_1 ((SI32_I2C_A_Type*)0x4000A000)
226 
227 // PCAE
228 #define SI32_EPCA_0     ((SI32_EPCA_A_Type*)  0x4000E180)
229 #define SI32_EPCA_0_CH0 ((SI32_EPCACH_A_Type*)0x4000E000)
230 #define SI32_EPCA_0_CH1 ((SI32_EPCACH_A_Type*)0x4000E040)
231 #define SI32_EPCA_0_CH2 ((SI32_EPCACH_A_Type*)0x4000E080)
232 #define SI32_EPCA_0_CH3 ((SI32_EPCACH_A_Type*)0x4000E0C0)
233 #define SI32_EPCA_0_CH4 ((SI32_EPCACH_A_Type*)0x4000E100)
234 #define SI32_EPCA_0_CH5 ((SI32_EPCACH_A_Type*)0x4000E140)
235 
236 // PCA
237 #define SI32_PCA_0     ((SI32_PCA_A_Type*)  0x4000F180)
238 #define SI32_PCA_0_CH0 ((SI32_PCACH_A_Type*)0x4000F000)
239 #define SI32_PCA_0_CH1 ((SI32_PCACH_A_Type*)0x4000F040)
240 #define SI32_PCA_1     ((SI32_PCA_A_Type*)  0x40010180)
241 #define SI32_PCA_1_CH0 ((SI32_PCACH_A_Type*)0x40010000)
242 #define SI32_PCA_1_CH1 ((SI32_PCACH_A_Type*)0x40010040)
243 
244 // Timers
245 #define SI32_TIMER_0 ((SI32_TIMER_A_Type*)0x40014000)
246 #define SI32_TIMER_1 ((SI32_TIMER_A_Type*)0x40015000)
247 
248 // USB
249 #define SI32_USB_0     ((SI32_USB_A_Type*)  0x40018000)
250 #define SI32_USB_0_EP1 ((SI32_USBEP_A_Type*)0x40018880)
251 #define SI32_USB_0_EP2 ((SI32_USBEP_A_Type*)0x40018900)
252 #define SI32_USB_0_EP3 ((SI32_USBEP_A_Type*)0x40018980)
253 #define SI32_USB_0_EP4 ((SI32_USBEP_A_Type*)0x40018A00)
254 
255 // ADCs
256 #define SI32_SARADC_0 ((SI32_SARADC_A_Type*)0x4001A000)
257 #define SI32_SARADC_1 ((SI32_SARADC_A_Type*)0x4001B000)
258 
259 // SSG0
260  #define SI32_SSG_0 ((SI32_SSG_A_Type*)0x4001E000)
261 
262 // Comparator
263 #define SI32_CMP_0 ((SI32_CMP_A_Type*)0x4001F000)
264 #define SI32_CMP_1 ((SI32_CMP_A_Type*)0x40020000)
265 
266 // LDO
267 #define SI32_LDO_0 ((SI32_LDO_A_Type*)0x40039000)
268 
269 // VREF
270 #define SI32_VREF_0 ((SI32_VREF_A_Type*)0x40039010)
271 
272 // CapSense
273 #define SI32_CAPSENSE_0 ((SI32_CAPSENSE_A_Type*)0x40023000)
274 
275 // EMIF
276 #define SI32_EMIF_0     ((SI32_EMIF_A_Type*)  0x40026000)
277 #define SI32_EMIF_0_IF0 ((SI32_EMIFIF_A_Type*)0x40026080)
278 #define SI32_EMIF_0_IF1 ((SI32_EMIFIF_A_Type*)0x40026100)
279 
280 // AES
281 #define SI32_AES_0 ((SI32_AES_A_Type*)0x40027000)
282 
283 // CRC
284 #define SI32_CRC_0 ((SI32_CRC_A_Type*)0x40028000)
285 
286 // RTC and LFO
287 #define SI32_RTC_0 ((SI32_RTC_A_Type*)0x40029000)
288 
289 // Port I/O
290 #define SI32_PBCFG_0 ((SI32_PBCFG_A_Type*)0x4002A000)
291 #define SI32_PBSTD_0 ((SI32_PBSTD_A_Type*)0x4002A0A0)
292 #define SI32_PBSTD_1 ((SI32_PBSTD_A_Type*)0x4002A140)
293 #define SI32_PBSTD_2 ((SI32_PBSTD_A_Type*)0x4002A1E0)
294 #define SI32_PBSTD_3 ((SI32_PBSTD_A_Type*)0x4002A320)
295 #define SI32_PBHD_4  ((SI32_PBHD_A_Type*) 0x4002A3C0)
296 
297 // Clock Control
298 #define SI32_CLKCTRL_0 ((SI32_CLKCTRL_A_Type*)0x4002D000)
299 
300 // Reset Sources
301 #define SI32_RSTSRC_0 ((SI32_RSTSRC_A_Type*)0x4002D060)
302 
303 // Flash Interface
304 #define SI32_FLASHCTRL_0 ((SI32_FLASHCTRL_A_Type*)0x4002E000)
305 
306 // VDD Monitor
307 #define SI32_VMON_0 ((SI32_VMON_A_Type*)0x4002F000)
308 
309 // Watchdog Timer
310 #define SI32_WDTIMER_0 ((SI32_WDTIMER_A_Type*)0x40030000)
311 
312 // DACs
313 #define SI32_IDAC_0 ((SI32_IDAC_A_Type*)0x40031000)
314 #define SI32_IDAC_1 ((SI32_IDAC_A_Type*)0x40032000)
315 
316 // DMA Controller
317 #define SI32_DMACTRL_0 ((SI32_DMACTRL_A_Type*)0x40036000)
318 
319 // DMA Crossbar
320 #define SI32_DMAXBAR_0 ((SI32_DMAXBAR_A_Type*)0x40037000)
321 
322 // Low Power Timer
323 #define SI32_LPTIMER_0 ((SI32_LPTIMER_A_Type*)0x40038000)
324 
325 // Voltage Regulators
326 #define SI32_VREG_0    ((SI32_VREG_A_Type*)   0x40040000)
327 #define SI32_EXTVREG_0 ((SI32_EXTVREG_A_Type*)0x40042000)
328 
329 // I2S
330 #define SI32_I2S_0 ((SI32_I2S_A_Type*)0x4003A000)
331 
332 // PLL
333 #define SI32_PLL_0 ((SI32_PLL_A_Type*)0x4003B000)
334 
335 // IVC
336 #define SI32_IVC_0 ((SI32_IVC_A_Type*)0x40044000)
337 
338 // Oscillators
339 #define SI32_LPOSC_0  ((SI32_LPOSC_A_Type*) 0x40041000)
340 #define SI32_EXTOSC_0 ((SI32_EXTOSC_A_Type*)0x4003C000)
341 
342 // PMU
343 #define SI32_PMU_0 ((SI32_PMU_A_Type*)0x40048000)
344 
345 // Lock
346 #define SI32_LOCK_0 ((SI32_LOCK_A_Type*)0x40049000)
347 
348 // System Configuration
349 #define SI32_SCONFIG_0 ((SI32_SCONFIG_A_Type*)0x400490B0)
350 
351 // Device ID
352 #define SI32_DEVICEID_0 ((SI32_DEVICEID_A_Type*)0x400490C0)
353 
354 //-----------------------------------------------------------------------------
355 
356 #ifdef __cplusplus
357 }
358 #endif
359 
360 #endif // __SIM3U1XX_H__
361 
362 //-eof-------------------------------------------------------------------------
363 
364