]> git.donarmstrong.com Git - qmk_firmware.git/blob - lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/samd51j18a.h
Massdrop keyboard support (#3780)
[qmk_firmware.git] / lib / arm_atsam / packs / atmel / SAMD51_DFP / 1.0.70 / include / samd51j18a.h
1 /**
2  * \file
3  *
4  * \brief Header file for SAMD51J18A
5  *
6  * Copyright (c) 2017 Microchip Technology Inc.
7  *
8  * \asf_license_start
9  *
10  * \page License
11  *
12  * SPDX-License-Identifier: Apache-2.0
13  *
14  * Licensed under the Apache License, Version 2.0 (the "License"); you may
15  * not use this file except in compliance with the License.
16  * You may obtain a copy of the Licence at
17  * 
18  * http://www.apache.org/licenses/LICENSE-2.0
19  * 
20  * Unless required by applicable law or agreed to in writing, software
21  * distributed under the License is distributed on an AS IS BASIS, WITHOUT
22  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
23  * See the License for the specific language governing permissions and
24  * limitations under the License.
25  *
26  * \asf_license_stop
27  *
28  */
29
30 #ifndef _SAMD51J18A_
31 #define _SAMD51J18A_
32
33 /**
34  * \ingroup SAMD51_definitions
35  * \addtogroup SAMD51J18A_definitions SAMD51J18A definitions
36  * This file defines all structures and symbols for SAMD51J18A:
37  *   - registers and bitfields
38  *   - peripheral base address
39  *   - peripheral ID
40  *   - PIO definitions
41 */
42 /*@{*/
43
44 #ifdef __cplusplus
45  extern "C" {
46 #endif
47
48 #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
49 #include <stdint.h>
50 #ifndef __cplusplus
51 typedef volatile const uint32_t RoReg;   /**< Read only 32-bit register (volatile const unsigned int) */
52 typedef volatile const uint16_t RoReg16; /**< Read only 16-bit register (volatile const unsigned int) */
53 typedef volatile const uint8_t  RoReg8;  /**< Read only  8-bit register (volatile const unsigned int) */
54 #else
55 typedef volatile       uint32_t RoReg;   /**< Read only 32-bit register (volatile const unsigned int) */
56 typedef volatile       uint16_t RoReg16; /**< Read only 16-bit register (volatile const unsigned int) */
57 typedef volatile       uint8_t  RoReg8;  /**< Read only  8-bit register (volatile const unsigned int) */
58 #endif
59 typedef volatile       uint32_t WoReg;   /**< Write only 32-bit register (volatile unsigned int) */
60 typedef volatile       uint16_t WoReg16; /**< Write only 16-bit register (volatile unsigned int) */
61 typedef volatile       uint8_t  WoReg8;  /**< Write only  8-bit register (volatile unsigned int) */
62 typedef volatile       uint32_t RwReg;   /**< Read-Write 32-bit register (volatile unsigned int) */
63 typedef volatile       uint16_t RwReg16; /**< Read-Write 16-bit register (volatile unsigned int) */
64 typedef volatile       uint8_t  RwReg8;  /**< Read-Write  8-bit register (volatile unsigned int) */
65 #endif
66
67 #if !defined(SKIP_INTEGER_LITERALS)
68 #if defined(_U_) || defined(_L_) || defined(_UL_)
69   #error "Integer Literals macros already defined elsewhere"
70 #endif
71
72 #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
73 /* Macros that deal with adding suffixes to integer literal constants for C/C++ */
74 #define _U_(x)         x ## U            /**< C code: Unsigned integer literal constant value */
75 #define _L_(x)         x ## L            /**< C code: Long integer literal constant value */
76 #define _UL_(x)        x ## UL           /**< C code: Unsigned Long integer literal constant value */
77 #else /* Assembler */
78 #define _U_(x)         x                 /**< Assembler: Unsigned integer literal constant value */
79 #define _L_(x)         x                 /**< Assembler: Long integer literal constant value */
80 #define _UL_(x)        x                 /**< Assembler: Unsigned Long integer literal constant value */
81 #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
82 #endif /* SKIP_INTEGER_LITERALS */
83
84 /* ************************************************************************** */
85 /**  CMSIS DEFINITIONS FOR SAMD51J18A */
86 /* ************************************************************************** */
87 /** \defgroup SAMD51J18A_cmsis CMSIS Definitions */
88 /*@{*/
89
90 /** Interrupt Number Definition */
91 typedef enum IRQn
92 {
93   /******  Cortex-M4 Processor Exceptions Numbers ******************************/
94   NonMaskableInt_IRQn      = -14,/**<  2 Non Maskable Interrupt                */
95   HardFault_IRQn           = -13,/**<  3 Cortex-M4 Hard Fault Interrupt        */
96   MemoryManagement_IRQn    = -12,/**<  4 Cortex-M4 Memory Management Interrupt */
97   BusFault_IRQn            = -11,/**<  5 Cortex-M4 Bus Fault Interrupt         */
98   UsageFault_IRQn          = -10,/**<  6 Cortex-M4 Usage Fault Interrupt       */
99   SVCall_IRQn              = -5, /**< 11 Cortex-M4 SV Call Interrupt           */
100   DebugMonitor_IRQn        = -4, /**< 12 Cortex-M4 Debug Monitor Interrupt     */
101   PendSV_IRQn              = -2, /**< 14 Cortex-M4 Pend SV Interrupt           */
102   SysTick_IRQn             = -1, /**< 15 Cortex-M4 System Tick Interrupt       */
103   /******  SAMD51J18A-specific Interrupt Numbers ***********************/
104   PM_IRQn                  =  0, /**<  0 SAMD51J18A Power Manager (PM) */
105   MCLK_IRQn                =  1, /**<  1 SAMD51J18A Main Clock (MCLK) */
106   OSCCTRL_0_IRQn           =  2, /**<  2 SAMD51J18A Oscillators Control (OSCCTRL): OSCCTRL_XOSCFAIL_0, OSCCTRL_XOSCRDY_0 */
107   OSCCTRL_1_IRQn           =  3, /**<  3 SAMD51J18A Oscillators Control (OSCCTRL): OSCCTRL_XOSCFAIL_1, OSCCTRL_XOSCRDY_1 */
108   OSCCTRL_2_IRQn           =  4, /**<  4 SAMD51J18A Oscillators Control (OSCCTRL): OSCCTRL_DFLLLOCKC, OSCCTRL_DFLLLOCKF, OSCCTRL_DFLLOOB, OSCCTRL_DFLLRCS, OSCCTRL_DFLLRDY */
109   OSCCTRL_3_IRQn           =  5, /**<  5 SAMD51J18A Oscillators Control (OSCCTRL): OSCCTRL_DPLLLCKF_0, OSCCTRL_DPLLLCKR_0, OSCCTRL_DPLLLDRTO_0, OSCCTRL_DPLLLTO_0 */
110   OSCCTRL_4_IRQn           =  6, /**<  6 SAMD51J18A Oscillators Control (OSCCTRL): OSCCTRL_DPLLLCKF_1, OSCCTRL_DPLLLCKR_1, OSCCTRL_DPLLLDRTO_1, OSCCTRL_DPLLLTO_1 */
111   OSC32KCTRL_IRQn          =  7, /**<  7 SAMD51J18A 32kHz Oscillators Control (OSC32KCTRL) */
112   SUPC_0_IRQn              =  8, /**<  8 SAMD51J18A Supply Controller (SUPC): SUPC_B12SRDY, SUPC_B33SRDY, SUPC_BOD12RDY, SUPC_BOD33RDY, SUPC_VCORERDY, SUPC_VREGRDY */
113   SUPC_1_IRQn              =  9, /**<  9 SAMD51J18A Supply Controller (SUPC): SUPC_BOD12DET, SUPC_BOD33DET */
114   WDT_IRQn                 = 10, /**< 10 SAMD51J18A Watchdog Timer (WDT) */
115   RTC_IRQn                 = 11, /**< 11 SAMD51J18A Real-Time Counter (RTC) */
116   EIC_0_IRQn               = 12, /**< 12 SAMD51J18A External Interrupt Controller (EIC): EIC_EXTINT_0 */
117   EIC_1_IRQn               = 13, /**< 13 SAMD51J18A External Interrupt Controller (EIC): EIC_EXTINT_1 */
118   EIC_2_IRQn               = 14, /**< 14 SAMD51J18A External Interrupt Controller (EIC): EIC_EXTINT_2 */
119   EIC_3_IRQn               = 15, /**< 15 SAMD51J18A External Interrupt Controller (EIC): EIC_EXTINT_3 */
120   EIC_4_IRQn               = 16, /**< 16 SAMD51J18A External Interrupt Controller (EIC): EIC_EXTINT_4 */
121   EIC_5_IRQn               = 17, /**< 17 SAMD51J18A External Interrupt Controller (EIC): EIC_EXTINT_5 */
122   EIC_6_IRQn               = 18, /**< 18 SAMD51J18A External Interrupt Controller (EIC): EIC_EXTINT_6 */
123   EIC_7_IRQn               = 19, /**< 19 SAMD51J18A External Interrupt Controller (EIC): EIC_EXTINT_7 */
124   EIC_8_IRQn               = 20, /**< 20 SAMD51J18A External Interrupt Controller (EIC): EIC_EXTINT_8 */
125   EIC_9_IRQn               = 21, /**< 21 SAMD51J18A External Interrupt Controller (EIC): EIC_EXTINT_9 */
126   EIC_10_IRQn              = 22, /**< 22 SAMD51J18A External Interrupt Controller (EIC): EIC_EXTINT_10 */
127   EIC_11_IRQn              = 23, /**< 23 SAMD51J18A External Interrupt Controller (EIC): EIC_EXTINT_11 */
128   EIC_12_IRQn              = 24, /**< 24 SAMD51J18A External Interrupt Controller (EIC): EIC_EXTINT_12 */
129   EIC_13_IRQn              = 25, /**< 25 SAMD51J18A External Interrupt Controller (EIC): EIC_EXTINT_13 */
130   EIC_14_IRQn              = 26, /**< 26 SAMD51J18A External Interrupt Controller (EIC): EIC_EXTINT_14 */
131   EIC_15_IRQn              = 27, /**< 27 SAMD51J18A External Interrupt Controller (EIC): EIC_EXTINT_15 */
132   FREQM_IRQn               = 28, /**< 28 SAMD51J18A Frequency Meter (FREQM) */
133   NVMCTRL_0_IRQn           = 29, /**< 29 SAMD51J18A Non-Volatile Memory Controller (NVMCTRL): NVMCTRL_0, NVMCTRL_1, NVMCTRL_2, NVMCTRL_3, NVMCTRL_4, NVMCTRL_5, NVMCTRL_6, NVMCTRL_7 */
134   NVMCTRL_1_IRQn           = 30, /**< 30 SAMD51J18A Non-Volatile Memory Controller (NVMCTRL): NVMCTRL_10, NVMCTRL_8, NVMCTRL_9 */
135   DMAC_0_IRQn              = 31, /**< 31 SAMD51J18A Direct Memory Access Controller (DMAC): DMAC_SUSP_0, DMAC_TCMPL_0, DMAC_TERR_0 */
136   DMAC_1_IRQn              = 32, /**< 32 SAMD51J18A Direct Memory Access Controller (DMAC): DMAC_SUSP_1, DMAC_TCMPL_1, DMAC_TERR_1 */
137   DMAC_2_IRQn              = 33, /**< 33 SAMD51J18A Direct Memory Access Controller (DMAC): DMAC_SUSP_2, DMAC_TCMPL_2, DMAC_TERR_2 */
138   DMAC_3_IRQn              = 34, /**< 34 SAMD51J18A Direct Memory Access Controller (DMAC): DMAC_SUSP_3, DMAC_TCMPL_3, DMAC_TERR_3 */
139   DMAC_4_IRQn              = 35, /**< 35 SAMD51J18A Direct Memory Access Controller (DMAC): DMAC_SUSP_10, DMAC_SUSP_11, DMAC_SUSP_12, DMAC_SUSP_13, DMAC_SUSP_14, DMAC_SUSP_15, DMAC_SUSP_16, DMAC_SUSP_17, DMAC_SUSP_18, DMAC_SUSP_19, DMAC_SUSP_20, DMAC_SUSP_21, DMAC_SUSP_22, DMAC_SUSP_23, DMAC_SUSP_24, DMAC_SUSP_25, DMAC_SUSP_26, DMAC_SUSP_27, DMAC_SUSP_28, DMAC_SUSP_29, DMAC_SUSP_30, DMAC_SUSP_31, DMAC_SUSP_4, DMAC_SUSP_5, DMAC_SUSP_6, DMAC_SUSP_7, DMAC_SUSP_8, DMAC_SUSP_9, DMAC_TCMPL_10, DMAC_TCMPL_11, DMAC_TCMPL_12, DMAC_TCMPL_13, DMAC_TCMPL_14, DMAC_TCMPL_15, DMAC_TCMPL_16, DMAC_TCMPL_17, DMAC_TCMPL_18, DMAC_TCMPL_19, DMAC_TCMPL_20, DMAC_TCMPL_21, DMAC_TCMPL_22, DMAC_TCMPL_23, DMAC_TCMPL_24, DMAC_TCMPL_25, DMAC_TCMPL_26, DMAC_TCMPL_27, DMAC_TCMPL_28, DMAC_TCMPL_29, DMAC_TCMPL_30, DMAC_TCMPL_31, DMAC_TCMPL_4, DMAC_TCMPL_5, DMAC_TCMPL_6, DMAC_TCMPL_7, DMAC_TCMPL_8, DMAC_TCMPL_9, DMAC_TERR_10, DMAC_TERR_11, DMAC_TERR_12, DMAC_TERR_13, DMAC_TERR_14, DMAC_TERR_15, DMAC_TERR_16, DMAC_TERR_17, DMAC_TERR_18, DMAC_TERR_19, DMAC_TERR_20, DMAC_TERR_21, DMAC_TERR_22, DMAC_TERR_23, DMAC_TERR_24, DMAC_TERR_25, DMAC_TERR_26, DMAC_TERR_27, DMAC_TERR_28, DMAC_TERR_29, DMAC_TERR_30, DMAC_TERR_31, DMAC_TERR_4, DMAC_TERR_5, DMAC_TERR_6, DMAC_TERR_7, DMAC_TERR_8, DMAC_TERR_9 */
140   EVSYS_0_IRQn             = 36, /**< 36 SAMD51J18A Event System Interface (EVSYS): EVSYS_EVD_0, EVSYS_OVR_0 */
141   EVSYS_1_IRQn             = 37, /**< 37 SAMD51J18A Event System Interface (EVSYS): EVSYS_EVD_1, EVSYS_OVR_1 */
142   EVSYS_2_IRQn             = 38, /**< 38 SAMD51J18A Event System Interface (EVSYS): EVSYS_EVD_2, EVSYS_OVR_2 */
143   EVSYS_3_IRQn             = 39, /**< 39 SAMD51J18A Event System Interface (EVSYS): EVSYS_EVD_3, EVSYS_OVR_3 */
144   EVSYS_4_IRQn             = 40, /**< 40 SAMD51J18A Event System Interface (EVSYS): EVSYS_EVD_10, EVSYS_EVD_11, EVSYS_EVD_4, EVSYS_EVD_5, EVSYS_EVD_6, EVSYS_EVD_7, EVSYS_EVD_8, EVSYS_EVD_9, EVSYS_OVR_10, EVSYS_OVR_11, EVSYS_OVR_4, EVSYS_OVR_5, EVSYS_OVR_6, EVSYS_OVR_7, EVSYS_OVR_8, EVSYS_OVR_9 */
145   PAC_IRQn                 = 41, /**< 41 SAMD51J18A Peripheral Access Controller (PAC) */
146   TAL_0_IRQn               = 42, /**< 42 SAMD51J18A Trigger Allocator (TAL): TAL_BRK */
147   TAL_1_IRQn               = 43, /**< 43 SAMD51J18A Trigger Allocator (TAL): TAL_IPS_0, TAL_IPS_1 */
148   RAMECC_IRQn              = 45, /**< 45 SAMD51J18A RAM ECC (RAMECC) */
149   SERCOM0_0_IRQn           = 46, /**< 46 SAMD51J18A Serial Communication Interface 0 (SERCOM0): SERCOM0_0 */
150   SERCOM0_1_IRQn           = 47, /**< 47 SAMD51J18A Serial Communication Interface 0 (SERCOM0): SERCOM0_1 */
151   SERCOM0_2_IRQn           = 48, /**< 48 SAMD51J18A Serial Communication Interface 0 (SERCOM0): SERCOM0_2 */
152   SERCOM0_3_IRQn           = 49, /**< 49 SAMD51J18A Serial Communication Interface 0 (SERCOM0): SERCOM0_3, SERCOM0_4, SERCOM0_5, SERCOM0_6 */
153   SERCOM1_0_IRQn           = 50, /**< 50 SAMD51J18A Serial Communication Interface 1 (SERCOM1): SERCOM1_0 */
154   SERCOM1_1_IRQn           = 51, /**< 51 SAMD51J18A Serial Communication Interface 1 (SERCOM1): SERCOM1_1 */
155   SERCOM1_2_IRQn           = 52, /**< 52 SAMD51J18A Serial Communication Interface 1 (SERCOM1): SERCOM1_2 */
156   SERCOM1_3_IRQn           = 53, /**< 53 SAMD51J18A Serial Communication Interface 1 (SERCOM1): SERCOM1_3, SERCOM1_4, SERCOM1_5, SERCOM1_6 */
157   SERCOM2_0_IRQn           = 54, /**< 54 SAMD51J18A Serial Communication Interface 2 (SERCOM2): SERCOM2_0 */
158   SERCOM2_1_IRQn           = 55, /**< 55 SAMD51J18A Serial Communication Interface 2 (SERCOM2): SERCOM2_1 */
159   SERCOM2_2_IRQn           = 56, /**< 56 SAMD51J18A Serial Communication Interface 2 (SERCOM2): SERCOM2_2 */
160   SERCOM2_3_IRQn           = 57, /**< 57 SAMD51J18A Serial Communication Interface 2 (SERCOM2): SERCOM2_3, SERCOM2_4, SERCOM2_5, SERCOM2_6 */
161   SERCOM3_0_IRQn           = 58, /**< 58 SAMD51J18A Serial Communication Interface 3 (SERCOM3): SERCOM3_0 */
162   SERCOM3_1_IRQn           = 59, /**< 59 SAMD51J18A Serial Communication Interface 3 (SERCOM3): SERCOM3_1 */
163   SERCOM3_2_IRQn           = 60, /**< 60 SAMD51J18A Serial Communication Interface 3 (SERCOM3): SERCOM3_2 */
164   SERCOM3_3_IRQn           = 61, /**< 61 SAMD51J18A Serial Communication Interface 3 (SERCOM3): SERCOM3_3, SERCOM3_4, SERCOM3_5, SERCOM3_6 */
165   SERCOM4_0_IRQn           = 62, /**< 62 SAMD51J18A Serial Communication Interface 4 (SERCOM4): SERCOM4_0 */
166   SERCOM4_1_IRQn           = 63, /**< 63 SAMD51J18A Serial Communication Interface 4 (SERCOM4): SERCOM4_1 */
167   SERCOM4_2_IRQn           = 64, /**< 64 SAMD51J18A Serial Communication Interface 4 (SERCOM4): SERCOM4_2 */
168   SERCOM4_3_IRQn           = 65, /**< 65 SAMD51J18A Serial Communication Interface 4 (SERCOM4): SERCOM4_3, SERCOM4_4, SERCOM4_5, SERCOM4_6 */
169   SERCOM5_0_IRQn           = 66, /**< 66 SAMD51J18A Serial Communication Interface 5 (SERCOM5): SERCOM5_0 */
170   SERCOM5_1_IRQn           = 67, /**< 67 SAMD51J18A Serial Communication Interface 5 (SERCOM5): SERCOM5_1 */
171   SERCOM5_2_IRQn           = 68, /**< 68 SAMD51J18A Serial Communication Interface 5 (SERCOM5): SERCOM5_2 */
172   SERCOM5_3_IRQn           = 69, /**< 69 SAMD51J18A Serial Communication Interface 5 (SERCOM5): SERCOM5_3, SERCOM5_4, SERCOM5_5, SERCOM5_6 */
173   USB_0_IRQn               = 80, /**< 80 SAMD51J18A Universal Serial Bus (USB): USB_EORSM_DNRSM, USB_EORST_RST, USB_LPMSUSP_DDISC, USB_LPM_DCONN, USB_MSOF, USB_RAMACER, USB_RXSTP_TXSTP_0, USB_RXSTP_TXSTP_1, USB_RXSTP_TXSTP_2, USB_RXSTP_TXSTP_3, USB_RXSTP_TXSTP_4, USB_RXSTP_TXSTP_5, USB_RXSTP_TXSTP_6, USB_RXSTP_TXSTP_7, USB_STALL0_STALL_0, USB_STALL0_STALL_1, USB_STALL0_STALL_2, USB_STALL0_STALL_3, USB_STALL0_STALL_4, USB_STALL0_STALL_5, USB_STALL0_STALL_6, USB_STALL0_STALL_7, USB_STALL1_0, USB_STALL1_1, USB_STALL1_2, USB_STALL1_3, USB_STALL1_4, USB_STALL1_5, USB_STALL1_6, USB_STALL1_7, USB_SUSPEND, USB_TRFAIL0_TRFAIL_0, USB_TRFAIL0_TRFAIL_1, USB_TRFAIL0_TRFAIL_2, USB_TRFAIL0_TRFAIL_3, USB_TRFAIL0_TRFAIL_4, USB_TRFAIL0_TRFAIL_5, USB_TRFAIL0_TRFAIL_6, USB_TRFAIL0_TRFAIL_7, USB_TRFAIL1_PERR_0, USB_TRFAIL1_PERR_1, USB_TRFAIL1_PERR_2, USB_TRFAIL1_PERR_3, USB_TRFAIL1_PERR_4, USB_TRFAIL1_PERR_5, USB_TRFAIL1_PERR_6, USB_TRFAIL1_PERR_7, USB_UPRSM, USB_WAKEUP */
174   USB_1_IRQn               = 81, /**< 81 SAMD51J18A Universal Serial Bus (USB): USB_SOF_HSOF */
175   USB_2_IRQn               = 82, /**< 82 SAMD51J18A Universal Serial Bus (USB): USB_TRCPT0_0, USB_TRCPT0_1, USB_TRCPT0_2, USB_TRCPT0_3, USB_TRCPT0_4, USB_TRCPT0_5, USB_TRCPT0_6, USB_TRCPT0_7 */
176   USB_3_IRQn               = 83, /**< 83 SAMD51J18A Universal Serial Bus (USB): USB_TRCPT1_0, USB_TRCPT1_1, USB_TRCPT1_2, USB_TRCPT1_3, USB_TRCPT1_4, USB_TRCPT1_5, USB_TRCPT1_6, USB_TRCPT1_7 */
177   TCC0_0_IRQn              = 85, /**< 85 SAMD51J18A Timer Counter Control 0 (TCC0): TCC0_CNT_A, TCC0_DFS_A, TCC0_ERR_A, TCC0_FAULT0_A, TCC0_FAULT1_A, TCC0_FAULTA_A, TCC0_FAULTB_A, TCC0_OVF, TCC0_TRG, TCC0_UFS_A */
178   TCC0_1_IRQn              = 86, /**< 86 SAMD51J18A Timer Counter Control 0 (TCC0): TCC0_MC_0 */
179   TCC0_2_IRQn              = 87, /**< 87 SAMD51J18A Timer Counter Control 0 (TCC0): TCC0_MC_1 */
180   TCC0_3_IRQn              = 88, /**< 88 SAMD51J18A Timer Counter Control 0 (TCC0): TCC0_MC_2 */
181   TCC0_4_IRQn              = 89, /**< 89 SAMD51J18A Timer Counter Control 0 (TCC0): TCC0_MC_3 */
182   TCC0_5_IRQn              = 90, /**< 90 SAMD51J18A Timer Counter Control 0 (TCC0): TCC0_MC_4 */
183   TCC0_6_IRQn              = 91, /**< 91 SAMD51J18A Timer Counter Control 0 (TCC0): TCC0_MC_5 */
184   TCC1_0_IRQn              = 92, /**< 92 SAMD51J18A Timer Counter Control 1 (TCC1): TCC1_CNT_A, TCC1_DFS_A, TCC1_ERR_A, TCC1_FAULT0_A, TCC1_FAULT1_A, TCC1_FAULTA_A, TCC1_FAULTB_A, TCC1_OVF, TCC1_TRG, TCC1_UFS_A */
185   TCC1_1_IRQn              = 93, /**< 93 SAMD51J18A Timer Counter Control 1 (TCC1): TCC1_MC_0 */
186   TCC1_2_IRQn              = 94, /**< 94 SAMD51J18A Timer Counter Control 1 (TCC1): TCC1_MC_1 */
187   TCC1_3_IRQn              = 95, /**< 95 SAMD51J18A Timer Counter Control 1 (TCC1): TCC1_MC_2 */
188   TCC1_4_IRQn              = 96, /**< 96 SAMD51J18A Timer Counter Control 1 (TCC1): TCC1_MC_3 */
189   TCC2_0_IRQn              = 97, /**< 97 SAMD51J18A Timer Counter Control 2 (TCC2): TCC2_CNT_A, TCC2_DFS_A, TCC2_ERR_A, TCC2_FAULT0_A, TCC2_FAULT1_A, TCC2_FAULTA_A, TCC2_FAULTB_A, TCC2_OVF, TCC2_TRG, TCC2_UFS_A */
190   TCC2_1_IRQn              = 98, /**< 98 SAMD51J18A Timer Counter Control 2 (TCC2): TCC2_MC_0 */
191   TCC2_2_IRQn              = 99, /**< 99 SAMD51J18A Timer Counter Control 2 (TCC2): TCC2_MC_1 */
192   TCC2_3_IRQn              = 100, /**< 100 SAMD51J18A Timer Counter Control 2 (TCC2): TCC2_MC_2 */
193   TCC3_0_IRQn              = 101, /**< 101 SAMD51J18A Timer Counter Control 3 (TCC3): TCC3_CNT_A, TCC3_DFS_A, TCC3_ERR_A, TCC3_FAULT0_A, TCC3_FAULT1_A, TCC3_FAULTA_A, TCC3_FAULTB_A, TCC3_OVF, TCC3_TRG, TCC3_UFS_A */
194   TCC3_1_IRQn              = 102, /**< 102 SAMD51J18A Timer Counter Control 3 (TCC3): TCC3_MC_0 */
195   TCC3_2_IRQn              = 103, /**< 103 SAMD51J18A Timer Counter Control 3 (TCC3): TCC3_MC_1 */
196   TCC4_0_IRQn              = 104, /**< 104 SAMD51J18A Timer Counter Control 4 (TCC4): TCC4_CNT_A, TCC4_DFS_A, TCC4_ERR_A, TCC4_FAULT0_A, TCC4_FAULT1_A, TCC4_FAULTA_A, TCC4_FAULTB_A, TCC4_OVF, TCC4_TRG, TCC4_UFS_A */
197   TCC4_1_IRQn              = 105, /**< 105 SAMD51J18A Timer Counter Control 4 (TCC4): TCC4_MC_0 */
198   TCC4_2_IRQn              = 106, /**< 106 SAMD51J18A Timer Counter Control 4 (TCC4): TCC4_MC_1 */
199   TC0_IRQn                 = 107, /**< 107 SAMD51J18A Basic Timer Counter 0 (TC0) */
200   TC1_IRQn                 = 108, /**< 108 SAMD51J18A Basic Timer Counter 1 (TC1) */
201   TC2_IRQn                 = 109, /**< 109 SAMD51J18A Basic Timer Counter 2 (TC2) */
202   TC3_IRQn                 = 110, /**< 110 SAMD51J18A Basic Timer Counter 3 (TC3) */
203   TC4_IRQn                 = 111, /**< 111 SAMD51J18A Basic Timer Counter 4 (TC4) */
204   TC5_IRQn                 = 112, /**< 112 SAMD51J18A Basic Timer Counter 5 (TC5) */
205   PDEC_0_IRQn              = 115, /**< 115 SAMD51J18A Quadrature Decodeur (PDEC): PDEC_DIR_A, PDEC_ERR_A, PDEC_OVF, PDEC_VLC_A */
206   PDEC_1_IRQn              = 116, /**< 116 SAMD51J18A Quadrature Decodeur (PDEC): PDEC_MC_0 */
207   PDEC_2_IRQn              = 117, /**< 117 SAMD51J18A Quadrature Decodeur (PDEC): PDEC_MC_1 */
208   ADC0_0_IRQn              = 118, /**< 118 SAMD51J18A Analog Digital Converter 0 (ADC0): ADC0_OVERRUN, ADC0_WINMON */
209   ADC0_1_IRQn              = 119, /**< 119 SAMD51J18A Analog Digital Converter 0 (ADC0): ADC0_RESRDY */
210   ADC1_0_IRQn              = 120, /**< 120 SAMD51J18A Analog Digital Converter 1 (ADC1): ADC1_OVERRUN, ADC1_WINMON */
211   ADC1_1_IRQn              = 121, /**< 121 SAMD51J18A Analog Digital Converter 1 (ADC1): ADC1_RESRDY */
212   AC_IRQn                  = 122, /**< 122 SAMD51J18A Analog Comparators (AC) */
213   DAC_0_IRQn               = 123, /**< 123 SAMD51J18A Digital-to-Analog Converter (DAC): DAC_OVERRUN_A_0, DAC_OVERRUN_A_1, DAC_UNDERRUN_A_0, DAC_UNDERRUN_A_1 */
214   DAC_1_IRQn               = 124, /**< 124 SAMD51J18A Digital-to-Analog Converter (DAC): DAC_EMPTY_0 */
215   DAC_2_IRQn               = 125, /**< 125 SAMD51J18A Digital-to-Analog Converter (DAC): DAC_EMPTY_1 */
216   DAC_3_IRQn               = 126, /**< 126 SAMD51J18A Digital-to-Analog Converter (DAC): DAC_RESRDY_0 */
217   DAC_4_IRQn               = 127, /**< 127 SAMD51J18A Digital-to-Analog Converter (DAC): DAC_RESRDY_1 */
218   I2S_IRQn                 = 128, /**< 128 SAMD51J18A Inter-IC Sound Interface (I2S) */
219   PCC_IRQn                 = 129, /**< 129 SAMD51J18A Parallel Capture Controller (PCC) */
220   AES_IRQn                 = 130, /**< 130 SAMD51J18A Advanced Encryption Standard (AES) */
221   TRNG_IRQn                = 131, /**< 131 SAMD51J18A True Random Generator (TRNG) */
222   ICM_IRQn                 = 132, /**< 132 SAMD51J18A Integrity Check Monitor (ICM) */
223   PUKCC_IRQn               = 133, /**< 133 SAMD51J18A PUblic-Key Cryptography Controller (PUKCC) */
224   QSPI_IRQn                = 134, /**< 134 SAMD51J18A Quad SPI interface (QSPI) */
225   SDHC0_IRQn               = 135, /**< 135 SAMD51J18A SD/MMC Host Controller 0 (SDHC0) */
226
227   PERIPH_COUNT_IRQn        = 137  /**< Number of peripheral IDs */
228 } IRQn_Type;
229
230 typedef struct _DeviceVectors
231 {
232   /* Stack pointer */
233   void* pvStack;
234
235   /* Cortex-M handlers */
236   void* pfnReset_Handler;
237   void* pfnNMI_Handler;
238   void* pfnHardFault_Handler;
239   void* pfnMemManage_Handler;
240   void* pfnBusFault_Handler;
241   void* pfnUsageFault_Handler;
242   void* pvReservedM9;
243   void* pvReservedM8;
244   void* pvReservedM7;
245   void* pvReservedM6;
246   void* pfnSVC_Handler;
247   void* pfnDebugMon_Handler;
248   void* pvReservedM3;
249   void* pfnPendSV_Handler;
250   void* pfnSysTick_Handler;
251
252   /* Peripheral handlers */
253   void* pfnPM_Handler;                    /*  0 Power Manager */
254   void* pfnMCLK_Handler;                  /*  1 Main Clock */
255   void* pfnOSCCTRL_0_Handler;             /*  2 Oscillators Control IRQ 0 */
256   void* pfnOSCCTRL_1_Handler;             /*  3 Oscillators Control IRQ 1 */
257   void* pfnOSCCTRL_2_Handler;             /*  4 Oscillators Control IRQ 2 */
258   void* pfnOSCCTRL_3_Handler;             /*  5 Oscillators Control IRQ 3 */
259   void* pfnOSCCTRL_4_Handler;             /*  6 Oscillators Control IRQ 4 */
260   void* pfnOSC32KCTRL_Handler;            /*  7 32kHz Oscillators Control */
261   void* pfnSUPC_0_Handler;                /*  8 Supply Controller IRQ 0 */
262   void* pfnSUPC_1_Handler;                /*  9 Supply Controller IRQ 1 */
263   void* pfnWDT_Handler;                   /* 10 Watchdog Timer */
264   void* pfnRTC_Handler;                   /* 11 Real-Time Counter */
265   void* pfnEIC_0_Handler;                 /* 12 External Interrupt Controller IRQ 0 */
266   void* pfnEIC_1_Handler;                 /* 13 External Interrupt Controller IRQ 1 */
267   void* pfnEIC_2_Handler;                 /* 14 External Interrupt Controller IRQ 2 */
268   void* pfnEIC_3_Handler;                 /* 15 External Interrupt Controller IRQ 3 */
269   void* pfnEIC_4_Handler;                 /* 16 External Interrupt Controller IRQ 4 */
270   void* pfnEIC_5_Handler;                 /* 17 External Interrupt Controller IRQ 5 */
271   void* pfnEIC_6_Handler;                 /* 18 External Interrupt Controller IRQ 6 */
272   void* pfnEIC_7_Handler;                 /* 19 External Interrupt Controller IRQ 7 */
273   void* pfnEIC_8_Handler;                 /* 20 External Interrupt Controller IRQ 8 */
274   void* pfnEIC_9_Handler;                 /* 21 External Interrupt Controller IRQ 9 */
275   void* pfnEIC_10_Handler;                /* 22 External Interrupt Controller IRQ 10 */
276   void* pfnEIC_11_Handler;                /* 23 External Interrupt Controller IRQ 11 */
277   void* pfnEIC_12_Handler;                /* 24 External Interrupt Controller IRQ 12 */
278   void* pfnEIC_13_Handler;                /* 25 External Interrupt Controller IRQ 13 */
279   void* pfnEIC_14_Handler;                /* 26 External Interrupt Controller IRQ 14 */
280   void* pfnEIC_15_Handler;                /* 27 External Interrupt Controller IRQ 15 */
281   void* pfnFREQM_Handler;                 /* 28 Frequency Meter */
282   void* pfnNVMCTRL_0_Handler;             /* 29 Non-Volatile Memory Controller IRQ 0 */
283   void* pfnNVMCTRL_1_Handler;             /* 30 Non-Volatile Memory Controller IRQ 1 */
284   void* pfnDMAC_0_Handler;                /* 31 Direct Memory Access Controller IRQ 0 */
285   void* pfnDMAC_1_Handler;                /* 32 Direct Memory Access Controller IRQ 1 */
286   void* pfnDMAC_2_Handler;                /* 33 Direct Memory Access Controller IRQ 2 */
287   void* pfnDMAC_3_Handler;                /* 34 Direct Memory Access Controller IRQ 3 */
288   void* pfnDMAC_4_Handler;                /* 35 Direct Memory Access Controller IRQ 4 */
289   void* pfnEVSYS_0_Handler;               /* 36 Event System Interface IRQ 0 */
290   void* pfnEVSYS_1_Handler;               /* 37 Event System Interface IRQ 1 */
291   void* pfnEVSYS_2_Handler;               /* 38 Event System Interface IRQ 2 */
292   void* pfnEVSYS_3_Handler;               /* 39 Event System Interface IRQ 3 */
293   void* pfnEVSYS_4_Handler;               /* 40 Event System Interface IRQ 4 */
294   void* pfnPAC_Handler;                   /* 41 Peripheral Access Controller */
295   void* pfnTAL_0_Handler;                 /* 42 Trigger Allocator IRQ 0 */
296   void* pfnTAL_1_Handler;                 /* 43 Trigger Allocator IRQ 1 */
297   void* pvReserved44;
298   void* pfnRAMECC_Handler;                /* 45 RAM ECC */
299   void* pfnSERCOM0_0_Handler;             /* 46 Serial Communication Interface 0 IRQ 0 */
300   void* pfnSERCOM0_1_Handler;             /* 47 Serial Communication Interface 0 IRQ 1 */
301   void* pfnSERCOM0_2_Handler;             /* 48 Serial Communication Interface 0 IRQ 2 */
302   void* pfnSERCOM0_3_Handler;             /* 49 Serial Communication Interface 0 IRQ 3 */
303   void* pfnSERCOM1_0_Handler;             /* 50 Serial Communication Interface 1 IRQ 0 */
304   void* pfnSERCOM1_1_Handler;             /* 51 Serial Communication Interface 1 IRQ 1 */
305   void* pfnSERCOM1_2_Handler;             /* 52 Serial Communication Interface 1 IRQ 2 */
306   void* pfnSERCOM1_3_Handler;             /* 53 Serial Communication Interface 1 IRQ 3 */
307   void* pfnSERCOM2_0_Handler;             /* 54 Serial Communication Interface 2 IRQ 0 */
308   void* pfnSERCOM2_1_Handler;             /* 55 Serial Communication Interface 2 IRQ 1 */
309   void* pfnSERCOM2_2_Handler;             /* 56 Serial Communication Interface 2 IRQ 2 */
310   void* pfnSERCOM2_3_Handler;             /* 57 Serial Communication Interface 2 IRQ 3 */
311   void* pfnSERCOM3_0_Handler;             /* 58 Serial Communication Interface 3 IRQ 0 */
312   void* pfnSERCOM3_1_Handler;             /* 59 Serial Communication Interface 3 IRQ 1 */
313   void* pfnSERCOM3_2_Handler;             /* 60 Serial Communication Interface 3 IRQ 2 */
314   void* pfnSERCOM3_3_Handler;             /* 61 Serial Communication Interface 3 IRQ 3 */
315   void* pfnSERCOM4_0_Handler;             /* 62 Serial Communication Interface 4 IRQ 0 */
316   void* pfnSERCOM4_1_Handler;             /* 63 Serial Communication Interface 4 IRQ 1 */
317   void* pfnSERCOM4_2_Handler;             /* 64 Serial Communication Interface 4 IRQ 2 */
318   void* pfnSERCOM4_3_Handler;             /* 65 Serial Communication Interface 4 IRQ 3 */
319   void* pfnSERCOM5_0_Handler;             /* 66 Serial Communication Interface 5 IRQ 0 */
320   void* pfnSERCOM5_1_Handler;             /* 67 Serial Communication Interface 5 IRQ 1 */
321   void* pfnSERCOM5_2_Handler;             /* 68 Serial Communication Interface 5 IRQ 2 */
322   void* pfnSERCOM5_3_Handler;             /* 69 Serial Communication Interface 5 IRQ 3 */
323   void* pvReserved70;
324   void* pvReserved71;
325   void* pvReserved72;
326   void* pvReserved73;
327   void* pvReserved74;
328   void* pvReserved75;
329   void* pvReserved76;
330   void* pvReserved77;
331   void* pvReserved78;
332   void* pvReserved79;
333   void* pfnUSB_0_Handler;                 /* 80 Universal Serial Bus IRQ 0 */
334   void* pfnUSB_1_Handler;                 /* 81 Universal Serial Bus IRQ 1 */
335   void* pfnUSB_2_Handler;                 /* 82 Universal Serial Bus IRQ 2 */
336   void* pfnUSB_3_Handler;                 /* 83 Universal Serial Bus IRQ 3 */
337   void* pvReserved84;
338   void* pfnTCC0_0_Handler;                /* 85 Timer Counter Control 0 IRQ 0 */
339   void* pfnTCC0_1_Handler;                /* 86 Timer Counter Control 0 IRQ 1 */
340   void* pfnTCC0_2_Handler;                /* 87 Timer Counter Control 0 IRQ 2 */
341   void* pfnTCC0_3_Handler;                /* 88 Timer Counter Control 0 IRQ 3 */
342   void* pfnTCC0_4_Handler;                /* 89 Timer Counter Control 0 IRQ 4 */
343   void* pfnTCC0_5_Handler;                /* 90 Timer Counter Control 0 IRQ 5 */
344   void* pfnTCC0_6_Handler;                /* 91 Timer Counter Control 0 IRQ 6 */
345   void* pfnTCC1_0_Handler;                /* 92 Timer Counter Control 1 IRQ 0 */
346   void* pfnTCC1_1_Handler;                /* 93 Timer Counter Control 1 IRQ 1 */
347   void* pfnTCC1_2_Handler;                /* 94 Timer Counter Control 1 IRQ 2 */
348   void* pfnTCC1_3_Handler;                /* 95 Timer Counter Control 1 IRQ 3 */
349   void* pfnTCC1_4_Handler;                /* 96 Timer Counter Control 1 IRQ 4 */
350   void* pfnTCC2_0_Handler;                /* 97 Timer Counter Control 2 IRQ 0 */
351   void* pfnTCC2_1_Handler;                /* 98 Timer Counter Control 2 IRQ 1 */
352   void* pfnTCC2_2_Handler;                /* 99 Timer Counter Control 2 IRQ 2 */
353   void* pfnTCC2_3_Handler;                /* 100 Timer Counter Control 2 IRQ 3 */
354   void* pfnTCC3_0_Handler;                /* 101 Timer Counter Control 3 IRQ 0 */
355   void* pfnTCC3_1_Handler;                /* 102 Timer Counter Control 3 IRQ 1 */
356   void* pfnTCC3_2_Handler;                /* 103 Timer Counter Control 3 IRQ 2 */
357   void* pfnTCC4_0_Handler;                /* 104 Timer Counter Control 4 IRQ 0 */
358   void* pfnTCC4_1_Handler;                /* 105 Timer Counter Control 4 IRQ 1 */
359   void* pfnTCC4_2_Handler;                /* 106 Timer Counter Control 4 IRQ 2 */
360   void* pfnTC0_Handler;                   /* 107 Basic Timer Counter 0 */
361   void* pfnTC1_Handler;                   /* 108 Basic Timer Counter 1 */
362   void* pfnTC2_Handler;                   /* 109 Basic Timer Counter 2 */
363   void* pfnTC3_Handler;                   /* 110 Basic Timer Counter 3 */
364   void* pfnTC4_Handler;                   /* 111 Basic Timer Counter 4 */
365   void* pfnTC5_Handler;                   /* 112 Basic Timer Counter 5 */
366   void* pvReserved113;
367   void* pvReserved114;
368   void* pfnPDEC_0_Handler;                /* 115 Quadrature Decodeur IRQ 0 */
369   void* pfnPDEC_1_Handler;                /* 116 Quadrature Decodeur IRQ 1 */
370   void* pfnPDEC_2_Handler;                /* 117 Quadrature Decodeur IRQ 2 */
371   void* pfnADC0_0_Handler;                /* 118 Analog Digital Converter 0 IRQ 0 */
372   void* pfnADC0_1_Handler;                /* 119 Analog Digital Converter 0 IRQ 1 */
373   void* pfnADC1_0_Handler;                /* 120 Analog Digital Converter 1 IRQ 0 */
374   void* pfnADC1_1_Handler;                /* 121 Analog Digital Converter 1 IRQ 1 */
375   void* pfnAC_Handler;                    /* 122 Analog Comparators */
376   void* pfnDAC_0_Handler;                 /* 123 Digital-to-Analog Converter IRQ 0 */
377   void* pfnDAC_1_Handler;                 /* 124 Digital-to-Analog Converter IRQ 1 */
378   void* pfnDAC_2_Handler;                 /* 125 Digital-to-Analog Converter IRQ 2 */
379   void* pfnDAC_3_Handler;                 /* 126 Digital-to-Analog Converter IRQ 3 */
380   void* pfnDAC_4_Handler;                 /* 127 Digital-to-Analog Converter IRQ 4 */
381   void* pfnI2S_Handler;                   /* 128 Inter-IC Sound Interface */
382   void* pfnPCC_Handler;                   /* 129 Parallel Capture Controller */
383   void* pfnAES_Handler;                   /* 130 Advanced Encryption Standard */
384   void* pfnTRNG_Handler;                  /* 131 True Random Generator */
385   void* pfnICM_Handler;                   /* 132 Integrity Check Monitor */
386   void* pfnPUKCC_Handler;                 /* 133 PUblic-Key Cryptography Controller */
387   void* pfnQSPI_Handler;                  /* 134 Quad SPI interface */
388   void* pfnSDHC0_Handler;                 /* 135 SD/MMC Host Controller 0 */
389   void* pvReserved136;
390 } DeviceVectors;
391
392 /* Cortex-M4 processor handlers */
393 void Reset_Handler               ( void );
394 void NMI_Handler                 ( void );
395 void HardFault_Handler           ( void );
396 void MemManage_Handler           ( void );
397 void BusFault_Handler            ( void );
398 void UsageFault_Handler          ( void );
399 void SVC_Handler                 ( void );
400 void DebugMon_Handler            ( void );
401 void PendSV_Handler              ( void );
402 void SysTick_Handler             ( void );
403
404 /* Peripherals handlers */
405 void PM_Handler                  ( void );
406 void MCLK_Handler                ( void );
407 void OSCCTRL_0_Handler           ( void );
408 void OSCCTRL_1_Handler           ( void );
409 void OSCCTRL_2_Handler           ( void );
410 void OSCCTRL_3_Handler           ( void );
411 void OSCCTRL_4_Handler           ( void );
412 void OSC32KCTRL_Handler          ( void );
413 void SUPC_0_Handler              ( void );
414 void SUPC_1_Handler              ( void );
415 void WDT_Handler                 ( void );
416 void RTC_Handler                 ( void );
417 void EIC_0_Handler               ( void );
418 void EIC_1_Handler               ( void );
419 void EIC_2_Handler               ( void );
420 void EIC_3_Handler               ( void );
421 void EIC_4_Handler               ( void );
422 void EIC_5_Handler               ( void );
423 void EIC_6_Handler               ( void );
424 void EIC_7_Handler               ( void );
425 void EIC_8_Handler               ( void );
426 void EIC_9_Handler               ( void );
427 void EIC_10_Handler              ( void );
428 void EIC_11_Handler              ( void );
429 void EIC_12_Handler              ( void );
430 void EIC_13_Handler              ( void );
431 void EIC_14_Handler              ( void );
432 void EIC_15_Handler              ( void );
433 void FREQM_Handler               ( void );
434 void NVMCTRL_0_Handler           ( void );
435 void NVMCTRL_1_Handler           ( void );
436 void DMAC_0_Handler              ( void );
437 void DMAC_1_Handler              ( void );
438 void DMAC_2_Handler              ( void );
439 void DMAC_3_Handler              ( void );
440 void DMAC_4_Handler              ( void );
441 void EVSYS_0_Handler             ( void );
442 void EVSYS_1_Handler             ( void );
443 void EVSYS_2_Handler             ( void );
444 void EVSYS_3_Handler             ( void );
445 void EVSYS_4_Handler             ( void );
446 void PAC_Handler                 ( void );
447 void TAL_0_Handler               ( void );
448 void TAL_1_Handler               ( void );
449 void RAMECC_Handler              ( void );
450 void SERCOM0_0_Handler           ( void );
451 void SERCOM0_1_Handler           ( void );
452 void SERCOM0_2_Handler           ( void );
453 void SERCOM0_3_Handler           ( void );
454 void SERCOM1_0_Handler           ( void );
455 void SERCOM1_1_Handler           ( void );
456 void SERCOM1_2_Handler           ( void );
457 void SERCOM1_3_Handler           ( void );
458 void SERCOM2_0_Handler           ( void );
459 void SERCOM2_1_Handler           ( void );
460 void SERCOM2_2_Handler           ( void );
461 void SERCOM2_3_Handler           ( void );
462 void SERCOM3_0_Handler           ( void );
463 void SERCOM3_1_Handler           ( void );
464 void SERCOM3_2_Handler           ( void );
465 void SERCOM3_3_Handler           ( void );
466 void SERCOM4_0_Handler           ( void );
467 void SERCOM4_1_Handler           ( void );
468 void SERCOM4_2_Handler           ( void );
469 void SERCOM4_3_Handler           ( void );
470 void SERCOM5_0_Handler           ( void );
471 void SERCOM5_1_Handler           ( void );
472 void SERCOM5_2_Handler           ( void );
473 void SERCOM5_3_Handler           ( void );
474 void USB_0_Handler               ( void );
475 void USB_1_Handler               ( void );
476 void USB_2_Handler               ( void );
477 void USB_3_Handler               ( void );
478 void TCC0_0_Handler              ( void );
479 void TCC0_1_Handler              ( void );
480 void TCC0_2_Handler              ( void );
481 void TCC0_3_Handler              ( void );
482 void TCC0_4_Handler              ( void );
483 void TCC0_5_Handler              ( void );
484 void TCC0_6_Handler              ( void );
485 void TCC1_0_Handler              ( void );
486 void TCC1_1_Handler              ( void );
487 void TCC1_2_Handler              ( void );
488 void TCC1_3_Handler              ( void );
489 void TCC1_4_Handler              ( void );
490 void TCC2_0_Handler              ( void );
491 void TCC2_1_Handler              ( void );
492 void TCC2_2_Handler              ( void );
493 void TCC2_3_Handler              ( void );
494 void TCC3_0_Handler              ( void );
495 void TCC3_1_Handler              ( void );
496 void TCC3_2_Handler              ( void );
497 void TCC4_0_Handler              ( void );
498 void TCC4_1_Handler              ( void );
499 void TCC4_2_Handler              ( void );
500 void TC0_Handler                 ( void );
501 void TC1_Handler                 ( void );
502 void TC2_Handler                 ( void );
503 void TC3_Handler                 ( void );
504 void TC4_Handler                 ( void );
505 void TC5_Handler                 ( void );
506 void PDEC_0_Handler              ( void );
507 void PDEC_1_Handler              ( void );
508 void PDEC_2_Handler              ( void );
509 void ADC0_0_Handler              ( void );
510 void ADC0_1_Handler              ( void );
511 void ADC1_0_Handler              ( void );
512 void ADC1_1_Handler              ( void );
513 void AC_Handler                  ( void );
514 void DAC_0_Handler               ( void );
515 void DAC_1_Handler               ( void );
516 void DAC_2_Handler               ( void );
517 void DAC_3_Handler               ( void );
518 void DAC_4_Handler               ( void );
519 void I2S_Handler                 ( void );
520 void PCC_Handler                 ( void );
521 void AES_Handler                 ( void );
522 void TRNG_Handler                ( void );
523 void ICM_Handler                 ( void );
524 void PUKCC_Handler               ( void );
525 void QSPI_Handler                ( void );
526 void SDHC0_Handler               ( void );
527
528 /*
529  * \brief Configuration of the Cortex-M4 Processor and Core Peripherals
530  */
531
532 #define LITTLE_ENDIAN          1        
533 #define __CM4_REV              1         /*!< Core revision r0p1 */
534 #define __DEBUG_LVL            3         /*!< Full debug plus DWT data matching */
535 #define __FPU_PRESENT          1         /*!< FPU present or not */
536 #define __MPU_PRESENT          1         /*!< MPU present or not */
537 #define __NVIC_PRIO_BITS       3         /*!< Number of bits used for Priority Levels */
538 #define __TRACE_LVL            2         /*!< Full trace: ITM, DWT triggers and counters, ETM */
539 #define __VTOR_PRESENT         1         /*!< VTOR present or not */
540 #define __Vendor_SysTickConfig 0         /*!< Set to 1 if different SysTick Config is used */
541
542 /**
543  * \brief CMSIS includes
544  */
545
546 #include <core_cm4.h>
547 #if !defined DONT_USE_CMSIS_INIT
548 #include "system_samd51.h"
549 #endif /* DONT_USE_CMSIS_INIT */
550
551 /*@}*/
552
553 /* ************************************************************************** */
554 /**  SOFTWARE PERIPHERAL API DEFINITION FOR SAMD51J18A */
555 /* ************************************************************************** */
556 /** \defgroup SAMD51J18A_api Peripheral Software API */
557 /*@{*/
558
559 #include "component/ac.h"
560 #include "component/adc.h"
561 #include "component/aes.h"
562 #include "component/ccl.h"
563 #include "component/cmcc.h"
564 #include "component/dac.h"
565 #include "component/dmac.h"
566 #include "component/dsu.h"
567 #include "component/eic.h"
568 #include "component/evsys.h"
569 #include "component/freqm.h"
570 #include "component/gclk.h"
571 #include "component/hmatrixb.h"
572 #include "component/icm.h"
573 #include "component/i2s.h"
574 #include "component/mclk.h"
575 #include "component/nvmctrl.h"
576 #include "component/oscctrl.h"
577 #include "component/osc32kctrl.h"
578 #include "component/pac.h"
579 #include "component/pcc.h"
580 #include "component/pdec.h"
581 #include "component/pm.h"
582 #include "component/port.h"
583 #include "component/qspi.h"
584 #include "component/ramecc.h"
585 #include "component/rstc.h"
586 #include "component/rtc.h"
587 #include "component/sdhc.h"
588 #include "component/sercom.h"
589 #include "component/supc.h"
590 #include "component/tal.h"
591 #include "component/tc.h"
592 #include "component/tcc.h"
593 #include "component/trng.h"
594 #include "component/usb.h"
595 #include "component/wdt.h"
596 /*@}*/
597
598 /* ************************************************************************** */
599 /**  REGISTERS ACCESS DEFINITIONS FOR SAMD51J18A */
600 /* ************************************************************************** */
601 /** \defgroup SAMD51J18A_reg Registers Access Definitions */
602 /*@{*/
603
604 #include "instance/ac.h"
605 #include "instance/adc0.h"
606 #include "instance/adc1.h"
607 #include "instance/aes.h"
608 #include "instance/ccl.h"
609 #include "instance/cmcc.h"
610 #include "instance/dac.h"
611 #include "instance/dmac.h"
612 #include "instance/dsu.h"
613 #include "instance/eic.h"
614 #include "instance/evsys.h"
615 #include "instance/freqm.h"
616 #include "instance/gclk.h"
617 #include "instance/hmatrix.h"
618 #include "instance/icm.h"
619 #include "instance/i2s.h"
620 #include "instance/mclk.h"
621 #include "instance/nvmctrl.h"
622 #include "instance/oscctrl.h"
623 #include "instance/osc32kctrl.h"
624 #include "instance/pac.h"
625 #include "instance/pcc.h"
626 #include "instance/pdec.h"
627 #include "instance/pm.h"
628 #include "instance/port.h"
629 #include "instance/qspi.h"
630 #include "instance/ramecc.h"
631 #include "instance/rstc.h"
632 #include "instance/rtc.h"
633 #include "instance/sdhc0.h"
634 #include "instance/sercom0.h"
635 #include "instance/sercom1.h"
636 #include "instance/sercom2.h"
637 #include "instance/sercom3.h"
638 #include "instance/sercom4.h"
639 #include "instance/sercom5.h"
640 #include "instance/supc.h"
641 #include "instance/tal.h"
642 #include "instance/tc0.h"
643 #include "instance/tc1.h"
644 #include "instance/tc2.h"
645 #include "instance/tc3.h"
646 #include "instance/tc4.h"
647 #include "instance/tc5.h"
648 #include "instance/tcc0.h"
649 #include "instance/tcc1.h"
650 #include "instance/tcc2.h"
651 #include "instance/tcc3.h"
652 #include "instance/tcc4.h"
653 #include "instance/trng.h"
654 #include "instance/usb.h"
655 #include "instance/wdt.h"
656 /*@}*/
657
658 /* ************************************************************************** */
659 /**  PERIPHERAL ID DEFINITIONS FOR SAMD51J18A */
660 /* ************************************************************************** */
661 /** \defgroup SAMD51J18A_id Peripheral Ids Definitions */
662 /*@{*/
663
664 // Peripheral instances on HPB0 bridge
665 #define ID_PAC            0 /**< \brief Peripheral Access Controller (PAC) */
666 #define ID_PM             1 /**< \brief Power Manager (PM) */
667 #define ID_MCLK           2 /**< \brief Main Clock (MCLK) */
668 #define ID_RSTC           3 /**< \brief Reset Controller (RSTC) */
669 #define ID_OSCCTRL        4 /**< \brief Oscillators Control (OSCCTRL) */
670 #define ID_OSC32KCTRL     5 /**< \brief 32kHz Oscillators Control (OSC32KCTRL) */
671 #define ID_SUPC           6 /**< \brief Supply Controller (SUPC) */
672 #define ID_GCLK           7 /**< \brief Generic Clock Generator (GCLK) */
673 #define ID_WDT            8 /**< \brief Watchdog Timer (WDT) */
674 #define ID_RTC            9 /**< \brief Real-Time Counter (RTC) */
675 #define ID_EIC           10 /**< \brief External Interrupt Controller (EIC) */
676 #define ID_FREQM         11 /**< \brief Frequency Meter (FREQM) */
677 #define ID_SERCOM0       12 /**< \brief Serial Communication Interface 0 (SERCOM0) */
678 #define ID_SERCOM1       13 /**< \brief Serial Communication Interface 1 (SERCOM1) */
679 #define ID_TC0           14 /**< \brief Basic Timer Counter 0 (TC0) */
680 #define ID_TC1           15 /**< \brief Basic Timer Counter 1 (TC1) */
681
682 // Peripheral instances on HPB1 bridge
683 #define ID_USB           32 /**< \brief Universal Serial Bus (USB) */
684 #define ID_DSU           33 /**< \brief Device Service Unit (DSU) */
685 #define ID_NVMCTRL       34 /**< \brief Non-Volatile Memory Controller (NVMCTRL) */
686 #define ID_CMCC          35 /**< \brief Cortex M Cache Controller (CMCC) */
687 #define ID_PORT          36 /**< \brief Port Module (PORT) */
688 #define ID_DMAC          37 /**< \brief Direct Memory Access Controller (DMAC) */
689 #define ID_HMATRIX       38 /**< \brief HSB Matrix (HMATRIX) */
690 #define ID_EVSYS         39 /**< \brief Event System Interface (EVSYS) */
691 #define ID_SERCOM2       41 /**< \brief Serial Communication Interface 2 (SERCOM2) */
692 #define ID_SERCOM3       42 /**< \brief Serial Communication Interface 3 (SERCOM3) */
693 #define ID_TCC0          43 /**< \brief Timer Counter Control 0 (TCC0) */
694 #define ID_TCC1          44 /**< \brief Timer Counter Control 1 (TCC1) */
695 #define ID_TC2           45 /**< \brief Basic Timer Counter 2 (TC2) */
696 #define ID_TC3           46 /**< \brief Basic Timer Counter 3 (TC3) */
697 #define ID_TAL           47 /**< \brief Trigger Allocator (TAL) */
698 #define ID_RAMECC        48 /**< \brief RAM ECC (RAMECC) */
699 #define ID_TCC2          67 /**< \brief Timer Counter Control 2 (TCC2) */
700 #define ID_TCC3          68 /**< \brief Timer Counter Control 3 (TCC3) */
701 #define ID_TC4           69 /**< \brief Basic Timer Counter 4 (TC4) */
702 #define ID_TC5           70 /**< \brief Basic Timer Counter 5 (TC5) */
703 #define ID_PDEC          71 /**< \brief Quadrature Decodeur (PDEC) */
704 #define ID_AC            72 /**< \brief Analog Comparators (AC) */
705 #define ID_AES           73 /**< \brief Advanced Encryption Standard (AES) */
706 #define ID_TRNG          74 /**< \brief True Random Generator (TRNG) */
707 #define ID_ICM           75 /**< \brief Integrity Check Monitor (ICM) */
708 #define ID_PUKCC         76 /**< \brief PUblic-Key Cryptography Controller (PUKCC) */
709 #define ID_QSPI          77 /**< \brief Quad SPI interface (QSPI) */
710 #define ID_CCL           78 /**< \brief Configurable Custom Logic (CCL) */
711
712 // Peripheral instances on HPB3 bridge
713 #define ID_SERCOM4       96 /**< \brief Serial Communication Interface 4 (SERCOM4) */
714 #define ID_SERCOM5       97 /**< \brief Serial Communication Interface 5 (SERCOM5) */
715 #define ID_TCC4         100 /**< \brief Timer Counter Control 4 (TCC4) */
716 #define ID_ADC0         103 /**< \brief Analog Digital Converter 0 (ADC0) */
717 #define ID_ADC1         104 /**< \brief Analog Digital Converter 1 (ADC1) */
718 #define ID_DAC          105 /**< \brief Digital-to-Analog Converter (DAC) */
719 #define ID_I2S          106 /**< \brief Inter-IC Sound Interface (I2S) */
720 #define ID_PCC          107 /**< \brief Parallel Capture Controller (PCC) */
721
722 // Peripheral instances on AHB (as if on bridge 4)
723 #define ID_SDHC0        128 /**< \brief SD/MMC Host Controller (SDHC0) */
724
725 #define ID_PERIPH_COUNT 129 /**< \brief Max number of peripheral IDs */
726 /*@}*/
727
728 /* ************************************************************************** */
729 /**  BASE ADDRESS DEFINITIONS FOR SAMD51J18A */
730 /* ************************************************************************** */
731 /** \defgroup SAMD51J18A_base Peripheral Base Address Definitions */
732 /*@{*/
733
734 #if defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)
735 #define AC                            (0x42002000) /**< \brief (AC) APB Base Address */
736 #define ADC0                          (0x43001C00) /**< \brief (ADC0) APB Base Address */
737 #define ADC1                          (0x43002000) /**< \brief (ADC1) APB Base Address */
738 #define AES                           (0x42002400) /**< \brief (AES) APB Base Address */
739 #define CCL                           (0x42003800) /**< \brief (CCL) APB Base Address */
740 #define CMCC                          (0x41006000) /**< \brief (CMCC) APB Base Address */
741 #define CMCC_AHB                      (0x03000000) /**< \brief (CMCC) AHB Base Address */
742 #define DAC                           (0x43002400) /**< \brief (DAC) APB Base Address */
743 #define DMAC                          (0x4100A000) /**< \brief (DMAC) APB Base Address */
744 #define DSU                           (0x41002000) /**< \brief (DSU) APB Base Address */
745 #define EIC                           (0x40002800) /**< \brief (EIC) APB Base Address */
746 #define EVSYS                         (0x4100E000) /**< \brief (EVSYS) APB Base Address */
747 #define FREQM                         (0x40002C00) /**< \brief (FREQM) APB Base Address */
748 #define GCLK                          (0x40001C00) /**< \brief (GCLK) APB Base Address */
749 #define HMATRIX                       (0x4100C000) /**< \brief (HMATRIX) APB Base Address */
750 #define ICM                           (0x42002C00) /**< \brief (ICM) APB Base Address */
751 #define I2S                           (0x43002800) /**< \brief (I2S) APB Base Address */
752 #define MCLK                          (0x40000800) /**< \brief (MCLK) APB Base Address */
753 #define NVMCTRL                       (0x41004000) /**< \brief (NVMCTRL) APB Base Address */
754 #define NVMCTRL_CB                    (0x00800000) /**< \brief (NVMCTRL) CB Base Address */
755 #define NVMCTRL_CBW0                  (0x00800000) /**< \brief (NVMCTRL) CBW0 Base Address */
756 #define NVMCTRL_CBW1                  (0x00800010) /**< \brief (NVMCTRL) CBW1 Base Address */
757 #define NVMCTRL_CBW2                  (0x00800020) /**< \brief (NVMCTRL) CBW2 Base Address */
758 #define NVMCTRL_CBW3                  (0x00800030) /**< \brief (NVMCTRL) CBW3 Base Address */
759 #define NVMCTRL_CBW4                  (0x00800040) /**< \brief (NVMCTRL) CBW4 Base Address */
760 #define NVMCTRL_CBW5                  (0x00800050) /**< \brief (NVMCTRL) CBW5 Base Address */
761 #define NVMCTRL_CBW6                  (0x00800060) /**< \brief (NVMCTRL) CBW6 Base Address */
762 #define NVMCTRL_CBW7                  (0x00800070) /**< \brief (NVMCTRL) CBW7 Base Address */
763 #define NVMCTRL_FS                    (0x00806000) /**< \brief (NVMCTRL) FS Base Address */
764 #define NVMCTRL_SW0                   (0x00800080) /**< \brief (NVMCTRL) SW0 Base Address */
765 #define NVMCTRL_SW1                   (0x00800090) /**< \brief (NVMCTRL) SW1 Base Address */
766 #define NVMCTRL_SW2                   (0x008000A0) /**< \brief (NVMCTRL) SW2 Base Address */
767 #define NVMCTRL_SW3                   (0x008000B0) /**< \brief (NVMCTRL) SW3 Base Address */
768 #define NVMCTRL_SW4                   (0x008000C0) /**< \brief (NVMCTRL) SW4 Base Address */
769 #define NVMCTRL_SW5                   (0x008000D0) /**< \brief (NVMCTRL) SW5 Base Address */
770 #define NVMCTRL_SW6                   (0x008000E0) /**< \brief (NVMCTRL) SW6 Base Address */
771 #define NVMCTRL_SW7                   (0x008000F0) /**< \brief (NVMCTRL) SW7 Base Address */
772 #define NVMCTRL_TEMP_LOG              (0x00800100) /**< \brief (NVMCTRL) TEMP_LOG Base Address */
773 #define NVMCTRL_TEMP_LOG_W0           (0x00800100) /**< \brief (NVMCTRL) TEMP_LOG_W0 Base Address */
774 #define NVMCTRL_TEMP_LOG_W1           (0x00800110) /**< \brief (NVMCTRL) TEMP_LOG_W1 Base Address */
775 #define NVMCTRL_TEMP_LOG_W2           (0x00800120) /**< \brief (NVMCTRL) TEMP_LOG_W2 Base Address */
776 #define NVMCTRL_TEMP_LOG_W3           (0x00800130) /**< \brief (NVMCTRL) TEMP_LOG_W3 Base Address */
777 #define NVMCTRL_TEMP_LOG_W4           (0x00800140) /**< \brief (NVMCTRL) TEMP_LOG_W4 Base Address */
778 #define NVMCTRL_TEMP_LOG_W5           (0x00800150) /**< \brief (NVMCTRL) TEMP_LOG_W5 Base Address */
779 #define NVMCTRL_TEMP_LOG_W6           (0x00800160) /**< \brief (NVMCTRL) TEMP_LOG_W6 Base Address */
780 #define NVMCTRL_TEMP_LOG_W7           (0x00800170) /**< \brief (NVMCTRL) TEMP_LOG_W7 Base Address */
781 #define NVMCTRL_TLATCH                (0x00802000) /**< \brief (NVMCTRL) TLATCH Base Address */
782 #define NVMCTRL_USER                  (0x00804000) /**< \brief (NVMCTRL) USER Base Address */
783 #define OSCCTRL                       (0x40001000) /**< \brief (OSCCTRL) APB Base Address */
784 #define OSC32KCTRL                    (0x40001400) /**< \brief (OSC32KCTRL) APB Base Address */
785 #define PAC                           (0x40000000) /**< \brief (PAC) APB Base Address */
786 #define PCC                           (0x43002C00) /**< \brief (PCC) APB Base Address */
787 #define PDEC                          (0x42001C00) /**< \brief (PDEC) APB Base Address */
788 #define PM                            (0x40000400) /**< \brief (PM) APB Base Address */
789 #define PORT                          (0x41008000) /**< \brief (PORT) APB Base Address */
790 #define PUKCC                         (0x42003000) /**< \brief (PUKCC) APB Base Address */
791 #define PUKCC_AHB                     (0x02000000) /**< \brief (PUKCC) AHB Base Address */
792 #define QSPI                          (0x42003400) /**< \brief (QSPI) APB Base Address */
793 #define QSPI_AHB                      (0x04000000) /**< \brief (QSPI) AHB Base Address */
794 #define RAMECC                        (0x41020000) /**< \brief (RAMECC) APB Base Address */
795 #define RSTC                          (0x40000C00) /**< \brief (RSTC) APB Base Address */
796 #define RTC                           (0x40002400) /**< \brief (RTC) APB Base Address */
797 #define SDHC0                         (0x45000000) /**< \brief (SDHC0) AHB Base Address */
798 #define SERCOM0                       (0x40003000) /**< \brief (SERCOM0) APB Base Address */
799 #define SERCOM1                       (0x40003400) /**< \brief (SERCOM1) APB Base Address */
800 #define SERCOM2                       (0x41012000) /**< \brief (SERCOM2) APB Base Address */
801 #define SERCOM3                       (0x41014000) /**< \brief (SERCOM3) APB Base Address */
802 #define SERCOM4                       (0x43000000) /**< \brief (SERCOM4) APB Base Address */
803 #define SERCOM5                       (0x43000400) /**< \brief (SERCOM5) APB Base Address */
804 #define SUPC                          (0x40001800) /**< \brief (SUPC) APB Base Address */
805 #define TAL                           (0x4101E000) /**< \brief (TAL) APB Base Address */
806 #define TC0                           (0x40003800) /**< \brief (TC0) APB Base Address */
807 #define TC1                           (0x40003C00) /**< \brief (TC1) APB Base Address */
808 #define TC2                           (0x4101A000) /**< \brief (TC2) APB Base Address */
809 #define TC3                           (0x4101C000) /**< \brief (TC3) APB Base Address */
810 #define TC4                           (0x42001400) /**< \brief (TC4) APB Base Address */
811 #define TC5                           (0x42001800) /**< \brief (TC5) APB Base Address */
812 #define TCC0                          (0x41016000) /**< \brief (TCC0) APB Base Address */
813 #define TCC1                          (0x41018000) /**< \brief (TCC1) APB Base Address */
814 #define TCC2                          (0x42000C00) /**< \brief (TCC2) APB Base Address */
815 #define TCC3                          (0x42001000) /**< \brief (TCC3) APB Base Address */
816 #define TCC4                          (0x43001000) /**< \brief (TCC4) APB Base Address */
817 #define TRNG                          (0x42002800) /**< \brief (TRNG) APB Base Address */
818 #define USB                           (0x41000000) /**< \brief (USB) APB Base Address */
819 #define WDT                           (0x40002000) /**< \brief (WDT) APB Base Address */
820 #else
821 #define AC                ((Ac       *)0x42002000UL) /**< \brief (AC) APB Base Address */
822 #define AC_INST_NUM       1                          /**< \brief (AC) Number of instances */
823 #define AC_INSTS          { AC }                     /**< \brief (AC) Instances List */
824
825 #define ADC0              ((Adc      *)0x43001C00UL) /**< \brief (ADC0) APB Base Address */
826 #define ADC1              ((Adc      *)0x43002000UL) /**< \brief (ADC1) APB Base Address */
827 #define ADC_INST_NUM      2                          /**< \brief (ADC) Number of instances */
828 #define ADC_INSTS         { ADC0, ADC1 }             /**< \brief (ADC) Instances List */
829
830 #define AES               ((Aes      *)0x42002400UL) /**< \brief (AES) APB Base Address */
831 #define AES_INST_NUM      1                          /**< \brief (AES) Number of instances */
832 #define AES_INSTS         { AES }                    /**< \brief (AES) Instances List */
833
834 #define CCL               ((Ccl      *)0x42003800UL) /**< \brief (CCL) APB Base Address */
835 #define CCL_INST_NUM      1                          /**< \brief (CCL) Number of instances */
836 #define CCL_INSTS         { CCL }                    /**< \brief (CCL) Instances List */
837
838 #define CMCC              ((Cmcc     *)0x41006000UL) /**< \brief (CMCC) APB Base Address */
839 #define CMCC_AHB                      (0x03000000UL) /**< \brief (CMCC) AHB Base Address */
840 #define CMCC_INST_NUM     1                          /**< \brief (CMCC) Number of instances */
841 #define CMCC_INSTS        { CMCC }                   /**< \brief (CMCC) Instances List */
842
843 #define DAC               ((Dac      *)0x43002400UL) /**< \brief (DAC) APB Base Address */
844 #define DAC_INST_NUM      1                          /**< \brief (DAC) Number of instances */
845 #define DAC_INSTS         { DAC }                    /**< \brief (DAC) Instances List */
846
847 #define DMAC              ((Dmac     *)0x4100A000UL) /**< \brief (DMAC) APB Base Address */
848 #define DMAC_INST_NUM     1                          /**< \brief (DMAC) Number of instances */
849 #define DMAC_INSTS        { DMAC }                   /**< \brief (DMAC) Instances List */
850
851 #define DSU               ((Dsu      *)0x41002000UL) /**< \brief (DSU) APB Base Address */
852 #define DSU_INST_NUM      1                          /**< \brief (DSU) Number of instances */
853 #define DSU_INSTS         { DSU }                    /**< \brief (DSU) Instances List */
854
855 #define EIC               ((Eic      *)0x40002800UL) /**< \brief (EIC) APB Base Address */
856 #define EIC_INST_NUM      1                          /**< \brief (EIC) Number of instances */
857 #define EIC_INSTS         { EIC }                    /**< \brief (EIC) Instances List */
858
859 #define EVSYS             ((Evsys    *)0x4100E000UL) /**< \brief (EVSYS) APB Base Address */
860 #define EVSYS_INST_NUM    1                          /**< \brief (EVSYS) Number of instances */
861 #define EVSYS_INSTS       { EVSYS }                  /**< \brief (EVSYS) Instances List */
862
863 #define FREQM             ((Freqm    *)0x40002C00UL) /**< \brief (FREQM) APB Base Address */
864 #define FREQM_INST_NUM    1                          /**< \brief (FREQM) Number of instances */
865 #define FREQM_INSTS       { FREQM }                  /**< \brief (FREQM) Instances List */
866
867 #define GCLK              ((Gclk     *)0x40001C00UL) /**< \brief (GCLK) APB Base Address */
868 #define GCLK_INST_NUM     1                          /**< \brief (GCLK) Number of instances */
869 #define GCLK_INSTS        { GCLK }                   /**< \brief (GCLK) Instances List */
870
871 #define HMATRIX           ((Hmatrixb *)0x4100C000UL) /**< \brief (HMATRIX) APB Base Address */
872 #define HMATRIXB_INST_NUM 1                          /**< \brief (HMATRIXB) Number of instances */
873 #define HMATRIXB_INSTS    { HMATRIX }                /**< \brief (HMATRIXB) Instances List */
874
875 #define ICM               ((Icm      *)0x42002C00UL) /**< \brief (ICM) APB Base Address */
876 #define ICM_INST_NUM      1                          /**< \brief (ICM) Number of instances */
877 #define ICM_INSTS         { ICM }                    /**< \brief (ICM) Instances List */
878
879 #define I2S               ((I2s      *)0x43002800UL) /**< \brief (I2S) APB Base Address */
880 #define I2S_INST_NUM      1                          /**< \brief (I2S) Number of instances */
881 #define I2S_INSTS         { I2S }                    /**< \brief (I2S) Instances List */
882
883 #define MCLK              ((Mclk     *)0x40000800UL) /**< \brief (MCLK) APB Base Address */
884 #define MCLK_INST_NUM     1                          /**< \brief (MCLK) Number of instances */
885 #define MCLK_INSTS        { MCLK }                   /**< \brief (MCLK) Instances List */
886
887 #define NVMCTRL           ((Nvmctrl  *)0x41004000UL) /**< \brief (NVMCTRL) APB Base Address */
888 #define NVMCTRL_CB                    (0x00800000UL) /**< \brief (NVMCTRL) CB Base Address */
889 #define NVMCTRL_CBW0                  (0x00800000UL) /**< \brief (NVMCTRL) CBW0 Base Address */
890 #define NVMCTRL_CBW1                  (0x00800010UL) /**< \brief (NVMCTRL) CBW1 Base Address */
891 #define NVMCTRL_CBW2                  (0x00800020UL) /**< \brief (NVMCTRL) CBW2 Base Address */
892 #define NVMCTRL_CBW3                  (0x00800030UL) /**< \brief (NVMCTRL) CBW3 Base Address */
893 #define NVMCTRL_CBW4                  (0x00800040UL) /**< \brief (NVMCTRL) CBW4 Base Address */
894 #define NVMCTRL_CBW5                  (0x00800050UL) /**< \brief (NVMCTRL) CBW5 Base Address */
895 #define NVMCTRL_CBW6                  (0x00800060UL) /**< \brief (NVMCTRL) CBW6 Base Address */
896 #define NVMCTRL_CBW7                  (0x00800070UL) /**< \brief (NVMCTRL) CBW7 Base Address */
897 #define NVMCTRL_FS                    (0x00806000UL) /**< \brief (NVMCTRL) FS Base Address */
898 #define NVMCTRL_SW0                   (0x00800080UL) /**< \brief (NVMCTRL) SW0 Base Address */
899 #define NVMCTRL_SW1                   (0x00800090UL) /**< \brief (NVMCTRL) SW1 Base Address */
900 #define NVMCTRL_SW2                   (0x008000A0UL) /**< \brief (NVMCTRL) SW2 Base Address */
901 #define NVMCTRL_SW3                   (0x008000B0UL) /**< \brief (NVMCTRL) SW3 Base Address */
902 #define NVMCTRL_SW4                   (0x008000C0UL) /**< \brief (NVMCTRL) SW4 Base Address */
903 #define NVMCTRL_SW5                   (0x008000D0UL) /**< \brief (NVMCTRL) SW5 Base Address */
904 #define NVMCTRL_SW6                   (0x008000E0UL) /**< \brief (NVMCTRL) SW6 Base Address */
905 #define NVMCTRL_SW7                   (0x008000F0UL) /**< \brief (NVMCTRL) SW7 Base Address */
906 #define NVMCTRL_TEMP_LOG              (0x00800100UL) /**< \brief (NVMCTRL) TEMP_LOG Base Address */
907 #define NVMCTRL_TEMP_LOG_W0           (0x00800100UL) /**< \brief (NVMCTRL) TEMP_LOG_W0 Base Address */
908 #define NVMCTRL_TEMP_LOG_W1           (0x00800110UL) /**< \brief (NVMCTRL) TEMP_LOG_W1 Base Address */
909 #define NVMCTRL_TEMP_LOG_W2           (0x00800120UL) /**< \brief (NVMCTRL) TEMP_LOG_W2 Base Address */
910 #define NVMCTRL_TEMP_LOG_W3           (0x00800130UL) /**< \brief (NVMCTRL) TEMP_LOG_W3 Base Address */
911 #define NVMCTRL_TEMP_LOG_W4           (0x00800140UL) /**< \brief (NVMCTRL) TEMP_LOG_W4 Base Address */
912 #define NVMCTRL_TEMP_LOG_W5           (0x00800150UL) /**< \brief (NVMCTRL) TEMP_LOG_W5 Base Address */
913 #define NVMCTRL_TEMP_LOG_W6           (0x00800160UL) /**< \brief (NVMCTRL) TEMP_LOG_W6 Base Address */
914 #define NVMCTRL_TEMP_LOG_W7           (0x00800170UL) /**< \brief (NVMCTRL) TEMP_LOG_W7 Base Address */
915 #define NVMCTRL_TLATCH                (0x00802000UL) /**< \brief (NVMCTRL) TLATCH Base Address */
916 #define NVMCTRL_USER                  (0x00804000UL) /**< \brief (NVMCTRL) USER Base Address */
917 #define NVMCTRL_INST_NUM  1                          /**< \brief (NVMCTRL) Number of instances */
918 #define NVMCTRL_INSTS     { NVMCTRL }                /**< \brief (NVMCTRL) Instances List */
919
920 #define OSCCTRL           ((Oscctrl  *)0x40001000UL) /**< \brief (OSCCTRL) APB Base Address */
921 #define OSCCTRL_INST_NUM  1                          /**< \brief (OSCCTRL) Number of instances */
922 #define OSCCTRL_INSTS     { OSCCTRL }                /**< \brief (OSCCTRL) Instances List */
923
924 #define OSC32KCTRL        ((Osc32kctrl *)0x40001400UL) /**< \brief (OSC32KCTRL) APB Base Address */
925 #define OSC32KCTRL_INST_NUM 1                          /**< \brief (OSC32KCTRL) Number of instances */
926 #define OSC32KCTRL_INSTS  { OSC32KCTRL }             /**< \brief (OSC32KCTRL) Instances List */
927
928 #define PAC               ((Pac      *)0x40000000UL) /**< \brief (PAC) APB Base Address */
929 #define PAC_INST_NUM      1                          /**< \brief (PAC) Number of instances */
930 #define PAC_INSTS         { PAC }                    /**< \brief (PAC) Instances List */
931
932 #define PCC               ((Pcc      *)0x43002C00UL) /**< \brief (PCC) APB Base Address */
933 #define PCC_INST_NUM      1                          /**< \brief (PCC) Number of instances */
934 #define PCC_INSTS         { PCC }                    /**< \brief (PCC) Instances List */
935
936 #define PDEC              ((Pdec     *)0x42001C00UL) /**< \brief (PDEC) APB Base Address */
937 #define PDEC_INST_NUM     1                          /**< \brief (PDEC) Number of instances */
938 #define PDEC_INSTS        { PDEC }                   /**< \brief (PDEC) Instances List */
939
940 #define PM                ((Pm       *)0x40000400UL) /**< \brief (PM) APB Base Address */
941 #define PM_INST_NUM       1                          /**< \brief (PM) Number of instances */
942 #define PM_INSTS          { PM }                     /**< \brief (PM) Instances List */
943
944 #define PORT              ((Port     *)0x41008000UL) /**< \brief (PORT) APB Base Address */
945 #define PORT_INST_NUM     1                          /**< \brief (PORT) Number of instances */
946 #define PORT_INSTS        { PORT }                   /**< \brief (PORT) Instances List */
947
948 #define PUKCC             ((void     *)0x42003000UL) /**< \brief (PUKCC) APB Base Address */
949 #define PUKCC_AHB         ((void     *)0x02000000UL) /**< \brief (PUKCC) AHB Base Address */
950 #define PUKCC_INST_NUM    1                          /**< \brief (PUKCC) Number of instances */
951 #define PUKCC_INSTS       { PUKCC }                  /**< \brief (PUKCC) Instances List */
952
953 #define QSPI              ((Qspi     *)0x42003400UL) /**< \brief (QSPI) APB Base Address */
954 #define QSPI_AHB                      (0x04000000UL) /**< \brief (QSPI) AHB Base Address */
955 #define QSPI_INST_NUM     1                          /**< \brief (QSPI) Number of instances */
956 #define QSPI_INSTS        { QSPI }                   /**< \brief (QSPI) Instances List */
957
958 #define RAMECC            ((Ramecc   *)0x41020000UL) /**< \brief (RAMECC) APB Base Address */
959 #define RAMECC_INST_NUM   1                          /**< \brief (RAMECC) Number of instances */
960 #define RAMECC_INSTS      { RAMECC }                 /**< \brief (RAMECC) Instances List */
961
962 #define RSTC              ((Rstc     *)0x40000C00UL) /**< \brief (RSTC) APB Base Address */
963 #define RSTC_INST_NUM     1                          /**< \brief (RSTC) Number of instances */
964 #define RSTC_INSTS        { RSTC }                   /**< \brief (RSTC) Instances List */
965
966 #define RTC               ((Rtc      *)0x40002400UL) /**< \brief (RTC) APB Base Address */
967 #define RTC_INST_NUM      1                          /**< \brief (RTC) Number of instances */
968 #define RTC_INSTS         { RTC }                    /**< \brief (RTC) Instances List */
969
970 #define SDHC0             ((Sdhc     *)0x45000000UL) /**< \brief (SDHC0) AHB Base Address */
971 #define SDHC_INST_NUM     1                          /**< \brief (SDHC) Number of instances */
972 #define SDHC_INSTS        { SDHC0 }                  /**< \brief (SDHC) Instances List */
973
974 #define SERCOM0           ((Sercom   *)0x40003000UL) /**< \brief (SERCOM0) APB Base Address */
975 #define SERCOM1           ((Sercom   *)0x40003400UL) /**< \brief (SERCOM1) APB Base Address */
976 #define SERCOM2           ((Sercom   *)0x41012000UL) /**< \brief (SERCOM2) APB Base Address */
977 #define SERCOM3           ((Sercom   *)0x41014000UL) /**< \brief (SERCOM3) APB Base Address */
978 #define SERCOM4           ((Sercom   *)0x43000000UL) /**< \brief (SERCOM4) APB Base Address */
979 #define SERCOM5           ((Sercom   *)0x43000400UL) /**< \brief (SERCOM5) APB Base Address */
980 #define SERCOM_INST_NUM   6                          /**< \brief (SERCOM) Number of instances */
981 #define SERCOM_INSTS      { SERCOM0, SERCOM1, SERCOM2, SERCOM3, SERCOM4, SERCOM5 } /**< \brief (SERCOM) Instances List */
982
983 #define SUPC              ((Supc     *)0x40001800UL) /**< \brief (SUPC) APB Base Address */
984 #define SUPC_INST_NUM     1                          /**< \brief (SUPC) Number of instances */
985 #define SUPC_INSTS        { SUPC }                   /**< \brief (SUPC) Instances List */
986
987 #define TAL               ((Tal      *)0x4101E000UL) /**< \brief (TAL) APB Base Address */
988 #define TAL_INST_NUM      1                          /**< \brief (TAL) Number of instances */
989 #define TAL_INSTS         { TAL }                    /**< \brief (TAL) Instances List */
990
991 #define TC0               ((Tc       *)0x40003800UL) /**< \brief (TC0) APB Base Address */
992 #define TC1               ((Tc       *)0x40003C00UL) /**< \brief (TC1) APB Base Address */
993 #define TC2               ((Tc       *)0x4101A000UL) /**< \brief (TC2) APB Base Address */
994 #define TC3               ((Tc       *)0x4101C000UL) /**< \brief (TC3) APB Base Address */
995 #define TC4               ((Tc       *)0x42001400UL) /**< \brief (TC4) APB Base Address */
996 #define TC5               ((Tc       *)0x42001800UL) /**< \brief (TC5) APB Base Address */
997 #define TC_INST_NUM       6                          /**< \brief (TC) Number of instances */
998 #define TC_INSTS          { TC0, TC1, TC2, TC3, TC4, TC5 } /**< \brief (TC) Instances List */
999
1000 #define TCC0              ((Tcc      *)0x41016000UL) /**< \brief (TCC0) APB Base Address */
1001 #define TCC1              ((Tcc      *)0x41018000UL) /**< \brief (TCC1) APB Base Address */
1002 #define TCC2              ((Tcc      *)0x42000C00UL) /**< \brief (TCC2) APB Base Address */
1003 #define TCC3              ((Tcc      *)0x42001000UL) /**< \brief (TCC3) APB Base Address */
1004 #define TCC4              ((Tcc      *)0x43001000UL) /**< \brief (TCC4) APB Base Address */
1005 #define TCC_INST_NUM      5                          /**< \brief (TCC) Number of instances */
1006 #define TCC_INSTS         { TCC0, TCC1, TCC2, TCC3, TCC4 } /**< \brief (TCC) Instances List */
1007
1008 #define TRNG              ((Trng     *)0x42002800UL) /**< \brief (TRNG) APB Base Address */
1009 #define TRNG_INST_NUM     1                          /**< \brief (TRNG) Number of instances */
1010 #define TRNG_INSTS        { TRNG }                   /**< \brief (TRNG) Instances List */
1011
1012 #define USB               ((Usb      *)0x41000000UL) /**< \brief (USB) APB Base Address */
1013 #define USB_INST_NUM      1                          /**< \brief (USB) Number of instances */
1014 #define USB_INSTS         { USB }                    /**< \brief (USB) Instances List */
1015
1016 #define WDT               ((Wdt      *)0x40002000UL) /**< \brief (WDT) APB Base Address */
1017 #define WDT_INST_NUM      1                          /**< \brief (WDT) Number of instances */
1018 #define WDT_INSTS         { WDT }                    /**< \brief (WDT) Instances List */
1019
1020 #endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
1021 /*@}*/
1022
1023 /* ************************************************************************** */
1024 /**  PORT DEFINITIONS FOR SAMD51J18A */
1025 /* ************************************************************************** */
1026 /** \defgroup SAMD51J18A_port PORT Definitions */
1027 /*@{*/
1028
1029 #include "pio/samd51j18a.h"
1030 /*@}*/
1031
1032 /* ************************************************************************** */
1033 /**  MEMORY MAPPING DEFINITIONS FOR SAMD51J18A */
1034 /* ************************************************************************** */
1035
1036 #define HSRAM_SIZE            _UL_(0x00020000) /* 128 kB */
1037 #define FLASH_SIZE            _UL_(0x00040000) /* 256 kB */
1038 #define FLASH_PAGE_SIZE       512
1039 #define FLASH_NB_OF_PAGES     512
1040 #define FLASH_USER_PAGE_SIZE  512
1041 #define BKUPRAM_SIZE          _UL_(0x00002000) /* 8 kB */
1042 #define QSPI_SIZE             _UL_(0x01000000) /* 16384 kB */
1043
1044 #define FLASH_ADDR            _UL_(0x00000000) /**< FLASH base address */
1045 #define CMCC_DATARAM_ADDR     _UL_(0x03000000) /**< CMCC_DATARAM base address */
1046 #define CMCC_DATARAM_SIZE     _UL_(0x00001000) /**< CMCC_DATARAM size */
1047 #define CMCC_TAGRAM_ADDR      _UL_(0x03001000) /**< CMCC_TAGRAM base address */
1048 #define CMCC_TAGRAM_SIZE      _UL_(0x00000400) /**< CMCC_TAGRAM size */
1049 #define CMCC_VALIDRAM_ADDR    _UL_(0x03002000) /**< CMCC_VALIDRAM base address */
1050 #define CMCC_VALIDRAM_SIZE    _UL_(0x00000040) /**< CMCC_VALIDRAM size */
1051 #define HSRAM_ADDR            _UL_(0x20000000) /**< HSRAM base address */
1052 #define HSRAM_ETB_ADDR        _UL_(0x20000000) /**< HSRAM_ETB base address */
1053 #define HSRAM_ETB_SIZE        _UL_(0x00008000) /**< HSRAM_ETB size */
1054 #define HSRAM_RET1_ADDR       _UL_(0x20000000) /**< HSRAM_RET1 base address */
1055 #define HSRAM_RET1_SIZE       _UL_(0x00008000) /**< HSRAM_RET1 size */
1056 #define HPB0_ADDR             _UL_(0x40000000) /**< HPB0 base address */
1057 #define HPB1_ADDR             _UL_(0x41000000) /**< HPB1 base address */
1058 #define HPB2_ADDR             _UL_(0x42000000) /**< HPB2 base address */
1059 #define HPB3_ADDR             _UL_(0x43000000) /**< HPB3 base address */
1060 #define SEEPROM_ADDR          _UL_(0x44000000) /**< SEEPROM base address */
1061 #define BKUPRAM_ADDR          _UL_(0x47000000) /**< BKUPRAM base address */
1062 #define PPB_ADDR              _UL_(0xE0000000) /**< PPB base address */
1063
1064 #define DSU_DID_RESETVALUE    _UL_(0x60060006)
1065 #define ADC0_TOUCH_LINES_NUM  32
1066 #define PORT_GROUPS           2
1067
1068 /* ************************************************************************** */
1069 /**  ELECTRICAL DEFINITIONS FOR SAMD51J18A */
1070 /* ************************************************************************** */
1071
1072
1073 #ifdef __cplusplus
1074 }
1075 #endif
1076
1077 /*@}*/
1078
1079 #endif /* SAMD51J18A_H */