1 /* ---------------------------------------------------------------------------- */
2 /*                  Atmel Microcontroller Software Support                      */
3 /*                       SAM Software Package License                           */
4 /* ---------------------------------------------------------------------------- */
5 /* Copyright (c) %copyright_year%, Atmel Corporation                                        */
6 /*                                                                              */
7 /* All rights reserved.                                                         */
8 /*                                                                              */
9 /* Redistribution and use in source and binary forms, with or without           */
10 /* modification, are permitted provided that the following condition is met:    */
11 /*                                                                              */
12 /* - Redistributions of source code must retain the above copyright notice,     */
13 /* this list of conditions and the disclaimer below.                            */
14 /*                                                                              */
15 /* Atmel's name may not be used to endorse or promote products derived from     */
16 /* this software without specific prior written permission.                     */
17 /*                                                                              */
18 /* DISCLAIMER:  THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR   */
19 /* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
20 /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE   */
21 /* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,      */
22 /* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */
23 /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,  */
24 /* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF    */
25 /* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING         */
26 /* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
27 /* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.                           */
28 /* ---------------------------------------------------------------------------- */
29 
30 #ifndef _SAM4S2A_PIO_
31 #define _SAM4S2A_PIO_
32 
33 #define PIO_PA0             (1u << 0)  /**< \brief Pin Controlled by PA0 */
34 #define PIO_PA1             (1u << 1)  /**< \brief Pin Controlled by PA1 */
35 #define PIO_PA2             (1u << 2)  /**< \brief Pin Controlled by PA2 */
36 #define PIO_PA3             (1u << 3)  /**< \brief Pin Controlled by PA3 */
37 #define PIO_PA4             (1u << 4)  /**< \brief Pin Controlled by PA4 */
38 #define PIO_PA5             (1u << 5)  /**< \brief Pin Controlled by PA5 */
39 #define PIO_PA6             (1u << 6)  /**< \brief Pin Controlled by PA6 */
40 #define PIO_PA7             (1u << 7)  /**< \brief Pin Controlled by PA7 */
41 #define PIO_PA8             (1u << 8)  /**< \brief Pin Controlled by PA8 */
42 #define PIO_PA9             (1u << 9)  /**< \brief Pin Controlled by PA9 */
43 #define PIO_PA10            (1u << 10) /**< \brief Pin Controlled by PA10 */
44 #define PIO_PA11            (1u << 11) /**< \brief Pin Controlled by PA11 */
45 #define PIO_PA12            (1u << 12) /**< \brief Pin Controlled by PA12 */
46 #define PIO_PA13            (1u << 13) /**< \brief Pin Controlled by PA13 */
47 #define PIO_PA14            (1u << 14) /**< \brief Pin Controlled by PA14 */
48 #define PIO_PA15            (1u << 15) /**< \brief Pin Controlled by PA15 */
49 #define PIO_PA16            (1u << 16) /**< \brief Pin Controlled by PA16 */
50 #define PIO_PA17            (1u << 17) /**< \brief Pin Controlled by PA17 */
51 #define PIO_PA18            (1u << 18) /**< \brief Pin Controlled by PA18 */
52 #define PIO_PA19            (1u << 19) /**< \brief Pin Controlled by PA19 */
53 #define PIO_PA20            (1u << 20) /**< \brief Pin Controlled by PA20 */
54 #define PIO_PB0             (1u << 0)  /**< \brief Pin Controlled by PB0 */
55 #define PIO_PB1             (1u << 1)  /**< \brief Pin Controlled by PB1 */
56 #define PIO_PB2             (1u << 2)  /**< \brief Pin Controlled by PB2 */
57 #define PIO_PB3             (1u << 3)  /**< \brief Pin Controlled by PB3 */
58 #define PIO_PB4             (1u << 4)  /**< \brief Pin Controlled by PB4 */
59 #define PIO_PB5             (1u << 5)  /**< \brief Pin Controlled by PB5 */
60 #define PIO_PB6             (1u << 6)  /**< \brief Pin Controlled by PB6 */
61 #define PIO_PB7             (1u << 7)  /**< \brief Pin Controlled by PB7 */
62 #define PIO_PB8             (1u << 8)  /**< \brief Pin Controlled by PB8 */
63 #define PIO_PB9             (1u << 9)  /**< \brief Pin Controlled by PB9 */
64 #define PIO_PB10            (1u << 10) /**< \brief Pin Controlled by PB10 */
65 #define PIO_PB11            (1u << 11) /**< \brief Pin Controlled by PB11 */
66 #define PIO_PB12            (1u << 12) /**< \brief Pin Controlled by PB12 */
67 /* ========== Pio definition for ADC peripheral ========== */
68 #define PIO_PA17X1_AD0      (1u << 17) /**< \brief Adc signal: AD0 */
69 #define PIO_PA18X1_AD1      (1u << 18) /**< \brief Adc signal: AD1 */
70 #define PIO_PC13X1_AD10     (1u << 13) /**< \brief Adc signal: AD10 */
71 #define PIO_PC15X1_AD11     (1u << 15) /**< \brief Adc signal: AD11 */
72 #define PIO_PC12X1_AD12     (1u << 12) /**< \brief Adc signal: AD12 */
73 #define PIO_PC29X1_AD13     (1u << 29) /**< \brief Adc signal: AD13 */
74 #define PIO_PC30X1_AD14     (1u << 30) /**< \brief Adc signal: AD14 */
75 #define PIO_PA19X1_AD2      (1u << 19) /**< \brief Adc signal: AD2/WKUP9 */
76 #define PIO_PA19X1_WKUP9    (1u << 19) /**< \brief Adc signal: AD2/WKUP9 */
77 #define PIO_PA20X1_AD3      (1u << 20) /**< \brief Adc signal: AD3/WKUP10 */
78 #define PIO_PA20X1_WKUP10   (1u << 20) /**< \brief Adc signal: AD3/WKUP10 */
79 #define PIO_PB0X1_AD4       (1u << 0)  /**< \brief Adc signal: AD4/RTCOUT0 */
80 #define PIO_PB0X1_RTCOUT0   (1u << 0)  /**< \brief Adc signal: AD4/RTCOUT0 */
81 #define PIO_PB1X1_AD5       (1u << 1)  /**< \brief Adc signal: AD5/RTCOUT1 */
82 #define PIO_PB1X1_RTCOUT1   (1u << 1)  /**< \brief Adc signal: AD5/RTCOUT1 */
83 #define PIO_PB2X1_AD6       (1u << 2)  /**< \brief Adc signal: AD6/WKUP12 */
84 #define PIO_PB2X1_WKUP12    (1u << 2)  /**< \brief Adc signal: AD6/WKUP12 */
85 #define PIO_PB3X1_AD7       (1u << 3)  /**< \brief Adc signal: AD7 */
86 #define PIO_PA21X1_AD8      (1u << 21) /**< \brief Adc signal: AD8 */
87 #define PIO_PA22X1_AD9      (1u << 22) /**< \brief Adc signal: AD9 */
88 #define PIO_PA8B_ADTRG      (1u << 8)  /**< \brief Adc signal: ADTRG */
89 /* ========== Pio definition for PIOA peripheral ========== */
90 #define PIO_PA24X1_PIODC0   (1u << 24) /**< \brief Pioa signal: PIODC0 */
91 #define PIO_PA25X1_PIODC1   (1u << 25) /**< \brief Pioa signal: PIODC1 */
92 #define PIO_PA26X1_PIODC2   (1u << 26) /**< \brief Pioa signal: PIODC2 */
93 #define PIO_PA27X1_PIODC3   (1u << 27) /**< \brief Pioa signal: PIODC3 */
94 #define PIO_PA28X1_PIODC4   (1u << 28) /**< \brief Pioa signal: PIODC4 */
95 #define PIO_PA29X1_PIODC5   (1u << 29) /**< \brief Pioa signal: PIODC5 */
96 #define PIO_PA31X1_PIODC7   (1u << 31) /**< \brief Pioa signal: PIODC7 */
97 #define PIO_PA23X1_PIODCCLK (1u << 23) /**< \brief Pioa signal: PIODCCLK */
98 #define PIO_PA30X1_WKUP11   (1u << 30) /**< \brief Pioa signal: WKUP11/PIODC6 */
99 #define PIO_PA30X1_PIODC6   (1u << 30) /**< \brief Pioa signal: WKUP11/PIODC6 */
100 #define PIO_PA15X1_WKUP14   (1u << 15) /**< \brief Pioa signal: WKUP14/PIODCEN1 */
101 #define PIO_PA15X1_PIODCEN1 (1u << 15) /**< \brief Pioa signal: WKUP14/PIODCEN1 */
102 #define PIO_PA16X1_WKUP15   (1u << 16) /**< \brief Pioa signal: WKUP15/PIODCEN2 */
103 #define PIO_PA16X1_PIODCEN2 (1u << 16) /**< \brief Pioa signal: WKUP15/PIODCEN2 */
104 /* ========== Pio definition for PMC peripheral ========== */
105 #define PIO_PA6B_PCK0       (1u << 6)  /**< \brief Pmc signal: PCK0 */
106 #define PIO_PB13B_PCK0      (1u << 13) /**< \brief Pmc signal: PCK0 */
107 #define PIO_PA17B_PCK1      (1u << 17) /**< \brief Pmc signal: PCK1 */
108 #define PIO_PA21B_PCK1      (1u << 21) /**< \brief Pmc signal: PCK1 */
109 #define PIO_PA18B_PCK2      (1u << 18) /**< \brief Pmc signal: PCK2 */
110 #define PIO_PA31B_PCK2      (1u << 31) /**< \brief Pmc signal: PCK2 */
111 #define PIO_PB3B_PCK2       (1u << 3)  /**< \brief Pmc signal: PCK2 */
112 /* ========== Pio definition for PWM peripheral ========== */
113 #define PIO_PA9C_PWMFI0     (1u << 9)  /**< \brief Pwm signal: PWMFI0 */
114 #define PIO_PA10C_PWMFI1    (1u << 10) /**< \brief Pwm signal: PWMFI1 */
115 #define PIO_PA18D_PWMFI2    (1u << 18) /**< \brief Pwm signal: PWMFI2 */
116 #define PIO_PA0A_PWMH0      (1u << 0)  /**< \brief Pwm signal: PWMH0 */
117 #define PIO_PA11B_PWMH0     (1u << 11) /**< \brief Pwm signal: PWMH0 */
118 #define PIO_PA23B_PWMH0     (1u << 23) /**< \brief Pwm signal: PWMH0 */
119 #define PIO_PB0A_PWMH0      (1u << 0)  /**< \brief Pwm signal: PWMH0 */
120 #define PIO_PC18B_PWMH0     (1u << 18) /**< \brief Pwm signal: PWMH0 */
121 #define PIO_PA1A_PWMH1      (1u << 1)  /**< \brief Pwm signal: PWMH1 */
122 #define PIO_PA12B_PWMH1     (1u << 12) /**< \brief Pwm signal: PWMH1 */
123 #define PIO_PA24B_PWMH1     (1u << 24) /**< \brief Pwm signal: PWMH1 */
124 #define PIO_PB1A_PWMH1      (1u << 1)  /**< \brief Pwm signal: PWMH1 */
125 #define PIO_PC19B_PWMH1     (1u << 19) /**< \brief Pwm signal: PWMH1 */
126 #define PIO_PA2A_PWMH2      (1u << 2)  /**< \brief Pwm signal: PWMH2 */
127 #define PIO_PA13B_PWMH2     (1u << 13) /**< \brief Pwm signal: PWMH2 */
128 #define PIO_PA25B_PWMH2     (1u << 25) /**< \brief Pwm signal: PWMH2 */
129 #define PIO_PB4B_PWMH2      (1u << 4)  /**< \brief Pwm signal: PWMH2 */
130 #define PIO_PC20B_PWMH2     (1u << 20) /**< \brief Pwm signal: PWMH2 */
131 #define PIO_PA7B_PWMH3      (1u << 7)  /**< \brief Pwm signal: PWMH3 */
132 #define PIO_PA14B_PWMH3     (1u << 14) /**< \brief Pwm signal: PWMH3 */
133 #define PIO_PA17C_PWMH3     (1u << 17) /**< \brief Pwm signal: PWMH3 */
134 #define PIO_PB14B_PWMH3     (1u << 14) /**< \brief Pwm signal: PWMH3 */
135 #define PIO_PC21B_PWMH3     (1u << 21) /**< \brief Pwm signal: PWMH3 */
136 #define PIO_PA19B_PWML0     (1u << 19) /**< \brief Pwm signal: PWML0 */
137 #define PIO_PB5B_PWML0      (1u << 5)  /**< \brief Pwm signal: PWML0 */
138 #define PIO_PC0B_PWML0      (1u << 0)  /**< \brief Pwm signal: PWML0 */
139 #define PIO_PC13B_PWML0     (1u << 13) /**< \brief Pwm signal: PWML0 */
140 #define PIO_PA20B_PWML1     (1u << 20) /**< \brief Pwm signal: PWML1 */
141 #define PIO_PB12A_PWML1     (1u << 12) /**< \brief Pwm signal: PWML1 */
142 #define PIO_PC1B_PWML1      (1u << 1)  /**< \brief Pwm signal: PWML1 */
143 #define PIO_PC15B_PWML1     (1u << 15) /**< \brief Pwm signal: PWML1 */
144 #define PIO_PA16C_PWML2     (1u << 16) /**< \brief Pwm signal: PWML2 */
145 #define PIO_PA30A_PWML2     (1u << 30) /**< \brief Pwm signal: PWML2 */
146 #define PIO_PB13A_PWML2     (1u << 13) /**< \brief Pwm signal: PWML2 */
147 #define PIO_PC2B_PWML2      (1u << 2)  /**< \brief Pwm signal: PWML2 */
148 #define PIO_PA15C_PWML3     (1u << 15) /**< \brief Pwm signal: PWML3 */
149 #define PIO_PC3B_PWML3      (1u << 3)  /**< \brief Pwm signal: PWML3 */
150 #define PIO_PC22B_PWML3     (1u << 22) /**< \brief Pwm signal: PWML3 */
151 /* ========== Pio definition for SPI peripheral ========== */
152 #define PIO_PA12A_MISO      (1u << 12) /**< \brief Spi signal: MISO */
153 #define PIO_PA13A_MOSI      (1u << 13) /**< \brief Spi signal: MOSI */
154 #define PIO_PA11A_NPCS0     (1u << 11) /**< \brief Spi signal: NPCS0 */
155 #define PIO_PA9B_NPCS1      (1u << 9)  /**< \brief Spi signal: NPCS1 */
156 #define PIO_PA31A_NPCS1     (1u << 31) /**< \brief Spi signal: NPCS1 */
157 #define PIO_PB14A_NPCS1     (1u << 14) /**< \brief Spi signal: NPCS1 */
158 #define PIO_PC4B_NPCS1      (1u << 4)  /**< \brief Spi signal: NPCS1 */
159 #define PIO_PA10B_NPCS2     (1u << 10) /**< \brief Spi signal: NPCS2 */
160 #define PIO_PA30B_NPCS2     (1u << 30) /**< \brief Spi signal: NPCS2 */
161 #define PIO_PB2B_NPCS2      (1u << 2)  /**< \brief Spi signal: NPCS2 */
162 #define PIO_PA3B_NPCS3      (1u << 3)  /**< \brief Spi signal: NPCS3 */
163 #define PIO_PA5B_NPCS3      (1u << 5)  /**< \brief Spi signal: NPCS3 */
164 #define PIO_PA22B_NPCS3     (1u << 22) /**< \brief Spi signal: NPCS3 */
165 #define PIO_PA14A_SPCK      (1u << 14) /**< \brief Spi signal: SPCK */
166 /* ========== Pio definition for SSC peripheral ========== */
167 #define PIO_PA18A_RD        (1u << 18) /**< \brief Ssc signal: RD */
168 #define PIO_PA20A_RF        (1u << 20) /**< \brief Ssc signal: RF */
169 #define PIO_PA19A_RK        (1u << 19) /**< \brief Ssc signal: RK */
170 #define PIO_PA17A_TD        (1u << 17) /**< \brief Ssc signal: TD */
171 #define PIO_PA15A_TF        (1u << 15) /**< \brief Ssc signal: TF */
172 #define PIO_PA16A_TK        (1u << 16) /**< \brief Ssc signal: TK */
173 /* ========== Pio definition for TC0 peripheral ========== */
174 #define PIO_PA4B_TCLK0      (1u << 4)  /**< \brief Tc0 signal: TCLK0 */
175 #define PIO_PA28B_TCLK1     (1u << 28) /**< \brief Tc0 signal: TCLK1 */
176 #define PIO_PA29B_TCLK2     (1u << 29) /**< \brief Tc0 signal: TCLK2 */
177 #define PIO_PA0B_TIOA0      (1u << 0)  /**< \brief Tc0 signal: TIOA0 */
178 #define PIO_PA15B_TIOA1     (1u << 15) /**< \brief Tc0 signal: TIOA1 */
179 #define PIO_PA26B_TIOA2     (1u << 26) /**< \brief Tc0 signal: TIOA2 */
180 #define PIO_PA1B_TIOB0      (1u << 1)  /**< \brief Tc0 signal: TIOB0 */
181 #define PIO_PA16B_TIOB1     (1u << 16) /**< \brief Tc0 signal: TIOB1 */
182 #define PIO_PA27B_TIOB2     (1u << 27) /**< \brief Tc0 signal: TIOB2 */
183 /* ========== Pio definition for TWI0 peripheral ========== */
184 #define PIO_PA4A_TWCK0      (1u << 4)  /**< \brief Twi0 signal: TWCK0 */
185 #define PIO_PA3A_TWD0       (1u << 3)  /**< \brief Twi0 signal: TWD0 */
186 /* ========== Pio definition for TWI1 peripheral ========== */
187 #define PIO_PB5A_TWCK1      (1u << 5)  /**< \brief Twi1 signal: TWCK1 */
188 #define PIO_PB4A_TWD1       (1u << 4)  /**< \brief Twi1 signal: TWD1 */
189 /* ========== Pio definition for UART0 peripheral ========== */
190 #define PIO_PA9A_URXD0      (1u << 9)  /**< \brief Uart0 signal: URXD0 */
191 #define PIO_PA10A_UTXD0     (1u << 10) /**< \brief Uart0 signal: UTXD0 */
192 /* ========== Pio definition for UART1 peripheral ========== */
193 #define PIO_PB2A_URXD1      (1u << 2)  /**< \brief Uart1 signal: URXD1 */
194 #define PIO_PB3A_UTXD1      (1u << 3)  /**< \brief Uart1 signal: UTXD1 */
195 /* ========== Pio definition for USART0 peripheral ========== */
196 #define PIO_PA8A_CTS0       (1u << 8)  /**< \brief Usart0 signal: CTS0 */
197 #define PIO_PA7A_RTS0       (1u << 7)  /**< \brief Usart0 signal: RTS0 */
198 #define PIO_PA5A_RXD0       (1u << 5)  /**< \brief Usart0 signal: RXD0 */
199 #define PIO_PA2B_SCK0       (1u << 2)  /**< \brief Usart0 signal: SCK0 */
200 #define PIO_PA6A_TXD0       (1u << 6)  /**< \brief Usart0 signal: TXD0 */
201 /* ========== Pio indexes ========== */
202 #define PIO_PA0_IDX         0
203 #define PIO_PA1_IDX         1
204 #define PIO_PA2_IDX         2
205 #define PIO_PA3_IDX         3
206 #define PIO_PA4_IDX         4
207 #define PIO_PA5_IDX         5
208 #define PIO_PA6_IDX         6
209 #define PIO_PA7_IDX         7
210 #define PIO_PA8_IDX         8
211 #define PIO_PA9_IDX         9
212 #define PIO_PA10_IDX        10
213 #define PIO_PA11_IDX        11
214 #define PIO_PA12_IDX        12
215 #define PIO_PA13_IDX        13
216 #define PIO_PA14_IDX        14
217 #define PIO_PA15_IDX        15
218 #define PIO_PA16_IDX        16
219 #define PIO_PA17_IDX        17
220 #define PIO_PA18_IDX        18
221 #define PIO_PA19_IDX        19
222 #define PIO_PA20_IDX        20
223 #define PIO_PB0_IDX         32
224 #define PIO_PB1_IDX         33
225 #define PIO_PB2_IDX         34
226 #define PIO_PB3_IDX         35
227 #define PIO_PB4_IDX         36
228 #define PIO_PB5_IDX         37
229 #define PIO_PB6_IDX         38
230 #define PIO_PB7_IDX         39
231 #define PIO_PB8_IDX         40
232 #define PIO_PB9_IDX         41
233 #define PIO_PB10_IDX        42
234 #define PIO_PB11_IDX        43
235 #define PIO_PB12_IDX        44
236 
237 #endif /* _SAM4S2A_PIO_ */
238