samd21e15l.h 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533
  1. /**
  2. * \file
  3. *
  4. * \brief Header file for SAMD21E15L
  5. *
  6. * Copyright (c) 2014-2015 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. #ifndef _SAMD21E15L_
  44. #define _SAMD21E15L_
  45. /**
  46. * \ingroup SAMD21_definitions
  47. * \addtogroup SAMD21E15L_definitions SAMD21E15L definitions
  48. * This file defines all structures and symbols for SAMD21E15L:
  49. * - registers and bitfields
  50. * - peripheral base address
  51. * - peripheral ID
  52. * - PIO definitions
  53. */
  54. /*@{*/
  55. #ifdef __cplusplus
  56. extern "C" {
  57. #endif
  58. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  59. #include <stdint.h>
  60. #ifndef __cplusplus
  61. typedef volatile const uint32_t RoReg; /**< Read only 32-bit register (volatile const unsigned int) */
  62. typedef volatile const uint16_t RoReg16; /**< Read only 16-bit register (volatile const unsigned int) */
  63. typedef volatile const uint8_t RoReg8; /**< Read only 8-bit register (volatile const unsigned int) */
  64. #else
  65. typedef volatile uint32_t RoReg; /**< Read only 32-bit register (volatile const unsigned int) */
  66. typedef volatile uint16_t RoReg16; /**< Read only 16-bit register (volatile const unsigned int) */
  67. typedef volatile uint8_t RoReg8; /**< Read only 8-bit register (volatile const unsigned int) */
  68. #endif
  69. typedef volatile uint32_t WoReg; /**< Write only 32-bit register (volatile unsigned int) */
  70. typedef volatile uint16_t WoReg16; /**< Write only 16-bit register (volatile unsigned int) */
  71. typedef volatile uint32_t WoReg8; /**< Write only 8-bit register (volatile unsigned int) */
  72. typedef volatile uint32_t RwReg; /**< Read-Write 32-bit register (volatile unsigned int) */
  73. typedef volatile uint16_t RwReg16; /**< Read-Write 16-bit register (volatile unsigned int) */
  74. typedef volatile uint8_t RwReg8; /**< Read-Write 8-bit register (volatile unsigned int) */
  75. #define CAST(type, value) ((type *)(value))
  76. #define REG_ACCESS(type, address) (*(type*)(address)) /**< C code: Register value */
  77. #else
  78. #define CAST(type, value) (value)
  79. #define REG_ACCESS(type, address) (address) /**< Assembly code: Register address */
  80. #endif
  81. /* ************************************************************************** */
  82. /** CMSIS DEFINITIONS FOR SAMD21E15L */
  83. /* ************************************************************************** */
  84. /** \defgroup SAMD21E15L_cmsis CMSIS Definitions */
  85. /*@{*/
  86. /** Interrupt Number Definition */
  87. typedef enum IRQn
  88. {
  89. /****** Cortex-M0+ Processor Exceptions Numbers ******************************/
  90. NonMaskableInt_IRQn = -14,/**< 2 Non Maskable Interrupt */
  91. HardFault_IRQn = -13,/**< 3 Cortex-M0+ Hard Fault Interrupt */
  92. SVCall_IRQn = -5, /**< 11 Cortex-M0+ SV Call Interrupt */
  93. PendSV_IRQn = -2, /**< 14 Cortex-M0+ Pend SV Interrupt */
  94. SysTick_IRQn = -1, /**< 15 Cortex-M0+ System Tick Interrupt */
  95. /****** SAMD21E15L-specific Interrupt Numbers ***********************/
  96. PM_IRQn = 0, /**< 0 SAMD21E15L Power Manager (PM) */
  97. SYSCTRL_IRQn = 1, /**< 1 SAMD21E15L System Control (SYSCTRL) */
  98. WDT_IRQn = 2, /**< 2 SAMD21E15L Watchdog Timer (WDT) */
  99. RTC_IRQn = 3, /**< 3 SAMD21E15L Real-Time Counter (RTC) */
  100. EIC_IRQn = 4, /**< 4 SAMD21E15L External Interrupt Controller (EIC) */
  101. NVMCTRL_IRQn = 5, /**< 5 SAMD21E15L Non-Volatile Memory Controller (NVMCTRL) */
  102. DMAC_IRQn = 6, /**< 6 SAMD21E15L Direct Memory Access Controller (DMAC) */
  103. EVSYS_IRQn = 8, /**< 8 SAMD21E15L Event System Interface (EVSYS) */
  104. SERCOM0_IRQn = 9, /**< 9 SAMD21E15L Serial Communication Interface 0 (SERCOM0) */
  105. SERCOM1_IRQn = 10, /**< 10 SAMD21E15L Serial Communication Interface 1 (SERCOM1) */
  106. SERCOM2_IRQn = 11, /**< 11 SAMD21E15L Serial Communication Interface 2 (SERCOM2) */
  107. SERCOM3_IRQn = 12, /**< 12 SAMD21E15L Serial Communication Interface 3 (SERCOM3) */
  108. TCC0_IRQn = 15, /**< 15 SAMD21E15L Timer Counter Control 0 (TCC0) */
  109. TCC1_IRQn = 16, /**< 16 SAMD21E15L Timer Counter Control 1 (TCC1) */
  110. TCC2_IRQn = 17, /**< 17 SAMD21E15L Timer Counter Control 2 (TCC2) */
  111. TC3_IRQn = 18, /**< 18 SAMD21E15L Basic Timer Counter 3 (TC3) */
  112. TC4_IRQn = 19, /**< 19 SAMD21E15L Basic Timer Counter 4 (TC4) */
  113. TC5_IRQn = 20, /**< 20 SAMD21E15L Basic Timer Counter 5 (TC5) */
  114. ADC_IRQn = 23, /**< 23 SAMD21E15L Analog Digital Converter (ADC) */
  115. AC_IRQn = 24, /**< 24 SAMD21E15L Analog Comparators (AC) */
  116. DAC_IRQn = 25, /**< 25 SAMD21E15L Digital Analog Converter (DAC) */
  117. AC1_IRQn = 28, /**< 28 SAMD21E15L Analog Comparators 1 (AC1) */
  118. PERIPH_COUNT_IRQn = 29 /**< Number of peripheral IDs */
  119. } IRQn_Type;
  120. typedef struct _DeviceVectors
  121. {
  122. /* Stack pointer */
  123. void* pvStack;
  124. /* Cortex-M handlers */
  125. void* pfnReset_Handler;
  126. void* pfnNMI_Handler;
  127. void* pfnHardFault_Handler;
  128. void* pfnReservedM12;
  129. void* pfnReservedM11;
  130. void* pfnReservedM10;
  131. void* pfnReservedM9;
  132. void* pfnReservedM8;
  133. void* pfnReservedM7;
  134. void* pfnReservedM6;
  135. void* pfnSVC_Handler;
  136. void* pfnReservedM4;
  137. void* pfnReservedM3;
  138. void* pfnPendSV_Handler;
  139. void* pfnSysTick_Handler;
  140. /* Peripheral handlers */
  141. void* pfnPM_Handler; /* 0 Power Manager */
  142. void* pfnSYSCTRL_Handler; /* 1 System Control */
  143. void* pfnWDT_Handler; /* 2 Watchdog Timer */
  144. void* pfnRTC_Handler; /* 3 Real-Time Counter */
  145. void* pfnEIC_Handler; /* 4 External Interrupt Controller */
  146. void* pfnNVMCTRL_Handler; /* 5 Non-Volatile Memory Controller */
  147. void* pfnDMAC_Handler; /* 6 Direct Memory Access Controller */
  148. void* pfnReserved7;
  149. void* pfnEVSYS_Handler; /* 8 Event System Interface */
  150. void* pfnSERCOM0_Handler; /* 9 Serial Communication Interface 0 */
  151. void* pfnSERCOM1_Handler; /* 10 Serial Communication Interface 1 */
  152. void* pfnSERCOM2_Handler; /* 11 Serial Communication Interface 2 */
  153. void* pfnSERCOM3_Handler; /* 12 Serial Communication Interface 3 */
  154. void* pfnReserved13;
  155. void* pfnReserved14;
  156. void* pfnTCC0_Handler; /* 15 Timer Counter Control 0 */
  157. void* pfnTCC1_Handler; /* 16 Timer Counter Control 1 */
  158. void* pfnTCC2_Handler; /* 17 Timer Counter Control 2 */
  159. void* pfnTC3_Handler; /* 18 Basic Timer Counter 3 */
  160. void* pfnTC4_Handler; /* 19 Basic Timer Counter 4 */
  161. void* pfnTC5_Handler; /* 20 Basic Timer Counter 5 */
  162. void* pfnReserved21;
  163. void* pfnReserved22;
  164. void* pfnADC_Handler; /* 23 Analog Digital Converter */
  165. void* pfnAC_Handler; /* 24 Analog Comparators */
  166. void* pfnDAC_Handler; /* 25 Digital Analog Converter */
  167. void* pfnReserved26;
  168. void* pfnReserved27;
  169. void* pfnAC1_Handler; /* 28 Analog Comparators 1 */
  170. } DeviceVectors;
  171. /* Cortex-M0+ processor handlers */
  172. void Reset_Handler ( void );
  173. void NMI_Handler ( void );
  174. void HardFault_Handler ( void );
  175. void SVC_Handler ( void );
  176. void PendSV_Handler ( void );
  177. void SysTick_Handler ( void );
  178. /* Peripherals handlers */
  179. void PM_Handler ( void );
  180. void SYSCTRL_Handler ( void );
  181. void WDT_Handler ( void );
  182. void RTC_Handler ( void );
  183. void EIC_Handler ( void );
  184. void NVMCTRL_Handler ( void );
  185. void DMAC_Handler ( void );
  186. void EVSYS_Handler ( void );
  187. void SERCOM0_Handler ( void );
  188. void SERCOM1_Handler ( void );
  189. void SERCOM2_Handler ( void );
  190. void SERCOM3_Handler ( void );
  191. void TCC0_Handler ( void );
  192. void TCC1_Handler ( void );
  193. void TCC2_Handler ( void );
  194. void TC3_Handler ( void );
  195. void TC4_Handler ( void );
  196. void TC5_Handler ( void );
  197. void ADC_Handler ( void );
  198. void AC_Handler ( void );
  199. void DAC_Handler ( void );
  200. void AC1_Handler ( void );
  201. /*
  202. * \brief Configuration of the Cortex-M0+ Processor and Core Peripherals
  203. */
  204. #define LITTLE_ENDIAN 1
  205. #define __CM0PLUS_REV 1 /*!< Core revision r0p1 */
  206. #define __MPU_PRESENT 0 /*!< MPU present or not */
  207. #define __NVIC_PRIO_BITS 2 /*!< Number of bits used for Priority Levels */
  208. #define __VTOR_PRESENT 1 /*!< VTOR present or not */
  209. #define __Vendor_SysTickConfig 0 /*!< Set to 1 if different SysTick Config is used */
  210. /**
  211. * \brief CMSIS includes
  212. */
  213. #include <core_cm0plus.h>
  214. #if !defined DONT_USE_CMSIS_INIT
  215. #include "system_samd21.h"
  216. #endif /* DONT_USE_CMSIS_INIT */
  217. /*@}*/
  218. /* ************************************************************************** */
  219. /** SOFTWARE PERIPHERAL API DEFINITION FOR SAMD21E15L */
  220. /* ************************************************************************** */
  221. /** \defgroup SAMD21E15L_api Peripheral Software API */
  222. /*@{*/
  223. #include "component/ac.h"
  224. #include "component/adc.h"
  225. #include "component/dac.h"
  226. #include "component/dmac.h"
  227. #include "component/dsu.h"
  228. #include "component/eic.h"
  229. #include "component/evsys.h"
  230. #include "component/gclk.h"
  231. #include "component/hmatrixb.h"
  232. #include "component/mtb.h"
  233. #include "component/nvmctrl.h"
  234. #include "component/pac.h"
  235. #include "component/pm.h"
  236. #include "component/port.h"
  237. #include "component/rtc.h"
  238. #include "component/sercom.h"
  239. #include "component/sysctrl.h"
  240. #include "component/tc.h"
  241. #include "component/tcc_lighting.h"
  242. #include "component/wdt.h"
  243. /*@}*/
  244. /* ************************************************************************** */
  245. /** REGISTERS ACCESS DEFINITIONS FOR SAMD21E15L */
  246. /* ************************************************************************** */
  247. /** \defgroup SAMD21E15L_reg Registers Access Definitions */
  248. /*@{*/
  249. #include "instance/ac.h"
  250. #include "instance/ac1.h"
  251. #include "instance/adc.h"
  252. #include "instance/dac.h"
  253. #include "instance/dmac.h"
  254. #include "instance/dsu.h"
  255. #include "instance/eic.h"
  256. #include "instance/evsys.h"
  257. #include "instance/gclk.h"
  258. #include "instance/sbmatrix.h"
  259. #include "instance/mtb.h"
  260. #include "instance/nvmctrl.h"
  261. #include "instance/pac0.h"
  262. #include "instance/pac1.h"
  263. #include "instance/pac2.h"
  264. #include "instance/pm.h"
  265. #include "instance/port.h"
  266. #include "instance/rtc.h"
  267. #include "instance/sercom0.h"
  268. #include "instance/sercom1.h"
  269. #include "instance/sercom2.h"
  270. #include "instance/sercom3.h"
  271. #include "instance/sysctrl.h"
  272. #include "instance/tc3.h"
  273. #include "instance/tc4.h"
  274. #include "instance/tc5.h"
  275. #include "instance/tcc0.h"
  276. #include "instance/tcc1.h"
  277. #include "instance/tcc2.h"
  278. #include "instance/wdt.h"
  279. /*@}*/
  280. /* ************************************************************************** */
  281. /** PERIPHERAL ID DEFINITIONS FOR SAMD21E15L */
  282. /* ************************************************************************** */
  283. /** \defgroup SAMD21E15L_id Peripheral Ids Definitions */
  284. /*@{*/
  285. // Peripheral instances on HPB0 bridge
  286. #define ID_PAC0 0 /**< \brief Peripheral Access Controller 0 (PAC0) */
  287. #define ID_PM 1 /**< \brief Power Manager (PM) */
  288. #define ID_SYSCTRL 2 /**< \brief System Control (SYSCTRL) */
  289. #define ID_GCLK 3 /**< \brief Generic Clock Generator (GCLK) */
  290. #define ID_WDT 4 /**< \brief Watchdog Timer (WDT) */
  291. #define ID_RTC 5 /**< \brief Real-Time Counter (RTC) */
  292. #define ID_EIC 6 /**< \brief External Interrupt Controller (EIC) */
  293. // Peripheral instances on HPB1 bridge
  294. #define ID_PAC1 32 /**< \brief Peripheral Access Controller 1 (PAC1) */
  295. #define ID_DSU 33 /**< \brief Device Service Unit (DSU) */
  296. #define ID_NVMCTRL 34 /**< \brief Non-Volatile Memory Controller (NVMCTRL) */
  297. #define ID_PORT 35 /**< \brief Port Module (PORT) */
  298. #define ID_DMAC 36 /**< \brief Direct Memory Access Controller (DMAC) */
  299. #define ID_MTB 38 /**< \brief Cortex-M0+ Micro-Trace Buffer (MTB) */
  300. #define ID_SBMATRIX 39 /**< \brief HSB Matrix (SBMATRIX) */
  301. // Peripheral instances on HPB2 bridge
  302. #define ID_PAC2 64 /**< \brief Peripheral Access Controller 2 (PAC2) */
  303. #define ID_EVSYS 65 /**< \brief Event System Interface (EVSYS) */
  304. #define ID_SERCOM0 66 /**< \brief Serial Communication Interface 0 (SERCOM0) */
  305. #define ID_SERCOM1 67 /**< \brief Serial Communication Interface 1 (SERCOM1) */
  306. #define ID_SERCOM2 68 /**< \brief Serial Communication Interface 2 (SERCOM2) */
  307. #define ID_SERCOM3 69 /**< \brief Serial Communication Interface 3 (SERCOM3) */
  308. #define ID_TCC0 72 /**< \brief Timer Counter Control 0 (TCC0) */
  309. #define ID_TCC1 73 /**< \brief Timer Counter Control 1 (TCC1) */
  310. #define ID_TCC2 74 /**< \brief Timer Counter Control 2 (TCC2) */
  311. #define ID_TC3 75 /**< \brief Basic Timer Counter 3 (TC3) */
  312. #define ID_TC4 76 /**< \brief Basic Timer Counter 4 (TC4) */
  313. #define ID_TC5 77 /**< \brief Basic Timer Counter 5 (TC5) */
  314. #define ID_ADC 80 /**< \brief Analog Digital Converter (ADC) */
  315. #define ID_AC 81 /**< \brief Analog Comparators (AC) */
  316. #define ID_DAC 82 /**< \brief Digital Analog Converter (DAC) */
  317. #define ID_AC1 85 /**< \brief Analog Comparators 1 (AC1) */
  318. #define ID_PERIPH_COUNT 86 /**< \brief Number of peripheral IDs */
  319. /*@}*/
  320. /* ************************************************************************** */
  321. /** BASE ADDRESS DEFINITIONS FOR SAMD21E15L */
  322. /* ************************************************************************** */
  323. /** \defgroup SAMD21E15L_base Peripheral Base Address Definitions */
  324. /*@{*/
  325. #if defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)
  326. #define AC (0x42004400UL) /**< \brief (AC) APB Base Address */
  327. #define AC1 (0x42005400UL) /**< \brief (AC1) APB Base Address */
  328. #define ADC (0x42004000UL) /**< \brief (ADC) APB Base Address */
  329. #define DAC (0x42004800UL) /**< \brief (DAC) APB Base Address */
  330. #define DMAC (0x41004800UL) /**< \brief (DMAC) APB Base Address */
  331. #define DSU (0x41002000UL) /**< \brief (DSU) APB Base Address */
  332. #define EIC (0x40001800UL) /**< \brief (EIC) APB Base Address */
  333. #define EVSYS (0x42000400UL) /**< \brief (EVSYS) APB Base Address */
  334. #define GCLK (0x40000C00UL) /**< \brief (GCLK) APB Base Address */
  335. #define SBMATRIX (0x41007000UL) /**< \brief (SBMATRIX) APB Base Address */
  336. #define MTB (0x41006000UL) /**< \brief (MTB) APB Base Address */
  337. #define NVMCTRL (0x41004000UL) /**< \brief (NVMCTRL) APB Base Address */
  338. #define NVMCTRL_CAL (0x00800000UL) /**< \brief (NVMCTRL) CAL Base Address */
  339. #define NVMCTRL_LOCKBIT (0x00802000UL) /**< \brief (NVMCTRL) LOCKBIT Base Address */
  340. #define NVMCTRL_OTP1 (0x00806000UL) /**< \brief (NVMCTRL) OTP1 Base Address */
  341. #define NVMCTRL_OTP2 (0x00806008UL) /**< \brief (NVMCTRL) OTP2 Base Address */
  342. #define NVMCTRL_OTP4 (0x00806020UL) /**< \brief (NVMCTRL) OTP4 Base Address */
  343. #define NVMCTRL_TEMP_LOG (0x00806030UL) /**< \brief (NVMCTRL) TEMP_LOG Base Address */
  344. #define NVMCTRL_USER (0x00804000UL) /**< \brief (NVMCTRL) USER Base Address */
  345. #define PAC0 (0x40000000UL) /**< \brief (PAC0) APB Base Address */
  346. #define PAC1 (0x41000000UL) /**< \brief (PAC1) APB Base Address */
  347. #define PAC2 (0x42000000UL) /**< \brief (PAC2) APB Base Address */
  348. #define PM (0x40000400UL) /**< \brief (PM) APB Base Address */
  349. #define PORT (0x41004400UL) /**< \brief (PORT) APB Base Address */
  350. #define PORT_IOBUS (0x60000000UL) /**< \brief (PORT) IOBUS Base Address */
  351. #define RTC (0x40001400UL) /**< \brief (RTC) APB Base Address */
  352. #define SERCOM0 (0x42000800UL) /**< \brief (SERCOM0) APB Base Address */
  353. #define SERCOM1 (0x42000C00UL) /**< \brief (SERCOM1) APB Base Address */
  354. #define SERCOM2 (0x42001000UL) /**< \brief (SERCOM2) APB Base Address */
  355. #define SERCOM3 (0x42001400UL) /**< \brief (SERCOM3) APB Base Address */
  356. #define SYSCTRL (0x40000800UL) /**< \brief (SYSCTRL) APB Base Address */
  357. #define TC3 (0x42002C00UL) /**< \brief (TC3) APB Base Address */
  358. #define TC4 (0x42003000UL) /**< \brief (TC4) APB Base Address */
  359. #define TC5 (0x42003400UL) /**< \brief (TC5) APB Base Address */
  360. #define TCC0 (0x42002000UL) /**< \brief (TCC0) APB Base Address */
  361. #define TCC1 (0x42002400UL) /**< \brief (TCC1) APB Base Address */
  362. #define TCC2 (0x42002800UL) /**< \brief (TCC2) APB Base Address */
  363. #define WDT (0x40001000UL) /**< \brief (WDT) APB Base Address */
  364. #else
  365. #define AC ((Ac *)0x42004400UL) /**< \brief (AC) APB Base Address */
  366. #define AC1 ((Ac *)0x42005400UL) /**< \brief (AC1) APB Base Address */
  367. #define AC_INST_NUM 2 /**< \brief (AC) Number of instances */
  368. #define AC_INSTS { AC, AC1 } /**< \brief (AC) Instances List */
  369. #define ADC ((Adc *)0x42004000UL) /**< \brief (ADC) APB Base Address */
  370. #define ADC_INST_NUM 1 /**< \brief (ADC) Number of instances */
  371. #define ADC_INSTS { ADC } /**< \brief (ADC) Instances List */
  372. #define DAC ((Dac *)0x42004800UL) /**< \brief (DAC) APB Base Address */
  373. #define DAC_INST_NUM 1 /**< \brief (DAC) Number of instances */
  374. #define DAC_INSTS { DAC } /**< \brief (DAC) Instances List */
  375. #define DMAC ((Dmac *)0x41004800UL) /**< \brief (DMAC) APB Base Address */
  376. #define DMAC_INST_NUM 1 /**< \brief (DMAC) Number of instances */
  377. #define DMAC_INSTS { DMAC } /**< \brief (DMAC) Instances List */
  378. #define DSU ((Dsu *)0x41002000UL) /**< \brief (DSU) APB Base Address */
  379. #define DSU_INST_NUM 1 /**< \brief (DSU) Number of instances */
  380. #define DSU_INSTS { DSU } /**< \brief (DSU) Instances List */
  381. #define EIC ((Eic *)0x40001800UL) /**< \brief (EIC) APB Base Address */
  382. #define EIC_INST_NUM 1 /**< \brief (EIC) Number of instances */
  383. #define EIC_INSTS { EIC } /**< \brief (EIC) Instances List */
  384. #define EVSYS ((Evsys *)0x42000400UL) /**< \brief (EVSYS) APB Base Address */
  385. #define EVSYS_INST_NUM 1 /**< \brief (EVSYS) Number of instances */
  386. #define EVSYS_INSTS { EVSYS } /**< \brief (EVSYS) Instances List */
  387. #define GCLK ((Gclk *)0x40000C00UL) /**< \brief (GCLK) APB Base Address */
  388. #define GCLK_INST_NUM 1 /**< \brief (GCLK) Number of instances */
  389. #define GCLK_INSTS { GCLK } /**< \brief (GCLK) Instances List */
  390. #define SBMATRIX ((Hmatrixb *)0x41007000UL) /**< \brief (SBMATRIX) APB Base Address */
  391. #define HMATRIXB_INST_NUM 1 /**< \brief (HMATRIXB) Number of instances */
  392. #define HMATRIXB_INSTS { SBMATRIX } /**< \brief (HMATRIXB) Instances List */
  393. #define MTB ((Mtb *)0x41006000UL) /**< \brief (MTB) APB Base Address */
  394. #define MTB_INST_NUM 1 /**< \brief (MTB) Number of instances */
  395. #define MTB_INSTS { MTB } /**< \brief (MTB) Instances List */
  396. #define NVMCTRL ((Nvmctrl *)0x41004000UL) /**< \brief (NVMCTRL) APB Base Address */
  397. #define NVMCTRL_CAL (0x00800000UL) /**< \brief (NVMCTRL) CAL Base Address */
  398. #define NVMCTRL_LOCKBIT (0x00802000UL) /**< \brief (NVMCTRL) LOCKBIT Base Address */
  399. #define NVMCTRL_OTP1 (0x00806000UL) /**< \brief (NVMCTRL) OTP1 Base Address */
  400. #define NVMCTRL_OTP2 (0x00806008UL) /**< \brief (NVMCTRL) OTP2 Base Address */
  401. #define NVMCTRL_OTP4 (0x00806020UL) /**< \brief (NVMCTRL) OTP4 Base Address */
  402. #define NVMCTRL_TEMP_LOG (0x00806030UL) /**< \brief (NVMCTRL) TEMP_LOG Base Address */
  403. #define NVMCTRL_USER (0x00804000UL) /**< \brief (NVMCTRL) USER Base Address */
  404. #define NVMCTRL_INST_NUM 1 /**< \brief (NVMCTRL) Number of instances */
  405. #define NVMCTRL_INSTS { NVMCTRL } /**< \brief (NVMCTRL) Instances List */
  406. #define PAC0 ((Pac *)0x40000000UL) /**< \brief (PAC0) APB Base Address */
  407. #define PAC1 ((Pac *)0x41000000UL) /**< \brief (PAC1) APB Base Address */
  408. #define PAC2 ((Pac *)0x42000000UL) /**< \brief (PAC2) APB Base Address */
  409. #define PAC_INST_NUM 3 /**< \brief (PAC) Number of instances */
  410. #define PAC_INSTS { PAC0, PAC1, PAC2 } /**< \brief (PAC) Instances List */
  411. #define PM ((Pm *)0x40000400UL) /**< \brief (PM) APB Base Address */
  412. #define PM_INST_NUM 1 /**< \brief (PM) Number of instances */
  413. #define PM_INSTS { PM } /**< \brief (PM) Instances List */
  414. #define PORT ((Port *)0x41004400UL) /**< \brief (PORT) APB Base Address */
  415. #define PORT_IOBUS ((Port *)0x60000000UL) /**< \brief (PORT) IOBUS Base Address */
  416. #define PORT_INST_NUM 1 /**< \brief (PORT) Number of instances */
  417. #define PORT_INSTS { PORT } /**< \brief (PORT) Instances List */
  418. #define RTC ((Rtc *)0x40001400UL) /**< \brief (RTC) APB Base Address */
  419. #define RTC_INST_NUM 1 /**< \brief (RTC) Number of instances */
  420. #define RTC_INSTS { RTC } /**< \brief (RTC) Instances List */
  421. #define SERCOM0 ((Sercom *)0x42000800UL) /**< \brief (SERCOM0) APB Base Address */
  422. #define SERCOM1 ((Sercom *)0x42000C00UL) /**< \brief (SERCOM1) APB Base Address */
  423. #define SERCOM2 ((Sercom *)0x42001000UL) /**< \brief (SERCOM2) APB Base Address */
  424. #define SERCOM3 ((Sercom *)0x42001400UL) /**< \brief (SERCOM3) APB Base Address */
  425. #define SERCOM_INST_NUM 4 /**< \brief (SERCOM) Number of instances */
  426. #define SERCOM_INSTS { SERCOM0, SERCOM1, SERCOM2, SERCOM3 } /**< \brief (SERCOM) Instances List */
  427. #define SYSCTRL ((Sysctrl *)0x40000800UL) /**< \brief (SYSCTRL) APB Base Address */
  428. #define SYSCTRL_INST_NUM 1 /**< \brief (SYSCTRL) Number of instances */
  429. #define SYSCTRL_INSTS { SYSCTRL } /**< \brief (SYSCTRL) Instances List */
  430. #define TC3 ((Tc *)0x42002C00UL) /**< \brief (TC3) APB Base Address */
  431. #define TC4 ((Tc *)0x42003000UL) /**< \brief (TC4) APB Base Address */
  432. #define TC5 ((Tc *)0x42003400UL) /**< \brief (TC5) APB Base Address */
  433. #define TC_INST_NUM 3 /**< \brief (TC) Number of instances */
  434. #define TC_INSTS { TC3, TC4, TC5 } /**< \brief (TC) Instances List */
  435. #define TCC0 ((Tcc *)0x42002000UL) /**< \brief (TCC0) APB Base Address */
  436. #define TCC1 ((Tcc *)0x42002400UL) /**< \brief (TCC1) APB Base Address */
  437. #define TCC2 ((Tcc *)0x42002800UL) /**< \brief (TCC2) APB Base Address */
  438. #define TCC_INST_NUM 3 /**< \brief (TCC) Number of instances */
  439. #define TCC_INSTS { TCC0, TCC1, TCC2 } /**< \brief (TCC) Instances List */
  440. #define WDT ((Wdt *)0x40001000UL) /**< \brief (WDT) APB Base Address */
  441. #define WDT_INST_NUM 1 /**< \brief (WDT) Number of instances */
  442. #define WDT_INSTS { WDT } /**< \brief (WDT) Instances List */
  443. #endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  444. /*@}*/
  445. /* ************************************************************************** */
  446. /** PORT DEFINITIONS FOR SAMD21E15L */
  447. /* ************************************************************************** */
  448. /** \defgroup SAMD21E15L_port PORT Definitions */
  449. /*@{*/
  450. #include "pio/samd21e15l.h"
  451. /*@}*/
  452. /* ************************************************************************** */
  453. /** MEMORY MAPPING DEFINITIONS FOR SAMD21E15L */
  454. /* ************************************************************************** */
  455. #define FLASH_SIZE 0x8000UL /* 32 kB */
  456. #define FLASH_PAGE_SIZE 64
  457. #define FLASH_NB_OF_PAGES 512
  458. #define FLASH_USER_PAGE_SIZE 64
  459. #define HMCRAMC0_SIZE 0x1000UL /* 4 kB */
  460. #define FLASH_ADDR (0x00000000UL) /**< FLASH base address */
  461. #define FLASH_USER_PAGE_ADDR (0x00800000UL) /**< FLASH_USER_PAGE base address */
  462. #define HMCRAMC0_ADDR (0x20000000UL) /**< HMCRAMC0 base address */
  463. #define DSU_DID_RESETVALUE 0x1001143FUL
  464. #define EIC_EXTINT_NUM 16
  465. #define NVMCTRL_RWW_EEPROM_SIZE 0x400UL /* 1 kB */
  466. #define PORT_GROUPS 2
  467. #define USB_HOST 0
  468. /* ************************************************************************** */
  469. /** ELECTRICAL DEFINITIONS FOR SAMD21E15L */
  470. /* ************************************************************************** */
  471. #ifdef __cplusplus
  472. }
  473. #endif
  474. /*@}*/
  475. #endif /* SAMD21E15L_H */