source: rtos_arduino/trunk/arduino_lib/hardware/tools/CMSIS/Device/ATMEL/samd21/include/samd21g18a.h@ 136

Last change on this file since 136 was 136, checked in by ertl-honda, 8 years ago

ライブラリとOS及びベーシックなサンプルの追加.

File size: 29.2 KB
Line 
1/**
2 * \file
3 *
4 * \brief Header file for SAMD21G18A
5 *
6 * Copyright (c) 2014 Atmel Corporation. All rights reserved.
7 *
8 * \asf_license_start
9 *
10 * \page License
11 *
12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions are met:
14 *
15 * 1. Redistributions of source code must retain the above copyright notice,
16 * this list of conditions and the following disclaimer.
17 *
18 * 2. Redistributions in binary form must reproduce the above copyright notice,
19 * this list of conditions and the following disclaimer in the documentation
20 * and/or other materials provided with the distribution.
21 *
22 * 3. The name of Atmel may not be used to endorse or promote products derived
23 * from this software without specific prior written permission.
24 *
25 * 4. This software may only be redistributed and used in connection with an
26 * Atmel microcontroller product.
27 *
28 * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
29 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
30 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
31 * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
32 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
33 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
34 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
35 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
36 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
37 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
38 * POSSIBILITY OF SUCH DAMAGE.
39 *
40 * \asf_license_stop
41 *
42 */
43
44#ifndef _SAMD21G18A_
45#define _SAMD21G18A_
46
47/**
48 * \ingroup SAMD21_definitions
49 * \addtogroup SAMD21G18A_definitions SAMD21G18A definitions
50 * This file defines all structures and symbols for SAMD21G18A:
51 * - registers and bitfields
52 * - peripheral base address
53 * - peripheral ID
54 * - PIO definitions
55*/
56/*@{*/
57
58#ifdef __cplusplus
59 extern "C" {
60#endif
61
62#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
63#include <stdint.h>
64#ifndef __cplusplus
65typedef volatile const uint32_t RoReg; /**< Read only 32-bit register (volatile const unsigned int) */
66typedef volatile const uint16_t RoReg16; /**< Read only 16-bit register (volatile const unsigned int) */
67typedef volatile const uint8_t RoReg8; /**< Read only 8-bit register (volatile const unsigned int) */
68#else
69typedef volatile uint32_t RoReg; /**< Read only 32-bit register (volatile const unsigned int) */
70typedef volatile uint16_t RoReg16; /**< Read only 16-bit register (volatile const unsigned int) */
71typedef volatile uint8_t RoReg8; /**< Read only 8-bit register (volatile const unsigned int) */
72#endif
73typedef volatile uint32_t WoReg; /**< Write only 32-bit register (volatile unsigned int) */
74typedef volatile uint16_t WoReg16; /**< Write only 16-bit register (volatile unsigned int) */
75typedef volatile uint32_t WoReg8; /**< Write only 8-bit register (volatile unsigned int) */
76typedef volatile uint32_t RwReg; /**< Read-Write 32-bit register (volatile unsigned int) */
77typedef volatile uint16_t RwReg16; /**< Read-Write 16-bit register (volatile unsigned int) */
78typedef volatile uint8_t RwReg8; /**< Read-Write 8-bit register (volatile unsigned int) */
79#define CAST(type, value) ((type *)(value))
80#define REG_ACCESS(type, address) (*(type*)(address)) /**< C code: Register value */
81#else
82#define CAST(type, value) (value)
83#define REG_ACCESS(type, address) (address) /**< Assembly code: Register address */
84#endif
85
86/* ************************************************************************** */
87/** CMSIS DEFINITIONS FOR SAMD21G18A */
88/* ************************************************************************** */
89/** \defgroup SAMD21G18A_cmsis CMSIS Definitions */
90/*@{*/
91
92/** Interrupt Number Definition */
93typedef enum IRQn
94{
95 /****** Cortex-M0+ Processor Exceptions Numbers *******************************/
96 NonMaskableInt_IRQn = -14, /**< 2 Non Maskable Interrupt */
97 HardFault_IRQn = -13, /**< 3 Cortex-M0+ Hard Fault Interrupt */
98 SVCall_IRQn = -5, /**< 11 Cortex-M0+ SV Call Interrupt */
99 PendSV_IRQn = -2, /**< 14 Cortex-M0+ Pend SV Interrupt */
100 SysTick_IRQn = -1, /**< 15 Cortex-M0+ System Tick Interrupt */
101 /****** SAMD21G18A-specific Interrupt Numbers ***********************/
102 PM_IRQn = 0, /**< 0 SAMD21G18A Power Manager (PM) */
103 SYSCTRL_IRQn = 1, /**< 1 SAMD21G18A System Control (SYSCTRL) */
104 WDT_IRQn = 2, /**< 2 SAMD21G18A Watchdog Timer (WDT) */
105 RTC_IRQn = 3, /**< 3 SAMD21G18A Real-Time Counter (RTC) */
106 EIC_IRQn = 4, /**< 4 SAMD21G18A External Interrupt Controller (EIC) */
107 NVMCTRL_IRQn = 5, /**< 5 SAMD21G18A Non-Volatile Memory Controller (NVMCTRL) */
108 DMAC_IRQn = 6, /**< 6 SAMD21G18A Direct Memory Access Controller (DMAC) */
109 USB_IRQn = 7, /**< 7 SAMD21G18A Universal Serial Bus (USB) */
110 EVSYS_IRQn = 8, /**< 8 SAMD21G18A Event System Interface (EVSYS) */
111 SERCOM0_IRQn = 9, /**< 9 SAMD21G18A Serial Communication Interface 0 (SERCOM0) */
112 SERCOM1_IRQn = 10, /**< 10 SAMD21G18A Serial Communication Interface 1 (SERCOM1) */
113 SERCOM2_IRQn = 11, /**< 11 SAMD21G18A Serial Communication Interface 2 (SERCOM2) */
114 SERCOM3_IRQn = 12, /**< 12 SAMD21G18A Serial Communication Interface 3 (SERCOM3) */
115 SERCOM4_IRQn = 13, /**< 13 SAMD21G18A Serial Communication Interface 4 (SERCOM4) */
116 SERCOM5_IRQn = 14, /**< 14 SAMD21G18A Serial Communication Interface 5 (SERCOM5) */
117 TCC0_IRQn = 15, /**< 15 SAMD21G18A Timer Counter Control 0 (TCC0) */
118 TCC1_IRQn = 16, /**< 16 SAMD21G18A Timer Counter Control 1 (TCC1) */
119 TCC2_IRQn = 17, /**< 17 SAMD21G18A Timer Counter Control 2 (TCC2) */
120 TC3_IRQn = 18, /**< 18 SAMD21G18A Basic Timer Counter 3 (TC3) */
121 TC4_IRQn = 19, /**< 19 SAMD21G18A Basic Timer Counter 4 (TC4) */
122 TC5_IRQn = 20, /**< 20 SAMD21G18A Basic Timer Counter 5 (TC5) */
123 ADC_IRQn = 23, /**< 23 SAMD21G18A Analog Digital Converter (ADC) */
124 AC_IRQn = 24, /**< 24 SAMD21G18A Analog Comparators (AC) */
125 DAC_IRQn = 25, /**< 25 SAMD21G18A Digital Analog Converter (DAC) */
126 PTC_IRQn = 26, /**< 26 SAMD21G18A Peripheral Touch Controller (PTC) */
127 I2S_IRQn = 27, /**< 27 SAMD21G18A Inter-IC Sound Interface (I2S) */
128
129 PERIPH_COUNT_IRQn = 28 /**< Number of peripheral IDs */
130} IRQn_Type;
131
132typedef struct _DeviceVectors
133{
134 /* Stack pointer */
135 void* pvStack;
136
137 /* Cortex-M handlers */
138 void* pfnReset_Handler;
139 void* pfnNMI_Handler;
140 void* pfnHardFault_Handler;
141 void* pfnReservedM12;
142 void* pfnReservedM11;
143 void* pfnReservedM10;
144 void* pfnReservedM9;
145 void* pfnReservedM8;
146 void* pfnReservedM7;
147 void* pfnReservedM6;
148 void* pfnSVC_Handler;
149 void* pfnReservedM4;
150 void* pfnReservedM3;
151 void* pfnPendSV_Handler;
152 void* pfnSysTick_Handler;
153
154 /* Peripheral handlers */
155 void* pfnPM_Handler; /* 0 Power Manager */
156 void* pfnSYSCTRL_Handler; /* 1 System Control */
157 void* pfnWDT_Handler; /* 2 Watchdog Timer */
158 void* pfnRTC_Handler; /* 3 Real-Time Counter */
159 void* pfnEIC_Handler; /* 4 External Interrupt Controller */
160 void* pfnNVMCTRL_Handler; /* 5 Non-Volatile Memory Controller */
161 void* pfnDMAC_Handler; /* 6 Direct Memory Access Controller */
162 void* pfnUSB_Handler; /* 7 Universal Serial Bus */
163 void* pfnEVSYS_Handler; /* 8 Event System Interface */
164 void* pfnSERCOM0_Handler; /* 9 Serial Communication Interface 0 */
165 void* pfnSERCOM1_Handler; /* 10 Serial Communication Interface 1 */
166 void* pfnSERCOM2_Handler; /* 11 Serial Communication Interface 2 */
167 void* pfnSERCOM3_Handler; /* 12 Serial Communication Interface 3 */
168 void* pfnSERCOM4_Handler; /* 13 Serial Communication Interface 4 */
169 void* pfnSERCOM5_Handler; /* 14 Serial Communication Interface 5 */
170 void* pfnTCC0_Handler; /* 15 Timer Counter Control 0 */
171 void* pfnTCC1_Handler; /* 16 Timer Counter Control 1 */
172 void* pfnTCC2_Handler; /* 17 Timer Counter Control 2 */
173 void* pfnTC3_Handler; /* 18 Basic Timer Counter 3 */
174 void* pfnTC4_Handler; /* 19 Basic Timer Counter 4 */
175 void* pfnTC5_Handler; /* 20 Basic Timer Counter 5 */
176 void* pfnReserved21;
177 void* pfnReserved22;
178 void* pfnADC_Handler; /* 23 Analog Digital Converter */
179 void* pfnAC_Handler; /* 24 Analog Comparators */
180 void* pfnDAC_Handler; /* 25 Digital Analog Converter */
181 void* pfnPTC_Handler; /* 26 Peripheral Touch Controller */
182 void* pfnI2S_Handler; /* 27 Inter-IC Sound Interface */
183} DeviceVectors;
184
185/* Cortex-M0+ processor handlers */
186void Reset_Handler ( void );
187void NMI_Handler ( void );
188void HardFault_Handler ( void );
189void SVC_Handler ( void );
190void PendSV_Handler ( void );
191void SysTick_Handler ( void );
192
193/* Peripherals handlers */
194void PM_Handler ( void );
195void SYSCTRL_Handler ( void );
196void WDT_Handler ( void );
197void RTC_Handler ( void );
198void EIC_Handler ( void );
199void NVMCTRL_Handler ( void );
200void DMAC_Handler ( void );
201void USB_Handler ( void );
202void EVSYS_Handler ( void );
203void SERCOM0_Handler ( void );
204void SERCOM1_Handler ( void );
205void SERCOM2_Handler ( void );
206void SERCOM3_Handler ( void );
207void SERCOM4_Handler ( void );
208void SERCOM5_Handler ( void );
209void TCC0_Handler ( void );
210void TCC1_Handler ( void );
211void TCC2_Handler ( void );
212void TC3_Handler ( void );
213void TC4_Handler ( void );
214void TC5_Handler ( void );
215void ADC_Handler ( void );
216void AC_Handler ( void );
217void DAC_Handler ( void );
218void PTC_Handler ( void );
219void I2S_Handler ( void );
220
221/*
222 * \brief Configuration of the Cortex-M0+ Processor and Core Peripherals
223 */
224
225#define LITTLE_ENDIAN 1
226#define __CM0PLUS_REV 1 /*!< Core revision r0p1 */
227#define __MPU_PRESENT 0 /*!< MPU present or not */
228#define __NVIC_PRIO_BITS 2 /*!< Number of bits used for Priority Levels */
229#define __VTOR_PRESENT 1 /*!< VTOR present or not */
230#define __Vendor_SysTickConfig 0 /*!< Set to 1 if different SysTick Config is used */
231
232/**
233 * \brief CMSIS includes
234 */
235
236#include <core_cm0plus.h>
237#if !defined DONT_USE_CMSIS_INIT
238#include "system_samd21.h"
239#endif /* DONT_USE_CMSIS_INIT */
240
241/*@}*/
242
243/* ************************************************************************** */
244/** SOFTWARE PERIPHERAL API DEFINITION FOR SAMD21G18A */
245/* ************************************************************************** */
246/** \defgroup SAMD21G18A_api Peripheral Software API */
247/*@{*/
248
249#include "component/ac.h"
250#include "component/adc.h"
251#include "component/dac.h"
252#include "component/dmac.h"
253#include "component/dsu.h"
254#include "component/eic.h"
255#include "component/evsys.h"
256#include "component/gclk.h"
257#include "component/i2s.h"
258#include "component/mtb.h"
259#include "component/nvmctrl.h"
260#include "component/pac.h"
261#include "component/pm.h"
262#include "component/port.h"
263#include "component/rtc.h"
264#include "component/sercom.h"
265#include "component/sysctrl.h"
266#include "component/tc.h"
267#include "component/tcc.h"
268#include "component/usb.h"
269#include "component/wdt.h"
270/*@}*/
271
272/* ************************************************************************** */
273/** REGISTERS ACCESS DEFINITIONS FOR SAMD21G18A */
274/* ************************************************************************** */
275/** \defgroup SAMD21G18A_reg Registers Access Definitions */
276/*@{*/
277
278#include "instance/ac.h"
279#include "instance/adc.h"
280#include "instance/dac.h"
281#include "instance/dmac.h"
282#include "instance/dsu.h"
283#include "instance/eic.h"
284#include "instance/evsys.h"
285#include "instance/gclk.h"
286#include "instance/i2s.h"
287#include "instance/mtb.h"
288#include "instance/nvmctrl.h"
289#include "instance/pac0.h"
290#include "instance/pac1.h"
291#include "instance/pac2.h"
292#include "instance/pm.h"
293#include "instance/port.h"
294#include "instance/rtc.h"
295#include "instance/sercom0.h"
296#include "instance/sercom1.h"
297#include "instance/sercom2.h"
298#include "instance/sercom3.h"
299#include "instance/sercom4.h"
300#include "instance/sercom5.h"
301#include "instance/sysctrl.h"
302#include "instance/tc3.h"
303#include "instance/tc4.h"
304#include "instance/tc5.h"
305#include "instance/tcc0.h"
306#include "instance/tcc1.h"
307#include "instance/tcc2.h"
308#include "instance/usb.h"
309#include "instance/wdt.h"
310/*@}*/
311
312/* ************************************************************************** */
313/** PERIPHERAL ID DEFINITIONS FOR SAMD21G18A */
314/* ************************************************************************** */
315/** \defgroup SAMD21G18A_id Peripheral Ids Definitions */
316/*@{*/
317
318// Peripheral instances on HPB0 bridge
319#define ID_PAC0 0 /**< \brief Peripheral Access Controller PAC (PAC0) */
320#define ID_PM 1 /**< \brief Power Manager (PM) */
321#define ID_SYSCTRL 2 /**< \brief System Control (SYSCTRL) */
322#define ID_GCLK 3 /**< \brief Generic Clock Generator (GCLK) */
323#define ID_WDT 4 /**< \brief Watchdog Timer (WDT) */
324#define ID_RTC 5 /**< \brief Real-Time Counter (RTC) */
325#define ID_EIC 6 /**< \brief External Interrupt Controller (EIC) */
326
327// Peripheral instances on HPB1 bridge
328#define ID_PAC1 32 /**< \brief Peripheral Access Controller PAC (PAC1) */
329#define ID_DSU 33 /**< \brief Device Service Unit (DSU) */
330#define ID_NVMCTRL 34 /**< \brief Non-Volatile Memory Controller (NVMCTRL) */
331#define ID_PORT 35 /**< \brief Port Module (PORT) */
332#define ID_DMAC 36 /**< \brief Direct Memory Access Controller (DMAC) */
333#define ID_USB 37 /**< \brief Universal Serial Bus (USB) */
334#define ID_MTB 38 /**< \brief Cortex-M0+ Micro-Trace Buffer (MTB) */
335
336// Peripheral instances on HPB2 bridge
337#define ID_PAC2 64 /**< \brief Peripheral Access Controller PAC (PAC2) */
338#define ID_EVSYS 65 /**< \brief Event System Interface (EVSYS) */
339#define ID_SERCOM0 66 /**< \brief Serial Communication Interface SERCOM (SERCOM0) */
340#define ID_SERCOM1 67 /**< \brief Serial Communication Interface SERCOM (SERCOM1) */
341#define ID_SERCOM2 68 /**< \brief Serial Communication Interface SERCOM (SERCOM2) */
342#define ID_SERCOM3 69 /**< \brief Serial Communication Interface SERCOM (SERCOM3) */
343#define ID_SERCOM4 70 /**< \brief Serial Communication Interface SERCOM (SERCOM4) */
344#define ID_SERCOM5 71 /**< \brief Serial Communication Interface SERCOM (SERCOM5) */
345#define ID_TCC0 72 /**< \brief Timer Counter Control TCC (TCC0) */
346#define ID_TCC1 73 /**< \brief Timer Counter Control TCC (TCC1) */
347#define ID_TCC2 74 /**< \brief Timer Counter Control TCC (TCC2) */
348#define ID_TC3 75 /**< \brief Basic Timer Counter TC (TC3) */
349#define ID_TC4 76 /**< \brief Basic Timer Counter TC (TC4) */
350#define ID_TC5 77 /**< \brief Basic Timer Counter TC (TC5) */
351#define ID_ADC 80 /**< \brief Analog Digital Converter (ADC) */
352#define ID_AC 81 /**< \brief Analog Comparators (AC) */
353#define ID_DAC 82 /**< \brief Digital Analog Converter (DAC) */
354#define ID_PTC 83 /**< \brief Peripheral Touch Controller (PTC) */
355#define ID_I2S 84 /**< \brief Inter-IC Sound Interface (I2S) */
356
357#define ID_PERIPH_COUNT 85 /**< \brief Number of peripheral IDs */
358/*@}*/
359
360/* ************************************************************************** */
361/** BASE ADDRESS DEFINITIONS FOR SAMD21G18A */
362/* ************************************************************************** */
363/** \defgroup SAMD21G18A_base Peripheral Base Address Definitions */
364/*@{*/
365
366#if defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)
367#define AC (0x42004400U) /**< \brief (AC) APB Base Address */
368#define ADC (0x42004000U) /**< \brief (ADC) APB Base Address */
369#define DAC (0x42004800U) /**< \brief (DAC) APB Base Address */
370#define DMAC (0x41004800U) /**< \brief (DMAC) APB Base Address */
371#define DSU (0x41002000U) /**< \brief (DSU) APB Base Address */
372#define EIC (0x40001800U) /**< \brief (EIC) APB Base Address */
373#define EVSYS (0x42000400U) /**< \brief (EVSYS) APB Base Address */
374#define GCLK (0x40000C00U) /**< \brief (GCLK) APB Base Address */
375#define I2S (0x42005000U) /**< \brief (I2S) APB Base Address */
376#define MTB (0x41006000U) /**< \brief (MTB) APB Base Address */
377#define NVMCTRL (0x41004000U) /**< \brief (NVMCTRL) APB Base Address */
378#define NVMCTRL_CAL (0x00800000U) /**< \brief (NVMCTRL) CAL Base Address */
379#define NVMCTRL_LOCKBIT (0x00802000U) /**< \brief (NVMCTRL) LOCKBIT Base Address */
380#define NVMCTRL_OTP1 (0x00806000U) /**< \brief (NVMCTRL) OTP1 Base Address */
381#define NVMCTRL_OTP2 (0x00806008U) /**< \brief (NVMCTRL) OTP2 Base Address */
382#define NVMCTRL_OTP4 (0x00806020U) /**< \brief (NVMCTRL) OTP4 Base Address */
383#define NVMCTRL_TEMP_LOG (0x00806030U) /**< \brief (NVMCTRL) TEMP_LOG Base Address */
384#define NVMCTRL_USER (0x00804000U) /**< \brief (NVMCTRL) USER Base Address */
385#define PAC0 (0x40000000U) /**< \brief (PAC0) APB Base Address */
386#define PAC1 (0x41000000U) /**< \brief (PAC1) APB Base Address */
387#define PAC2 (0x42000000U) /**< \brief (PAC2) APB Base Address */
388#define PM (0x40000400U) /**< \brief (PM) APB Base Address */
389#define PORT (0x41004400U) /**< \brief (PORT) APB Base Address */
390#define PORT_IOBUS (0x60000000U) /**< \brief (PORT) IOBUS Base Address */
391#define RTC (0x40001400U) /**< \brief (RTC) APB Base Address */
392#define SERCOM0 (0x42000800U) /**< \brief (SERCOM0) APB Base Address */
393#define SERCOM1 (0x42000C00U) /**< \brief (SERCOM1) APB Base Address */
394#define SERCOM2 (0x42001000U) /**< \brief (SERCOM2) APB Base Address */
395#define SERCOM3 (0x42001400U) /**< \brief (SERCOM3) APB Base Address */
396#define SERCOM4 (0x42001800U) /**< \brief (SERCOM4) APB Base Address */
397#define SERCOM5 (0x42001C00U) /**< \brief (SERCOM5) APB Base Address */
398#define SYSCTRL (0x40000800U) /**< \brief (SYSCTRL) APB Base Address */
399#define TC3 (0x42002C00U) /**< \brief (TC3) APB Base Address */
400#define TC4 (0x42003000U) /**< \brief (TC4) APB Base Address */
401#define TC5 (0x42003400U) /**< \brief (TC5) APB Base Address */
402#define TCC0 (0x42002000U) /**< \brief (TCC0) APB Base Address */
403#define TCC1 (0x42002400U) /**< \brief (TCC1) APB Base Address */
404#define TCC2 (0x42002800U) /**< \brief (TCC2) APB Base Address */
405#define USB (0x41005000U) /**< \brief (USB) APB Base Address */
406#define WDT (0x40001000U) /**< \brief (WDT) APB Base Address */
407#else
408#define AC ((Ac *)0x42004400U) /**< \brief (AC) APB Base Address */
409#define AC_INST_NUM 1 /**< \brief (AC) Number of instances */
410#define AC_INSTS { AC } /**< \brief (AC) Instances List */
411
412#define ADC ((Adc *)0x42004000U) /**< \brief (ADC) APB Base Address */
413#define ADC_INST_NUM 1 /**< \brief (ADC) Number of instances */
414#define ADC_INSTS { ADC } /**< \brief (ADC) Instances List */
415
416#define DAC ((Dac *)0x42004800U) /**< \brief (DAC) APB Base Address */
417#define DAC_INST_NUM 1 /**< \brief (DAC) Number of instances */
418#define DAC_INSTS { DAC } /**< \brief (DAC) Instances List */
419
420#define DMAC ((Dmac *)0x41004800U) /**< \brief (DMAC) APB Base Address */
421#define DMAC_INST_NUM 1 /**< \brief (DMAC) Number of instances */
422#define DMAC_INSTS { DMAC } /**< \brief (DMAC) Instances List */
423
424#define DSU ((Dsu *)0x41002000U) /**< \brief (DSU) APB Base Address */
425#define DSU_INST_NUM 1 /**< \brief (DSU) Number of instances */
426#define DSU_INSTS { DSU } /**< \brief (DSU) Instances List */
427
428#define EIC ((Eic *)0x40001800U) /**< \brief (EIC) APB Base Address */
429#define EIC_INST_NUM 1 /**< \brief (EIC) Number of instances */
430#define EIC_INSTS { EIC } /**< \brief (EIC) Instances List */
431
432#define EVSYS ((Evsys *)0x42000400U) /**< \brief (EVSYS) APB Base Address */
433#define EVSYS_INST_NUM 1 /**< \brief (EVSYS) Number of instances */
434#define EVSYS_INSTS { EVSYS } /**< \brief (EVSYS) Instances List */
435
436#define GCLK ((Gclk *)0x40000C00U) /**< \brief (GCLK) APB Base Address */
437#define GCLK_INST_NUM 1 /**< \brief (GCLK) Number of instances */
438#define GCLK_INSTS { GCLK } /**< \brief (GCLK) Instances List */
439
440#define I2S ((I2s *)0x42005000U) /**< \brief (I2S) APB Base Address */
441#define I2S_INST_NUM 1 /**< \brief (I2S) Number of instances */
442#define I2S_INSTS { I2S } /**< \brief (I2S) Instances List */
443
444#define MTB ((Mtb *)0x41006000U) /**< \brief (MTB) APB Base Address */
445#define MTB_INST_NUM 1 /**< \brief (MTB) Number of instances */
446#define MTB_INSTS { MTB } /**< \brief (MTB) Instances List */
447
448#define NVMCTRL ((Nvmctrl *)0x41004000U) /**< \brief (NVMCTRL) APB Base Address */
449#define NVMCTRL_CAL (0x00800000U) /**< \brief (NVMCTRL) CAL Base Address */
450#define NVMCTRL_LOCKBIT (0x00802000U) /**< \brief (NVMCTRL) LOCKBIT Base Address */
451#define NVMCTRL_OTP1 (0x00806000U) /**< \brief (NVMCTRL) OTP1 Base Address */
452#define NVMCTRL_OTP2 (0x00806008U) /**< \brief (NVMCTRL) OTP2 Base Address */
453#define NVMCTRL_OTP4 (0x00806020U) /**< \brief (NVMCTRL) OTP4 Base Address */
454#define NVMCTRL_TEMP_LOG (0x00806030U) /**< \brief (NVMCTRL) TEMP_LOG Base Address */
455#define NVMCTRL_USER (0x00804000U) /**< \brief (NVMCTRL) USER Base Address */
456#define NVMCTRL_INST_NUM 1 /**< \brief (NVMCTRL) Number of instances */
457#define NVMCTRL_INSTS { NVMCTRL } /**< \brief (NVMCTRL) Instances List */
458
459#define PAC0 ((Pac *)0x40000000U) /**< \brief (PAC0) APB Base Address */
460#define PAC1 ((Pac *)0x41000000U) /**< \brief (PAC1) APB Base Address */
461#define PAC2 ((Pac *)0x42000000U) /**< \brief (PAC2) APB Base Address */
462#define PAC_INST_NUM 3 /**< \brief (PAC) Number of instances */
463#define PAC_INSTS { PAC0, PAC1, PAC2 } /**< \brief (PAC) Instances List */
464
465#define PM ((Pm *)0x40000400U) /**< \brief (PM) APB Base Address */
466#define PM_INST_NUM 1 /**< \brief (PM) Number of instances */
467#define PM_INSTS { PM } /**< \brief (PM) Instances List */
468
469#define PORT ((Port *)0x41004400U) /**< \brief (PORT) APB Base Address */
470#define PORT_IOBUS ((Port *)0x60000000U) /**< \brief (PORT) IOBUS Base Address */
471#define PORT_INST_NUM 1 /**< \brief (PORT) Number of instances */
472#define PORT_INSTS { PORT } /**< \brief (PORT) Instances List */
473
474#define PTC_GCLK_ID 34
475#define PTC_INST_NUM 1 /**< \brief (PTC) Number of instances */
476#define PTC_INSTS { PTC } /**< \brief (PTC) Instances List */
477
478#define RTC ((Rtc *)0x40001400U) /**< \brief (RTC) APB Base Address */
479#define RTC_INST_NUM 1 /**< \brief (RTC) Number of instances */
480#define RTC_INSTS { RTC } /**< \brief (RTC) Instances List */
481
482#define SERCOM0 ((Sercom *)0x42000800U) /**< \brief (SERCOM0) APB Base Address */
483#define SERCOM1 ((Sercom *)0x42000C00U) /**< \brief (SERCOM1) APB Base Address */
484#define SERCOM2 ((Sercom *)0x42001000U) /**< \brief (SERCOM2) APB Base Address */
485#define SERCOM3 ((Sercom *)0x42001400U) /**< \brief (SERCOM3) APB Base Address */
486#define SERCOM4 ((Sercom *)0x42001800U) /**< \brief (SERCOM4) APB Base Address */
487#define SERCOM5 ((Sercom *)0x42001C00U) /**< \brief (SERCOM5) APB Base Address */
488#define SERCOM_INST_NUM 6 /**< \brief (SERCOM) Number of instances */
489#define SERCOM_INSTS { SERCOM0, SERCOM1, SERCOM2, SERCOM3, SERCOM4, SERCOM5 } /**< \brief (SERCOM) Instances List */
490
491#define SYSCTRL ((Sysctrl *)0x40000800U) /**< \brief (SYSCTRL) APB Base Address */
492#define SYSCTRL_INST_NUM 1 /**< \brief (SYSCTRL) Number of instances */
493#define SYSCTRL_INSTS { SYSCTRL } /**< \brief (SYSCTRL) Instances List */
494
495#define TC3 ((Tc *)0x42002C00U) /**< \brief (TC3) APB Base Address */
496#define TC4 ((Tc *)0x42003000U) /**< \brief (TC4) APB Base Address */
497#define TC5 ((Tc *)0x42003400U) /**< \brief (TC5) APB Base Address */
498#define TC_INST_NUM 3 /**< \brief (TC) Number of instances */
499#define TC_INSTS { TC3, TC4, TC5 } /**< \brief (TC) Instances List */
500
501#define TCC0 ((Tcc *)0x42002000U) /**< \brief (TCC0) APB Base Address */
502#define TCC1 ((Tcc *)0x42002400U) /**< \brief (TCC1) APB Base Address */
503#define TCC2 ((Tcc *)0x42002800U) /**< \brief (TCC2) APB Base Address */
504#define TCC_INST_NUM 3 /**< \brief (TCC) Number of instances */
505#define TCC_INSTS { TCC0, TCC1, TCC2 } /**< \brief (TCC) Instances List */
506
507#define USB ((Usb *)0x41005000U) /**< \brief (USB) APB Base Address */
508#define USB_INST_NUM 1 /**< \brief (USB) Number of instances */
509#define USB_INSTS { USB } /**< \brief (USB) Instances List */
510
511#define WDT ((Wdt *)0x40001000U) /**< \brief (WDT) APB Base Address */
512#define WDT_INST_NUM 1 /**< \brief (WDT) Number of instances */
513#define WDT_INSTS { WDT } /**< \brief (WDT) Instances List */
514
515#endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
516/*@}*/
517
518/* ************************************************************************** */
519/** PORT DEFINITIONS FOR SAMD21G18A */
520/* ************************************************************************** */
521/** \defgroup SAMD21G18A_port PORT Definitions */
522/*@{*/
523
524#include "pio/samd21g18a.h"
525/*@}*/
526
527/* ************************************************************************** */
528/** MEMORY MAPPING DEFINITIONS FOR SAMD21G18A */
529/* ************************************************************************** */
530
531#define FLASH_SIZE 0x40000 /* 256 kB */
532#define FLASH_PAGE_SIZE 64
533#define FLASH_NB_OF_PAGES 4096
534#define FLASH_USER_PAGE_SIZE 64
535#define HMCRAMC0_SIZE 0x8000 /* 32 kB */
536#define FLASH_ADDR (0x00000000U) /**< FLASH base address */
537#define FLASH_USER_PAGE_ADDR (0x00800000U) /**< FLASH_USER_PAGE base address */
538#define HMCRAMC0_ADDR (0x20000000U) /**< HMCRAMC0 base address */
539
540#define DSU_DID_RESETVALUE 0x10010005
541#define PORT_GROUPS 2
542
543/* ************************************************************************** */
544/** ELECTRICAL DEFINITIONS FOR SAMD21G18A */
545/* ************************************************************************** */
546
547
548#ifdef __cplusplus
549}
550#endif
551
552/*@}*/
553
554#endif /* SAMD21G18A_H */
Note: See TracBrowser for help on using the repository browser.