same70n20.h 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659
  1. /**
  2. * \file
  3. *
  4. * Copyright (c) 2015-2019 Microchip Technology Inc. and its subsidiaries.
  5. *
  6. * \asf_license_start
  7. *
  8. * \page License
  9. *
  10. * Subject to your compliance with these terms, you may use Microchip
  11. * software and any derivatives exclusively with Microchip products.
  12. * It is your responsibility to comply with third party license terms applicable
  13. * to your use of third party software (including open source software) that
  14. * may accompany Microchip software.
  15. *
  16. * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
  17. * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
  18. * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
  19. * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
  20. * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
  21. * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
  22. * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
  23. * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
  24. * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
  25. * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
  26. * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
  27. *
  28. * \asf_license_stop
  29. *
  30. */
  31. /*
  32. * Support and FAQ: visit <a href="https://www.microchip.com/support/">Microchip Support</a>
  33. */
  34. #ifndef _SAME70N20_
  35. #define _SAME70N20_
  36. /** \addtogroup SAME70N20_definitions SAME70N20 definitions
  37. This file defines all structures and symbols for SAME70N20:
  38. - registers and bitfields
  39. - peripheral base address
  40. - peripheral ID
  41. - PIO definitions
  42. */
  43. /*@{*/
  44. #ifdef __cplusplus
  45. extern "C" {
  46. #endif
  47. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  48. #include <stdint.h>
  49. #endif
  50. /* ************************************************************************** */
  51. /* CMSIS DEFINITIONS FOR SAME70N20 */
  52. /* ************************************************************************** */
  53. /** \addtogroup SAME70N20_cmsis CMSIS Definitions */
  54. /*@{*/
  55. /**< Interrupt Number Definition */
  56. typedef enum IRQn
  57. {
  58. /****** Cortex-M7 Processor Exceptions Numbers ******************************/
  59. NonMaskableInt_IRQn = -14, /**< 2 Non Maskable Interrupt */
  60. HardFault_IRQn = -13, /**< 3 HardFault Interrupt */
  61. MemoryManagement_IRQn = -12, /**< 4 Cortex-M7 Memory Management Interrupt */
  62. BusFault_IRQn = -11, /**< 5 Cortex-M7 Bus Fault Interrupt */
  63. UsageFault_IRQn = -10, /**< 6 Cortex-M7 Usage Fault Interrupt */
  64. SVCall_IRQn = -5, /**< 11 Cortex-M7 SV Call Interrupt */
  65. DebugMonitor_IRQn = -4, /**< 12 Cortex-M7 Debug Monitor Interrupt */
  66. PendSV_IRQn = -2, /**< 14 Cortex-M7 Pend SV Interrupt */
  67. SysTick_IRQn = -1, /**< 15 Cortex-M7 System Tick Interrupt */
  68. /****** SAME70N20 specific Interrupt Numbers *********************************/
  69. SUPC_IRQn = 0, /**< 0 SAME70N20 Supply Controller (SUPC) */
  70. RSTC_IRQn = 1, /**< 1 SAME70N20 Reset Controller (RSTC) */
  71. RTC_IRQn = 2, /**< 2 SAME70N20 Real Time Clock (RTC) */
  72. RTT_IRQn = 3, /**< 3 SAME70N20 Real Time Timer (RTT) */
  73. WDT_IRQn = 4, /**< 4 SAME70N20 Watchdog Timer (WDT) */
  74. PMC_IRQn = 5, /**< 5 SAME70N20 Power Management Controller (PMC) */
  75. EFC_IRQn = 6, /**< 6 SAME70N20 Enhanced Embedded Flash Controller (EFC) */
  76. UART0_IRQn = 7, /**< 7 SAME70N20 UART 0 (UART0) */
  77. UART1_IRQn = 8, /**< 8 SAME70N20 UART 1 (UART1) */
  78. PIOA_IRQn = 10, /**< 10 SAME70N20 Parallel I/O Controller A (PIOA) */
  79. PIOB_IRQn = 11, /**< 11 SAME70N20 Parallel I/O Controller B (PIOB) */
  80. USART0_IRQn = 13, /**< 13 SAME70N20 USART 0 (USART0) */
  81. USART1_IRQn = 14, /**< 14 SAME70N20 USART 1 (USART1) */
  82. USART2_IRQn = 15, /**< 15 SAME70N20 USART 2 (USART2) */
  83. PIOD_IRQn = 16, /**< 16 SAME70N20 Parallel I/O Controller D (PIOD) */
  84. HSMCI_IRQn = 18, /**< 18 SAME70N20 Multimedia Card Interface (HSMCI) */
  85. TWIHS0_IRQn = 19, /**< 19 SAME70N20 Two Wire Interface 0 HS (TWIHS0) */
  86. TWIHS1_IRQn = 20, /**< 20 SAME70N20 Two Wire Interface 1 HS (TWIHS1) */
  87. SPI0_IRQn = 21, /**< 21 SAME70N20 Serial Peripheral Interface 0 (SPI0) */
  88. SSC_IRQn = 22, /**< 22 SAME70N20 Synchronous Serial Controller (SSC) */
  89. TC0_IRQn = 23, /**< 23 SAME70N20 Timer/Counter 0 (TC0) */
  90. TC1_IRQn = 24, /**< 24 SAME70N20 Timer/Counter 1 (TC1) */
  91. TC2_IRQn = 25, /**< 25 SAME70N20 Timer/Counter 2 (TC2) */
  92. AFEC0_IRQn = 29, /**< 29 SAME70N20 Analog Front End 0 (AFEC0) */
  93. DACC_IRQn = 30, /**< 30 SAME70N20 Digital To Analog Converter (DACC) */
  94. PWM0_IRQn = 31, /**< 31 SAME70N20 Pulse Width Modulation 0 (PWM0) */
  95. ICM_IRQn = 32, /**< 32 SAME70N20 Integrity Check Monitor (ICM) */
  96. ACC_IRQn = 33, /**< 33 SAME70N20 Analog Comparator (ACC) */
  97. USBHS_IRQn = 34, /**< 34 SAME70N20 USB Host / Device Controller (USBHS) */
  98. MCAN0_INT0_IRQn = 35, /**< 35 SAME70N20 Controller Area Network (MCAN0) */
  99. MCAN0_INT1_IRQn = 36, /**< 36 SAME70N20 Controller Area Network (MCAN0) */
  100. MCAN1_INT0_IRQn = 37, /**< 37 SAME70N20 Controller Area Network (MCAN1) */
  101. MCAN1_INT1_IRQn = 38, /**< 38 SAME70N20 Controller Area Network (MCAN1) */
  102. GMAC_IRQn = 39, /**< 39 SAME70N20 Ethernet MAC (GMAC) */
  103. AFEC1_IRQn = 40, /**< 40 SAME70N20 Analog Front End 1 (AFEC1) */
  104. TWIHS2_IRQn = 41, /**< 41 SAME70N20 Two Wire Interface 2 HS (TWIHS2) */
  105. QSPI_IRQn = 43, /**< 43 SAME70N20 Quad I/O Serial Peripheral Interface (QSPI) */
  106. UART2_IRQn = 44, /**< 44 SAME70N20 UART 2 (UART2) */
  107. UART3_IRQn = 45, /**< 45 SAME70N20 UART 3 (UART3) */
  108. UART4_IRQn = 46, /**< 46 SAME70N20 UART 4 (UART4) */
  109. TC9_IRQn = 50, /**< 50 SAME70N20 Timer/Counter 9 (TC9) */
  110. TC10_IRQn = 51, /**< 51 SAME70N20 Timer/Counter 10 (TC10) */
  111. TC11_IRQn = 52, /**< 52 SAME70N20 Timer/Counter 11 (TC11) */
  112. AES_IRQn = 56, /**< 56 SAME70N20 AES (AES) */
  113. TRNG_IRQn = 57, /**< 57 SAME70N20 True Random Generator (TRNG) */
  114. XDMAC_IRQn = 58, /**< 58 SAME70N20 DMA (XDMAC) */
  115. ISI_IRQn = 59, /**< 59 SAME70N20 Camera Interface (ISI) */
  116. PWM1_IRQn = 60, /**< 60 SAME70N20 Pulse Width Modulation 1 (PWM1) */
  117. FPU_IRQn = 61, /**< 61 SAME70N20 Floating Point Unit Registers (FPU) */
  118. RSWDT_IRQn = 63, /**< 63 SAME70N20 Reinforced Safety Watchdog Timer (RSWDT) */
  119. CCW_IRQn = 64, /**< 64 SAME70N20 System Control Registers (SystemControl) */
  120. CCF_IRQn = 65, /**< 65 SAME70N20 System Control Registers (SystemControl) */
  121. GMAC_Q1_IRQn = 66, /**< 66 SAME70N20 Gigabit Ethernet MAC (GMAC) */
  122. GMAC_Q2_IRQn = 67, /**< 67 SAME70N20 Gigabit Ethernet MAC (GMAC) */
  123. IXC_IRQn = 68, /**< 68 SAME70N20 Floating Point Unit Registers (FPU) */
  124. PERIPH_COUNT_IRQn = 74 /**< Number of peripheral IDs */
  125. } IRQn_Type;
  126. typedef struct _DeviceVectors
  127. {
  128. /* Stack pointer */
  129. void* pvStack;
  130. /* Cortex-M handlers */
  131. void* pfnReset_Handler;
  132. void* pfnNMI_Handler;
  133. void* pfnHardFault_Handler;
  134. void* pfnMemManage_Handler;
  135. void* pfnBusFault_Handler;
  136. void* pfnUsageFault_Handler;
  137. void* pfnReserved1_Handler;
  138. void* pfnReserved2_Handler;
  139. void* pfnReserved3_Handler;
  140. void* pfnReserved4_Handler;
  141. void* pfnSVC_Handler;
  142. void* pfnDebugMon_Handler;
  143. void* pfnReserved5_Handler;
  144. void* pfnPendSV_Handler;
  145. void* pfnSysTick_Handler;
  146. /* Peripheral handlers */
  147. void* pfnSUPC_Handler; /* 0 Supply Controller */
  148. void* pfnRSTC_Handler; /* 1 Reset Controller */
  149. void* pfnRTC_Handler; /* 2 Real Time Clock */
  150. void* pfnRTT_Handler; /* 3 Real Time Timer */
  151. void* pfnWDT_Handler; /* 4 Watchdog Timer */
  152. void* pfnPMC_Handler; /* 5 Power Management Controller */
  153. void* pfnEFC_Handler; /* 6 Enhanced Embedded Flash Controller */
  154. void* pfnUART0_Handler; /* 7 UART 0 */
  155. void* pfnUART1_Handler; /* 8 UART 1 */
  156. void* pvReserved9;
  157. void* pfnPIOA_Handler; /* 10 Parallel I/O Controller A */
  158. void* pfnPIOB_Handler; /* 11 Parallel I/O Controller B */
  159. void* pvReserved12;
  160. void* pfnUSART0_Handler; /* 13 USART 0 */
  161. void* pfnUSART1_Handler; /* 14 USART 1 */
  162. void* pfnUSART2_Handler; /* 15 USART 2 */
  163. void* pfnPIOD_Handler; /* 16 Parallel I/O Controller D */
  164. void* pvReserved17;
  165. void* pfnHSMCI_Handler; /* 18 Multimedia Card Interface */
  166. void* pfnTWIHS0_Handler; /* 19 Two Wire Interface 0 HS */
  167. void* pfnTWIHS1_Handler; /* 20 Two Wire Interface 1 HS */
  168. void* pfnSPI0_Handler; /* 21 Serial Peripheral Interface 0 */
  169. void* pfnSSC_Handler; /* 22 Synchronous Serial Controller */
  170. void* pfnTC0_Handler; /* 23 Timer/Counter 0 */
  171. void* pfnTC1_Handler; /* 24 Timer/Counter 1 */
  172. void* pfnTC2_Handler; /* 25 Timer/Counter 2 */
  173. void* pvReserved26;
  174. void* pvReserved27;
  175. void* pvReserved28;
  176. void* pfnAFEC0_Handler; /* 29 Analog Front End 0 */
  177. void* pfnDACC_Handler; /* 30 Digital To Analog Converter */
  178. void* pfnPWM0_Handler; /* 31 Pulse Width Modulation 0 */
  179. void* pfnICM_Handler; /* 32 Integrity Check Monitor */
  180. void* pfnACC_Handler; /* 33 Analog Comparator */
  181. void* pfnUSBHS_Handler; /* 34 USB Host / Device Controller */
  182. void* pfnMCAN0_INT0_Handler; /* 35 Controller Area Network (MCAN0) */
  183. void* pfnMCAN0_INT1_Handler; /* 36 Controller Area Network (MCAN0) */
  184. void* pfnMCAN1_INT0_Handler; /* 37 Controller Area Network (MCAN1) */
  185. void* pfnMCAN1_INT1_Handler; /* 38 Controller Area Network (MCAN1) */
  186. void* pfnGMAC_Handler; /* 39 Ethernet MAC */
  187. void* pfnAFEC1_Handler; /* 40 Analog Front End 1 */
  188. void* pfnTWIHS2_Handler; /* 41 Two Wire Interface 2 HS */
  189. void* pvReserved42;
  190. void* pfnQSPI_Handler; /* 43 Quad I/O Serial Peripheral Interface */
  191. void* pfnUART2_Handler; /* 44 UART 2 */
  192. void* pfnUART3_Handler; /* 45 UART 3 */
  193. void* pfnUART4_Handler; /* 46 UART 4 */
  194. void* pvReserved47;
  195. void* pvReserved48;
  196. void* pvReserved49;
  197. void* pfnTC9_Handler; /* 50 Timer/Counter 9 */
  198. void* pfnTC10_Handler; /* 51 Timer/Counter 10 */
  199. void* pfnTC11_Handler; /* 52 Timer/Counter 11 */
  200. void* pvReserved53;
  201. void* pvReserved54;
  202. void* pvReserved55;
  203. void* pfnAES_Handler; /* 56 AES */
  204. void* pfnTRNG_Handler; /* 57 True Random Generator */
  205. void* pfnXDMAC_Handler; /* 58 DMA */
  206. void* pfnISI_Handler; /* 59 Camera Interface */
  207. void* pfnPWM1_Handler; /* 60 Pulse Width Modulation 1 */
  208. void* pfnFPU_Handler; /* 61 Floating Point Unit Registers (FPU) */
  209. void* pvReserved62;
  210. void* pfnRSWDT_Handler; /* 63 Reinforced Safety Watchdog Timer (RSWDT) */
  211. void* pfnCCW_Handler; /* 64 System Control Registers (SystemControl) */
  212. void* pfnCCF_Handler; /* 65 System Control Registers (SystemControl) */
  213. void* pfnGMAC_Q1_Handler;/* 66 Gigabit Ethernet MAC (GMAC) */
  214. void* pfnGMAC_Q2_Handler;/* 67 Gigabit Ethernet MAC (GMAC) */
  215. void* pfnIXC_Handler; /* 68 Floating Point Unit Registers (FPU) */
  216. void* pvReserved69;
  217. void* pvReserved70;
  218. void* pvReserved71;
  219. void* pvReserved72;
  220. void* pvReserved73;
  221. } DeviceVectors;
  222. /* Cortex-M7 core handlers */
  223. void Reset_Handler ( void );
  224. void NMI_Handler ( void );
  225. void HardFault_Handler ( void );
  226. void MemManage_Handler ( void );
  227. void BusFault_Handler ( void );
  228. void UsageFault_Handler ( void );
  229. void SVC_Handler ( void );
  230. void DebugMon_Handler ( void );
  231. void PendSV_Handler ( void );
  232. void SysTick_Handler ( void );
  233. /* Peripherals handlers */
  234. void ACC_Handler ( void );
  235. void AES_Handler ( void );
  236. void AFEC0_Handler ( void );
  237. void AFEC1_Handler ( void );
  238. void CCF_Handler ( void );
  239. void CCW_Handler ( void );
  240. void DACC_Handler ( void );
  241. void EFC_Handler ( void );
  242. void FPU_Handler ( void );
  243. void GMAC_Handler ( void );
  244. void HSMCI_Handler ( void );
  245. void ICM_Handler ( void );
  246. void ISI_Handler ( void );
  247. void IXC_Handler ( void );
  248. void MCAN0_INT0_Handler ( void );
  249. void MCAN0_INT1_Handler ( void );
  250. void MCAN1_INT0_Handler ( void );
  251. void MCAN1_INT1_Handler ( void );
  252. void MCAN0_Handler ( void );
  253. void MCAN1_Handler ( void );
  254. void PIOA_Handler ( void );
  255. void PIOB_Handler ( void );
  256. void PIOD_Handler ( void );
  257. void PMC_Handler ( void );
  258. void PWM0_Handler ( void );
  259. void PWM1_Handler ( void );
  260. void GMAC_Q1_Handler ( void );
  261. void GMAC_Q2_Handler ( void );
  262. void QSPI_Handler ( void );
  263. void RSTC_Handler ( void );
  264. void RSWDT_Handler ( void );
  265. void RTC_Handler ( void );
  266. void RTT_Handler ( void );
  267. void SPI0_Handler ( void );
  268. void SSC_Handler ( void );
  269. void SUPC_Handler ( void );
  270. void TC0_Handler ( void );
  271. void TC1_Handler ( void );
  272. void TC2_Handler ( void );
  273. void TC9_Handler ( void );
  274. void TC10_Handler ( void );
  275. void TC11_Handler ( void );
  276. void TRNG_Handler ( void );
  277. void TWIHS0_Handler ( void );
  278. void TWIHS1_Handler ( void );
  279. void TWIHS2_Handler ( void );
  280. void UART0_Handler ( void );
  281. void UART1_Handler ( void );
  282. void UART2_Handler ( void );
  283. void UART3_Handler ( void );
  284. void UART4_Handler ( void );
  285. void USART0_Handler ( void );
  286. void USART1_Handler ( void );
  287. void USART2_Handler ( void );
  288. void USBHS_Handler ( void );
  289. void WDT_Handler ( void );
  290. void XDMAC_Handler ( void );
  291. /**
  292. * \brief Configuration of the Cortex-M7 Processor and Core Peripherals
  293. */
  294. #define __CM7_REV 0x0000 /**< SAME70N20 core revision number ([15:8] revision number, [7:0] patch number) */
  295. #define __MPU_PRESENT 1 /**< SAME70N20 does provide a MPU */
  296. #define __NVIC_PRIO_BITS 3 /**< SAME70N20 uses 3 Bits for the Priority Levels */
  297. #define __FPU_PRESENT 1 /**< SAME70N20 does provide a FPU */
  298. #define __FPU_DP 1 /**< SAME70N20 Double precision FPU */
  299. #define __ICACHE_PRESENT 1 /**< SAME70N20 does provide an Instruction Cache */
  300. #define __DCACHE_PRESENT 1 /**< SAME70N20 does provide a Data Cache */
  301. #define __DTCM_PRESENT 1 /**< SAME70N20 does provide a Data TCM */
  302. #define __ITCM_PRESENT 1 /**< SAME70N20 does provide an Instruction TCM */
  303. #define __Vendor_SysTickConfig 0 /**< Set to 1 if different SysTick Config is used */
  304. #define __SAM_M7_REVB 0 /**< SAME70N20 Revision A */
  305. /*
  306. * \brief CMSIS includes
  307. */
  308. #include <core_cm7.h>
  309. #if !defined DONT_USE_CMSIS_INIT
  310. #include "system_same70.h"
  311. #endif /* DONT_USE_CMSIS_INIT */
  312. /*@}*/
  313. /* ************************************************************************** */
  314. /** SOFTWARE PERIPHERAL API DEFINITION FOR SAME70N20 */
  315. /* ************************************************************************** */
  316. /** \addtogroup SAME70N20_api Peripheral Software API */
  317. /*@{*/
  318. #include "component/acc.h"
  319. #include "component/aes.h"
  320. #include "component/afec.h"
  321. #include "component/chipid.h"
  322. #include "component/dacc.h"
  323. #include "component/efc.h"
  324. #include "component/gmac.h"
  325. #include "component/gpbr.h"
  326. #include "component/hsmci.h"
  327. #include "component/icm.h"
  328. #include "component/isi.h"
  329. #include "component/matrix.h"
  330. #include "component/mcan.h"
  331. #include "component/pio.h"
  332. #include "component/pmc.h"
  333. #include "component/pwm.h"
  334. #include "component/qspi.h"
  335. #include "component/rstc.h"
  336. #include "component/rswdt.h"
  337. #include "component/rtc.h"
  338. #include "component/rtt.h"
  339. #include "component/spi.h"
  340. #include "component/ssc.h"
  341. #include "component/supc.h"
  342. #include "component/tc.h"
  343. #include "component/trng.h"
  344. #include "component/twihs.h"
  345. #include "component/uart.h"
  346. #include "component/usart.h"
  347. #include "component/usbhs.h"
  348. #include "component/utmi.h"
  349. #include "component/wdt.h"
  350. #include "component/xdmac.h"
  351. /*@}*/
  352. /* ************************************************************************** */
  353. /* REGISTER ACCESS DEFINITIONS FOR SAME70N20 */
  354. /* ************************************************************************** */
  355. /** \addtogroup SAME70N20_reg Registers Access Definitions */
  356. /*@{*/
  357. #include "instance/hsmci.h"
  358. #include "instance/ssc.h"
  359. #include "instance/spi0.h"
  360. #include "instance/tc0.h"
  361. #include "instance/twihs0.h"
  362. #include "instance/twihs1.h"
  363. #include "instance/pwm0.h"
  364. #include "instance/usart0.h"
  365. #include "instance/usart1.h"
  366. #include "instance/usart2.h"
  367. #include "instance/mcan0.h"
  368. #include "instance/mcan1.h"
  369. #include "instance/usbhs.h"
  370. #include "instance/afec0.h"
  371. #include "instance/dacc.h"
  372. #include "instance/acc.h"
  373. #include "instance/icm.h"
  374. #include "instance/isi.h"
  375. #include "instance/gmac.h"
  376. #include "instance/tc3.h"
  377. #include "instance/pwm1.h"
  378. #include "instance/twihs2.h"
  379. #include "instance/afec1.h"
  380. #include "instance/aes.h"
  381. #include "instance/trng.h"
  382. #include "instance/xdmac.h"
  383. #include "instance/qspi.h"
  384. #include "instance/matrix.h"
  385. #include "instance/utmi.h"
  386. #include "instance/pmc.h"
  387. #include "instance/uart0.h"
  388. #include "instance/chipid.h"
  389. #include "instance/uart1.h"
  390. #include "instance/efc.h"
  391. #include "instance/pioa.h"
  392. #include "instance/piob.h"
  393. #include "instance/piod.h"
  394. #include "instance/rstc.h"
  395. #include "instance/supc.h"
  396. #include "instance/rtt.h"
  397. #include "instance/wdt.h"
  398. #include "instance/rtc.h"
  399. #include "instance/gpbr.h"
  400. #include "instance/rswdt.h"
  401. #include "instance/uart2.h"
  402. #include "instance/uart3.h"
  403. #include "instance/uart4.h"
  404. /*@}*/
  405. /* ************************************************************************** */
  406. /* PERIPHERAL ID DEFINITIONS FOR SAME70N20 */
  407. /* ************************************************************************** */
  408. /** \addtogroup SAME70N20_id Peripheral Ids Definitions */
  409. /*@{*/
  410. #define ID_SUPC ( 0) /**< \brief Supply Controller (SUPC) */
  411. #define ID_RSTC ( 1) /**< \brief Reset Controller (RSTC) */
  412. #define ID_RTC ( 2) /**< \brief Real Time Clock (RTC) */
  413. #define ID_RTT ( 3) /**< \brief Real Time Timer (RTT) */
  414. #define ID_WDT ( 4) /**< \brief Watchdog Timer (WDT) */
  415. #define ID_PMC ( 5) /**< \brief Power Management Controller (PMC) */
  416. #define ID_EFC ( 6) /**< \brief Enhanced Embedded Flash Controller (EFC) */
  417. #define ID_UART0 ( 7) /**< \brief UART 0 (UART0) */
  418. #define ID_UART1 ( 8) /**< \brief UART 1 (UART1) */
  419. #define ID_PIOA (10) /**< \brief Parallel I/O Controller A (PIOA) */
  420. #define ID_PIOB (11) /**< \brief Parallel I/O Controller B (PIOB) */
  421. #define ID_USART0 (13) /**< \brief USART 0 (USART0) */
  422. #define ID_USART1 (14) /**< \brief USART 1 (USART1) */
  423. #define ID_USART2 (15) /**< \brief USART 2 (USART2) */
  424. #define ID_PIOD (16) /**< \brief Parallel I/O Controller D (PIOD) */
  425. #define ID_HSMCI (18) /**< \brief Multimedia Card Interface (HSMCI) */
  426. #define ID_TWIHS0 (19) /**< \brief Two Wire Interface 0 HS (TWIHS0) */
  427. #define ID_TWIHS1 (20) /**< \brief Two Wire Interface 1 HS (TWIHS1) */
  428. #define ID_SPI0 (21) /**< \brief Serial Peripheral Interface 0 (SPI0) */
  429. #define ID_SSC (22) /**< \brief Synchronous Serial Controller (SSC) */
  430. #define ID_TC0 (23) /**< \brief Timer/Counter 0 (TC0) */
  431. #define ID_TC1 (24) /**< \brief Timer/Counter 1 (TC1) */
  432. #define ID_TC2 (25) /**< \brief Timer/Counter 2 (TC2) */
  433. #define ID_AFEC0 (29) /**< \brief Analog Front End 0 (AFEC0) */
  434. #define ID_DACC (30) /**< \brief Digital To Analog Converter (DACC) */
  435. #define ID_PWM0 (31) /**< \brief Pulse Width Modulation 0 (PWM0) */
  436. #define ID_ICM (32) /**< \brief Integrity Check Monitor (ICM) */
  437. #define ID_ACC (33) /**< \brief Analog Comparator (ACC) */
  438. #define ID_USBHS (34) /**< \brief USB Host / Device Controller (USBHS) */
  439. #define ID_MCAN0 (35) /**< \brief MCAN Controller 0 (MCAN0) */
  440. #define ID_MCAN1 (37) /**< \brief MCAN Controller 1 (MCAN1) */
  441. #define ID_GMAC (39) /**< \brief Ethernet MAC (GMAC) */
  442. #define ID_AFEC1 (40) /**< \brief Analog Front End 1 (AFEC1) */
  443. #define ID_TWIHS2 (41) /**< \brief Two Wire Interface 2 HS (TWIHS2) */
  444. #define ID_QSPI (43) /**< \brief Quad I/O Serial Peripheral Interface (QSPI) */
  445. #define ID_UART2 (44) /**< \brief UART 2 (UART2) */
  446. #define ID_UART3 (45) /**< \brief UART 3 (UART3) */
  447. #define ID_UART4 (46) /**< \brief UART 4 (UART4) */
  448. #define ID_TC9 (50) /**< \brief Timer/Counter 9 (TC9) */
  449. #define ID_TC10 (51) /**< \brief Timer/Counter 10 (TC10) */
  450. #define ID_TC11 (52) /**< \brief Timer/Counter 11 (TC11) */
  451. #define ID_AES (56) /**< \brief AES (AES) */
  452. #define ID_TRNG (57) /**< \brief True Random Generator (TRNG) */
  453. #define ID_XDMAC (58) /**< \brief DMA (XDMAC) */
  454. #define ID_ISI (59) /**< \brief Camera Interface (ISI) */
  455. #define ID_PWM1 (60) /**< \brief Pulse Width Modulation 1 (PWM1) */
  456. #define ID_RSWDT (63) /**< \brief Reinforced Secure Watchdog Timer (RSWDT) */
  457. #define ID_IXC (68) /**< \brief Floating Point Unit - IXC (ARM) */
  458. #define ID_PERIPH_COUNT (74) /**< \brief Number of peripheral IDs */
  459. /*@}*/
  460. /* ************************************************************************** */
  461. /* BASE ADDRESS DEFINITIONS FOR SAME70N20 */
  462. /* ************************************************************************** */
  463. /** \addtogroup SAME70N20_base Peripheral Base Address Definitions */
  464. /*@{*/
  465. #if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  466. #define HSMCI (0x40000000U) /**< \brief (HSMCI ) Base Address */
  467. #define SSC (0x40004000U) /**< \brief (SSC ) Base Address */
  468. #define SPI0 (0x40008000U) /**< \brief (SPI0 ) Base Address */
  469. #define TC0 (0x4000C000U) /**< \brief (TC0 ) Base Address */
  470. #define TWIHS0 (0x40018000U) /**< \brief (TWIHS0) Base Address */
  471. #define TWIHS1 (0x4001C000U) /**< \brief (TWIHS1) Base Address */
  472. #define PWM0 (0x40020000U) /**< \brief (PWM0 ) Base Address */
  473. #define USART0 (0x40024000U) /**< \brief (USART0) Base Address */
  474. #define USART1 (0x40028000U) /**< \brief (USART1) Base Address */
  475. #define USART2 (0x4002C000U) /**< \brief (USART2) Base Address */
  476. #define MCAN0 (0x40030000U) /**< \brief (MCAN0 ) Base Address */
  477. #define MCAN1 (0x40034000U) /**< \brief (MCAN1 ) Base Address */
  478. #define USBHS (0x40038000U) /**< \brief (USBHS ) Base Address */
  479. #define AFEC0 (0x4003C000U) /**< \brief (AFEC0 ) Base Address */
  480. #define DACC (0x40040000U) /**< \brief (DACC ) Base Address */
  481. #define ACC (0x40044000U) /**< \brief (ACC ) Base Address */
  482. #define ICM (0x40048000U) /**< \brief (ICM ) Base Address */
  483. #define ISI (0x4004C000U) /**< \brief (ISI ) Base Address */
  484. #define GMAC (0x40050000U) /**< \brief (GMAC ) Base Address */
  485. #define TC3 (0x40054000U) /**< \brief (TC3 ) Base Address */
  486. #define PWM1 (0x4005C000U) /**< \brief (PWM1 ) Base Address */
  487. #define TWIHS2 (0x40060000U) /**< \brief (TWIHS2) Base Address */
  488. #define AFEC1 (0x40064000U) /**< \brief (AFEC1 ) Base Address */
  489. #define AES (0x4006C000U) /**< \brief (AES ) Base Address */
  490. #define TRNG (0x40070000U) /**< \brief (TRNG ) Base Address */
  491. #define XDMAC (0x40078000U) /**< \brief (XDMAC ) Base Address */
  492. #define QSPI (0x4007C000U) /**< \brief (QSPI ) Base Address */
  493. #define MATRIX (0x40088000U) /**< \brief (MATRIX) Base Address */
  494. #define UTMI (0x400E0400U) /**< \brief (UTMI ) Base Address */
  495. #define PMC (0x400E0600U) /**< \brief (PMC ) Base Address */
  496. #define UART0 (0x400E0800U) /**< \brief (UART0 ) Base Address */
  497. #define CHIPID (0x400E0940U) /**< \brief (CHIPID) Base Address */
  498. #define UART1 (0x400E0A00U) /**< \brief (UART1 ) Base Address */
  499. #define EFC (0x400E0C00U) /**< \brief (EFC ) Base Address */
  500. #define PIOA (0x400E0E00U) /**< \brief (PIOA ) Base Address */
  501. #define PIOB (0x400E1000U) /**< \brief (PIOB ) Base Address */
  502. #define PIOD (0x400E1400U) /**< \brief (PIOD ) Base Address */
  503. #define RSTC (0x400E1800U) /**< \brief (RSTC ) Base Address */
  504. #define SUPC (0x400E1810U) /**< \brief (SUPC ) Base Address */
  505. #define RTT (0x400E1830U) /**< \brief (RTT ) Base Address */
  506. #define WDT (0x400E1850U) /**< \brief (WDT ) Base Address */
  507. #define RTC (0x400E1860U) /**< \brief (RTC ) Base Address */
  508. #define GPBR (0x400E1890U) /**< \brief (GPBR ) Base Address */
  509. #define RSWDT (0x400E1900U) /**< \brief (RSWDT ) Base Address */
  510. #define UART2 (0x400E1A00U) /**< \brief (UART2 ) Base Address */
  511. #define UART3 (0x400E1C00U) /**< \brief (UART3 ) Base Address */
  512. #define UART4 (0x400E1E00U) /**< \brief (UART4 ) Base Address */
  513. #else
  514. #define HSMCI ((Hsmci *)0x40000000U) /**< \brief (HSMCI ) Base Address */
  515. #define SSC ((Ssc *)0x40004000U) /**< \brief (SSC ) Base Address */
  516. #define SPI0 ((Spi *)0x40008000U) /**< \brief (SPI0 ) Base Address */
  517. #define TC0 ((Tc *)0x4000C000U) /**< \brief (TC0 ) Base Address */
  518. #define TWIHS0 ((Twihs *)0x40018000U) /**< \brief (TWIHS0) Base Address */
  519. #define TWIHS1 ((Twihs *)0x4001C000U) /**< \brief (TWIHS1) Base Address */
  520. #define PWM0 ((Pwm *)0x40020000U) /**< \brief (PWM0 ) Base Address */
  521. #define USART0 ((Usart *)0x40024000U) /**< \brief (USART0) Base Address */
  522. #define USART1 ((Usart *)0x40028000U) /**< \brief (USART1) Base Address */
  523. #define USART2 ((Usart *)0x4002C000U) /**< \brief (USART2) Base Address */
  524. #define MCAN0 ((Mcan *)0x40030000U) /**< \brief (MCAN0 ) Base Address */
  525. #define MCAN1 ((Mcan *)0x40034000U) /**< \brief (MCAN1 ) Base Address */
  526. #define USBHS ((Usbhs *)0x40038000U) /**< \brief (USBHS ) Base Address */
  527. #define AFEC0 ((Afec *)0x4003C000U) /**< \brief (AFEC0 ) Base Address */
  528. #define DACC ((Dacc *)0x40040000U) /**< \brief (DACC ) Base Address */
  529. #define ACC ((Acc *)0x40044000U) /**< \brief (ACC ) Base Address */
  530. #define ICM ((Icm *)0x40048000U) /**< \brief (ICM ) Base Address */
  531. #define ISI ((Isi *)0x4004C000U) /**< \brief (ISI ) Base Address */
  532. #define GMAC ((Gmac *)0x40050000U) /**< \brief (GMAC ) Base Address */
  533. #define TC3 ((Tc *)0x40054000U) /**< \brief (TC3 ) Base Address */
  534. #define PWM1 ((Pwm *)0x4005C000U) /**< \brief (PWM1 ) Base Address */
  535. #define TWIHS2 ((Twihs *)0x40060000U) /**< \brief (TWIHS2) Base Address */
  536. #define AFEC1 ((Afec *)0x40064000U) /**< \brief (AFEC1 ) Base Address */
  537. #define AES ((Aes *)0x4006C000U) /**< \brief (AES ) Base Address */
  538. #define TRNG ((Trng *)0x40070000U) /**< \brief (TRNG ) Base Address */
  539. #define XDMAC ((Xdmac *)0x40078000U) /**< \brief (XDMAC ) Base Address */
  540. #define QSPI ((Qspi *)0x4007C000U) /**< \brief (QSPI ) Base Address */
  541. #define MATRIX ((Matrix *)0x40088000U) /**< \brief (MATRIX) Base Address */
  542. #define UTMI ((Utmi *)0x400E0400U) /**< \brief (UTMI ) Base Address */
  543. #define PMC ((Pmc *)0x400E0600U) /**< \brief (PMC ) Base Address */
  544. #define UART0 ((Uart *)0x400E0800U) /**< \brief (UART0 ) Base Address */
  545. #define CHIPID ((Chipid *)0x400E0940U) /**< \brief (CHIPID) Base Address */
  546. #define UART1 ((Uart *)0x400E0A00U) /**< \brief (UART1 ) Base Address */
  547. #define EFC ((Efc *)0x400E0C00U) /**< \brief (EFC ) Base Address */
  548. #define PIOA ((Pio *)0x400E0E00U) /**< \brief (PIOA ) Base Address */
  549. #define PIOB ((Pio *)0x400E1000U) /**< \brief (PIOB ) Base Address */
  550. #define PIOD ((Pio *)0x400E1400U) /**< \brief (PIOD ) Base Address */
  551. #define RSTC ((Rstc *)0x400E1800U) /**< \brief (RSTC ) Base Address */
  552. #define SUPC ((Supc *)0x400E1810U) /**< \brief (SUPC ) Base Address */
  553. #define RTT ((Rtt *)0x400E1830U) /**< \brief (RTT ) Base Address */
  554. #define WDT ((Wdt *)0x400E1850U) /**< \brief (WDT ) Base Address */
  555. #define RTC ((Rtc *)0x400E1860U) /**< \brief (RTC ) Base Address */
  556. #define GPBR ((Gpbr *)0x400E1890U) /**< \brief (GPBR ) Base Address */
  557. #define RSWDT ((Rswdt *)0x400E1900U) /**< \brief (RSWDT ) Base Address */
  558. #define UART2 ((Uart *)0x400E1A00U) /**< \brief (UART2 ) Base Address */
  559. #define UART3 ((Uart *)0x400E1C00U) /**< \brief (UART3 ) Base Address */
  560. #define UART4 ((Uart *)0x400E1E00U) /**< \brief (UART4 ) Base Address */
  561. #endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  562. /*@}*/
  563. /* ************************************************************************** */
  564. /* PIO DEFINITIONS FOR SAME70N20 */
  565. /* ************************************************************************** */
  566. /** \addtogroup SAME70N20_pio Peripheral Pio Definitions */
  567. /*@{*/
  568. #include "pio/same70n20.h"
  569. /*@}*/
  570. /* ************************************************************************** */
  571. /* MEMORY MAPPING DEFINITIONS FOR SAME70N20 */
  572. /* ************************************************************************** */
  573. #define IFLASH_SIZE (0x100000u)
  574. #define IFLASH_PAGE_SIZE (512u)
  575. #define IFLASH_LOCK_REGION_SIZE (16384u)
  576. #define IFLASH_NB_OF_PAGES (2048u)
  577. #define IFLASH_NB_OF_LOCK_BITS (64u)
  578. #define IRAM_SIZE (0x60000u)
  579. #define QSPIMEM_ADDR (0x80000000u) /**< QSPI Memory base address */
  580. #define AXIMX_ADDR (0xA0000000u) /**< AXI Bus Matrix base address */
  581. #define ITCM_ADDR (0x00000000u) /**< Instruction Tightly Coupled Memory base address */
  582. #define IFLASH_ADDR (0x00400000u) /**< Internal Flash base address */
  583. #define IROM_ADDR (0x00800000u) /**< Internal ROM base address */
  584. #define DTCM_ADDR (0x20000000u) /**< Data Tightly Coupled Memory base address */
  585. #define IRAM_ADDR (0x20400000u) /**< Internal RAM base address */
  586. /* ************************************************************************** */
  587. /* MISCELLANEOUS DEFINITIONS FOR SAME70N20 */
  588. /* ************************************************************************** */
  589. #define CHIP_JTAGID (0x05B3D03FUL)
  590. #define CHIP_CIDR (0xA1020C00UL)
  591. #define CHIP_EXID (0x00000001UL)
  592. /* ************************************************************************** */
  593. /* ELECTRICAL DEFINITIONS FOR SAME70N20 */
  594. /* ************************************************************************** */
  595. /* %ATMEL_ELECTRICAL% */
  596. /* Device characteristics */
  597. #define CHIP_FREQ_SLCK_RC_MIN (20000UL)
  598. #define CHIP_FREQ_SLCK_RC (32000UL)
  599. #define CHIP_FREQ_SLCK_RC_MAX (44000UL)
  600. #define CHIP_FREQ_MAINCK_RC_4MHZ (4000000UL)
  601. #define CHIP_FREQ_MAINCK_RC_8MHZ (8000000UL)
  602. #define CHIP_FREQ_MAINCK_RC_12MHZ (12000000UL)
  603. #define CHIP_FREQ_CPU_MAX (300000000UL)
  604. #define CHIP_FREQ_XTAL_32K (32768UL)
  605. #define CHIP_FREQ_XTAL_12M (12000000UL)
  606. /* Embedded Flash Read Wait State (for Worst-Case Conditions) */
  607. #define CHIP_FREQ_FWS_0 (23000000UL) /**< \brief Maximum operating frequency when FWS is 0 */
  608. #define CHIP_FREQ_FWS_1 (46000000UL) /**< \brief Maximum operating frequency when FWS is 1 */
  609. #define CHIP_FREQ_FWS_2 (69000000UL) /**< \brief Maximum operating frequency when FWS is 2 */
  610. #define CHIP_FREQ_FWS_3 (92000000UL) /**< \brief Maximum operating frequency when FWS is 3 */
  611. #define CHIP_FREQ_FWS_4 (115000000UL) /**< \brief Maximum operating frequency when FWS is 4 */
  612. #define CHIP_FREQ_FWS_5 (138000000UL) /**< \brief Maximum operating frequency when FWS is 5 */
  613. #define CHIP_FREQ_FWS_6 (150000000UL) /**< \brief Maximum operating frequency when FWS is 6 */
  614. #ifdef __cplusplus
  615. }
  616. #endif
  617. /*@}*/
  618. #endif /* _SAME70N20_ */