1 /* ----------------------------------------------------------------------------
\r
2 * SAM Software Package License
\r
3 * ----------------------------------------------------------------------------
\r
4 * Copyright (c) 2014, Atmel Corporation
\r
6 * All rights reserved.
\r
8 * Redistribution and use in source and binary forms, with or without
\r
9 * modification, are permitted provided that the following conditions are met:
\r
11 * - Redistributions of source code must retain the above copyright notice,
\r
12 * this list of conditions and the disclaimer below.
\r
14 * Atmel's name may not be used to endorse or promote products derived from
\r
15 * this software without specific prior written permission.
\r
17 * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR
\r
18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
\r
19 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
\r
20 * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,
\r
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
\r
22 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
\r
23 * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
\r
24 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
\r
25 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
\r
26 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\r
27 * ----------------------------------------------------------------------------
\r
30 #ifndef SAMS7_CHIP_H
\r
31 #define SAMS7_CHIP_H
\r
34 /* Define WEAK attribute */
\r
35 #if defined ( __CC_ARM )
\r
36 #define WEAK __attribute__ ((weak))
\r
37 #elif defined ( __ICCARM__ )
\r
39 #elif defined ( __GNUC__ )
\r
40 #define WEAK __attribute__ ((weak))
\r
43 /* Define NO_INIT attribute */
\r
44 #if defined ( __CC_ARM )
\r
46 #elif defined ( __ICCARM__ )
\r
47 #define NO_INIT __no_init
\r
48 #elif defined ( __GNUC__ )
\r
52 /* Define RAMFUNC attribute */
\r
54 #define RAMFUNC __ramfunc
\r
56 #define RAMFUNC __attribute__ ((section (".ramfunc")))
\r
60 * Peripherals registers definitions
\r
62 #include "include/samv7/sam.h"
\r
67 //#include "include/exceptions.h"
\r
69 #define memory_barrier() __DSB();
\r
74 #include "include/acc.h"
\r
75 #include "include/aes.h"
\r
76 #include "include/afec.h"
\r
77 #include "include/efc.h"
\r
78 #include "include/pio.h"
\r
79 #include "include/pio_it.h"
\r
80 #include "include/efc.h"
\r
81 #include "include/mpu.h"
\r
82 #include "include/gmac.h"
\r
83 #include "include/gmacd.h"
\r
84 #include "include/video.h"
\r
85 #include "include/icm.h"
\r
86 #include "include/isi.h"
\r
87 #include "include/exceptions.h"
\r
88 #include "include/pio_capture.h"
\r
89 #include "include/rtc.h"
\r
90 #include "include/rtt.h"
\r
91 #include "include/tc.h"
\r
92 #include "include/timetick.h"
\r
93 #include "include/twi.h"
\r
94 #include "include/twid.h"
\r
95 #include "include/flashd.h"
\r
96 #include "include/pmc.h"
\r
97 #include "include/pwmc.h"
\r
98 #include "include/supc.h"
\r
99 #include "include/usart.h"
\r
100 #include "include/uart.h"
\r
101 #include "include/isi.h"
\r
102 #include "include/hsmci.h"
\r
103 #include "include/ssc.h"
\r
104 #include "include/twi.h"
\r
105 #include "include/twid.h"
\r
106 #include "include/trng.h"
\r
107 #include "include/wdt.h"
\r
108 #include "include/spi.h"
\r
109 #include "include/qspi.h"
\r
110 #include "include/trace.h"
\r
111 #include "include/xdmac.h"
\r
112 #include "include/xdma_hardware_interface.h"
\r
113 #include "include/xdmad.h"
\r
114 #include "include/mcid.h"
\r
115 #include "include/spi_dma.h"
\r
116 #include "include/qspi_dma.h"
\r
117 #include "include/uart_dma.h"
\r
118 #include "include/usart_dma.h"
\r
119 #include "include/afe_dma.h"
\r
120 #include "include/dac_dma.h"
\r
122 #define ENABLE_PERIPHERAL(dwId) PMC_EnablePeripheral( dwId )
\r
123 #define DISABLE_PERIPHERAL(dwId) PMC_DisablePeripheral( dwId )
\r
126 /* SCB Interrupt Control State Register Definitions */
\r
127 #ifndef SCB_VTOR_TBLBASE_Pos
\r
128 #define SCB_VTOR_TBLBASE_Pos 29 /*!< SCB VTOR: TBLBASE Position */
\r
129 #define SCB_VTOR_TBLBASE_Msk (1UL << SCB_VTOR_TBLBASE_Pos) /*!< SCB VTOR: TBLBASE Mask */
\r
132 #define RESET_CYCLE_COUNTER() { DWT->CTRL = 0;__ISB(); \
\r
133 while(DWT->CYCCNT != 0)DWT->CYCCNT = 0;\
\r
134 DWT->CTRL = DWT_CTRL_CYCCNTENA_Msk; }
\r
136 #define GET_CYCLE_COUNTER(x) x=DWT->CYCCNT;
\r
138 #endif /* SAMS7_CHIP_H */
\r