mbed library sources

Dependents:   Encrypted my_mbed lklk CyaSSL_DTLS_Cellular ... more

Superseded

This library was superseded by mbed-dev - https://os.mbed.com/users/mbed_official/code/mbed-dev/.

Development branch of the mbed library sources. This library is kept in synch with the latest changes from the mbed SDK and it is not guaranteed to work.

If you are looking for a stable and tested release, please import one of the official mbed library releases:

Import librarymbed

The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

Committer:
mbed_official
Date:
Wed Jul 01 09:45:11 2015 +0100
Revision:
579:53297373a894
Child:
592:a274ee790e56
Synchronized with git revision d5b4d2ab9c47edb4dc5776e7177b0c2263459081

Full URL: https://github.com/mbedmicro/mbed/commit/d5b4d2ab9c47edb4dc5776e7177b0c2263459081/

Initial version of drivers for SAMR21

Who changed what in which revision?

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