source: rtems/c/src/lib/libbsp/arm/atsam/libraries/libboard/board_v71_xult.h @ c354fac

5
Last change on this file since c354fac was c354fac, checked in by Sebastian Huber <sebastian.huber@…>, on Jan 14, 2016 at 2:48:44 PM

bsp/atsam: Port SAM Software Package to RTEMS

Update #2529.

  • Property mode set to 100644
File size: 27.9 KB
Line 
1/* ---------------------------------------------------------------------------- */
2/*                  Atmel Microcontroller Software Support                      */
3/*                       SAM Software Package License                           */
4/* ---------------------------------------------------------------------------- */
5/* Copyright (c) 2015, 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/**
31 * \page samv7_Xplained_ultra_board_desc SAM V71 Xplained Ultra - Board
32 * Description
33 *
34 * \section Purpose
35 *
36 * This file is dedicated to describe the SAM V71 Xplained Ultra board.
37 *
38 * \section Contents
39 *
40 *  - For SAM V71 Xplained Ultra board information, see
41 *    \subpage samv7_Xplained_ultra_board_info.
42 *  - For operating frequency information, see \subpage samv7_Xplained_ultra_opfreq.
43 *  - For using portable PIO definitions, see \subpage samv7_Xplained_ultra_piodef.
44 *  - For using GMAC PIO definitions, see \subpage samv7_Xplained_ultra_gmac.
45 *  - For using ISI definitions, see \subpage samv7_Xplained_ultra_isi.
46 *  - For on-board memories, see \subpage samv7_Xplained_ultra_mem.
47 *  - Several USB definitions are included here,
48 *    see \subpage samv7_Xplained_ultra_usb.
49 *  - For External components, see \subpage samv7_Xplained_ultra_extcomp.
50 *  - For Individual chip definition, see \subpage samv7_Xplained_ultra_chipdef.
51 *
52 * To get more software details and the full list of parameters related to the
53 * SAM V71 Xplained Ultra board configuration, please have a look at the source
54 * file:
55 * \ref board.h, \ref board_v71_xult.h\n
56 *
57 * \section Usage
58 *
59 *  - The code for booting the board is provided by startup_samv71.c and
60 *    board_lowlevel.c.
61 *  - For using board PIOs, board characteristics (clock, etc.) and external
62 *    components, see board.h, board_v71_xult.h.
63 *  - For manipulating memories, see board_memories.h.
64 *
65 * This file can be used as a template and modified to fit a custom board, with
66 * specific PIOs usage or memory connections.
67 */
68
69/**
70 *  \file board.h
71 *
72 *  Definition of SAM V71 Xplained Ultra board characteristics, PIOs and
73 *  external components interface.
74 */
75
76#ifndef _BOARD_V71_XULT_H_
77#define _BOARD_V71_XULT_H_
78
79/*----------------------------------------------------------------------------
80 *        Headers
81 *----------------------------------------------------------------------------*/
82
83#include "chip.h"
84
85#include "include/board_lowlevel.h"
86#include "include/board_memories.h"
87#include "include/led.h"
88#include "include/gmii.h"
89#include "include/gmacb_phy.h"
90#include "include/dbg_console.h"
91#include "include/bmp.h"
92#include "include/lcdd.h"
93#include "include/ili9488.h"
94#include "include/ili9488_reg.h"
95#include "include/ili9488_spi.h"
96#include "include/ili9488_ebi.h"
97#include "include/ili9488_dma.h"
98#include "include/ili9488_spi_dma.h"
99#include "include/ili9488_ebi_dma.h"
100#include "include/frame_buffer.h"
101#include "include/lcd_color.h"
102#include "include/lcd_draw.h"
103#include "include/lcd_font10x14.h"
104#include "include/lcd_font.h"
105#include "include/lcd_gimp_image.h"
106#include "include/rtc_calib.h"
107#include "include/wm8904.h"
108#include "include/cs2100.h"
109#include "include/s25fl1.h"
110#include "include/image_sensor_inf.h"
111#include "include/iso7816_4.h"
112
113#ifndef __rtems__
114#if defined (__GNUC__)
115        #include "include/syscalls.h"
116#endif
117#endif /* __rtems__ */
118/*----------------------------------------------------------------------------
119 *        Definitions
120 *----------------------------------------------------------------------------*/
121
122/*----------------------------------------------------------------------------*/
123/**
124 * \page samv7_Xplained_ultra_board_info "SAM V71 Xplained Ultra - Board informations"
125 * This page lists several definition related to the board description.
126 *
127 * \section Definitions
128 * - \ref BOARD_NAME
129 */
130
131/** Name of the board */
132#define BOARD_NAME "SAM V71 Xplained Ultra"
133#define NO_PUSHBUTTON
134#ifndef __rtems__
135/*----------------------------------------------------------------------------*/
136/**
137 *  \page samv7_Xplained_ultra_opfreq "SAM V71 Xplained Ultra - Operating frequencies"
138 *  This page lists several definition related to the board operating frequency
139 *  (when using the initialization done by board_lowlevel.c).
140 *
141 *  \section Definitions
142 *  - \ref BOARD_MAINOSC
143 *  - \ref BOARD_MCK
144 */
145
146/** Frequency of the board main oscillator */
147#define BOARD_MAINOSC    12000000
148
149/** Master clock frequency (when using board_lowlevel.c) */
150
151#ifdef MCK_123MHZ
152        #define BOARD_MCK    123000000
153#else
154        #define BOARD_MCK    150000000
155#endif
156#endif /* __rtems__ */
157
158#if (BOARD_MCK==123000000)
159
160        #define PLL_MUL    0x16
161        #define PLL_DIV    0x01
162
163#else   // 300MHz(PCK) and 150MHz(MCK) by default
164
165        #define PLL_MUL    0x19
166        #define PLL_DIV    0x01
167
168#endif
169
170/*----------------------------------------------------------------------------*/
171/**
172 * \page samv7_Xplained_ultra_piodef "SAM V71 Xplained Ultra - PIO definitions"
173 * This pages lists all the PIOs definitions contained in board.h. The constants
174 * are named using the following convention: PIN_* for a constant which defines
175 * a single Pin instance (but may include several PIOs sharing the same
176 * controller), and PINS_* for a list of Pin instances.
177 *
178 * UART0
179 * - \ref PINS_UART0
180 *
181 * UART4
182 * - \ref PINS_UART4
183 *
184 * LEDs
185 * - \ref PIN_LED_0
186 * - \ref PIN_LED_1
187 * - \ref PINS_LEDS
188 *
189 * Push buttons
190 * - \ref PIN_PUSHBUTTON_0
191 * - \ref PIN_PUSHBUTTON_1
192 * - \ref PINS_PUSHBUTTONS
193 * - \ref PUSHBUTTON_BP0
194 * - \ref PUSHBUTTON_BP1
195 *
196 * PWMC
197 * - \ref PIN_PWMC_PWMH0
198 * - \ref PIN_PWMC_PWMH1
199 * - \ref PIN_PWM_LED0
200 * - \ref PIN_PWM_LED1
201 * - \ref CHANNEL_PWM_LED0
202 * - \ref CHANNEL_PWM_LED1
203 *
204 * SPI
205 * - \ref PIN_SPI_MISO
206 * - \ref PIN_SPI_MOSI
207 * - \ref PIN_SPI_SPCK
208 * - \ref PINS_SPI
209 *
210 * PCK0
211 * - \ref PIN_PCK0
212 * - \ref PIN_PCK1
213 * - \ref PIN_PCK2
214 *
215 * PIO PARALLEL CAPTURE
216 * - \ref PIN_PIODCEN1
217 * - \ref PIN_PIODCEN2
218 *
219 * TWI
220 * - \ref TWI_V3XX
221 * - \ref PIN_TWI_TWD0
222 * - \ref PIN_TWI_TWCK0
223 * - \ref PINS_TWI0
224 * - \ref PIN_TWI_TWD1
225 * - \ref PIN_TWI_TWCK1
226 * - \ref PINS_TWI1
227 *
228 * USART0
229 * - \ref PIN_USART0_RXD
230 * - \ref PIN_USART0_TXD
231 * - \ref PIN_USART0_CTS
232 * - \ref PIN_USART0_RTS
233 * - \ref PIN_USART0_SCK
234 *
235 * USART1
236 * - \ref PIN_USART1_RXD
237 * - \ref PIN_USART1_TXD
238 * - \ref PIN_USART1_CTS
239 * - \ref PIN_USART1_RTS
240 * - \ref PIN_USART1_SCK
241 *
242 * USART2
243 * - \ref PIN_USART2_RXD
244 * - \ref PIN_USART2_TXD
245 * - \ref PIN_USART2_CTS
246 * - \ref PIN_USART2_RTS
247 * - \ref PIN_USART2_SCK
248 *
249 * SSC
250 * - \ref PIN_SSC_TD
251 * - \ref PIN_SSC_TK
252 * - \ref PIN_SSC_TF
253 * - \ref PIN_SSC_RD
254 * - \ref PIN_SSC_RK
255 * - \ref PIN_SSC_RF
256 * - \ref PIN_SSC_TD
257 * - \ref PINS_SSC_CODEC
258 *
259 * MCAN
260 * - \ref PIN_MCAN0_TXD
261 * - \ref PIN_MCAN0_RXD
262 * - \ref PIN_MCAN1_TXD
263 * - \ref PIN_MCAN1_RXD
264 */
265
266/** SSC pin Transmitter Data (TD) */
267#define PIN_SSC_TD  {PIO_PD26B_TD, PIOD, ID_PIOD, PIO_PERIPH_B, PIO_DEFAULT}
268/** SSC pin Transmitter Clock (TK) */
269#define PIN_SSC_TK  {PIO_PB1D_TK, PIOB, ID_PIOB, PIO_PERIPH_D, PIO_DEFAULT}
270/** SSC pin Transmitter FrameSync (TF) */
271#define PIN_SSC_TF  {PIO_PB0D_TF, PIOB, ID_PIOB, PIO_PERIPH_D, PIO_DEFAULT}
272/** SSC pin RD */
273#define PIN_SSC_RD  {PIO_PA10C_RD, PIOA, ID_PIOA, PIO_PERIPH_C, PIO_DEFAULT}
274/** SSC pin RK */
275#define PIN_SSC_RK  {PIO_PA22A_RK, PIOA, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT}
276/** SSC pin RF */
277#define PIN_SSC_RF  {PIO_PD24B_RF, PIOD, ID_PIOD, PIO_PERIPH_B, PIO_DEFAULT}
278
279/** SSC pins definition for codec. */
280#define PINS_SSC_CODEC \
281        {PIN_SSC_TD,  PIN_SSC_TK, PIN_SSC_TF, PIN_SSC_RD,  PIN_SSC_RK, PIN_SSC_RF}
282
283/** UART pins (UTXD0 and URXD0) definitions, PA9,10. */
284#define PINS_UART0  \
285        {PIO_PA9A_URXD0 | PIO_PA10A_UTXD0, PIOA, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT}
286/** UART pins (UTXD4 and URXD4) definitions, PD19,18. */
287#define PINS_UART4 \
288        {PIO_PD18C_URXD4 | PIO_PD19C_UTXD4, PIOD, ID_PIOD, PIO_PERIPH_C, PIO_DEFAULT}
289
290/* LED pins definitions */
291#define LED_YELLOW0  0
292#define LED_YELLOW1  1
293
294/** LED #0 pin definition (YELLOW). */
295#define PIN_LED_0  {PIO_PC9, PIOC, ID_PIOC, PIO_OUTPUT_1, PIO_DEFAULT}
296/** LED #1 pin definition (YELLOW). */
297#define PIN_LED_1  {PIO_PA23, PIOA, ID_PIOA, PIO_OUTPUT_1, PIO_DEFAULT}
298
299/** List of all LEDs definitions. */
300#define PINS_LEDS  {PIN_LED_0, PIN_LED_1}
301
302/** Number of LEDs */
303#define LED_NUM  2
304
305/**
306 * Push button #0 definition.
307 * Attributes = pull-up + debounce + interrupt on rising edge.
308 */
309#define PIN_PUSHBUTTON_0 \
310        {PIO_PA9, PIOA, ID_PIOA, PIO_INPUT, PIO_PULLUP | PIO_DEBOUNCE | PIO_IT_FALL_EDGE}
311/**
312 * Push button #1 definition.
313 * Attributes = pull-up + debounce + interrupt on rising edge.
314 */
315#define PIN_PUSHBUTTON_1 \
316        {PIO_PB12, PIOB, ID_PIOB, PIO_INPUT, PIO_PULLUP | PIO_DEBOUNCE | PIO_IT_FALL_EDGE}
317
318/** List of all push button definitions. */
319#define PINS_PUSHBUTTONS {PIN_PUSHBUTTON_0, PIN_PUSHBUTTON_1}
320
321/** Push button #0 index. */
322#define PUSHBUTTON_BP0  0
323/** Push button #1 index. */
324#define PUSHBUTTON_BP1  1
325
326/** Number of Buttons */
327#define BUTTON_NUM  2
328
329/** Index of wakeup source */
330#define WKUP_IDX    6
331
332/** PWMC PWM0 pin definition: Output High. */
333#define PIN_PWMC_PWMH0  {PIO_PD20A_PWMH0, PIOD, ID_PIOD, PIO_PERIPH_A, PIO_DEFAULT}
334/** PWMC PWM1 pin definition: Output High. */
335#define PIN_PWMC_PWMH1  {PIO_PD21A_PWMH1, PIOD, ID_PIOD, PIO_PERIPH_A, PIO_DEFAULT}
336/** PWM pins definition for LED0 */
337#define PIN_PWM_LED0  PIN_PWMC_PWMH0
338/** PWM pins definition for LED1 */
339#define PIN_PWM_LED1  PIN_PWMC_PWMH1
340/** PWM channel for LED0 */
341#define CHANNEL_PWM_LED0 0
342/** PWM channel for LED1 */
343#define CHANNEL_PWM_LED1 1
344
345/** SPI MISO pin definition. */
346#define PIN_SPI_MISO {PIO_PD20B_SPI0_MISO, PIOD, ID_PIOD, PIO_PERIPH_B, PIO_DEFAULT}
347/** SPI MOSI pin definition. */
348#define PIN_SPI_MOSI {PIO_PD21B_SPI0_MOSI, PIOD, ID_PIOD, PIO_PERIPH_B, PIO_DEFAULT}
349/** SPI SPCK pin definition. */
350#define PIN_SPI_SPCK {PIO_PD22B_SPI0_SPCK, PIOD, ID_PIOD, PIO_PERIPH_B, PIO_DEFAULT}
351/** SPI chip select pin definition. */
352#define PIN_SPI_NPCS0 {PIO_PB2D_SPI0_NPCS0, PIOB, ID_PIOB, PIO_PERIPH_D, PIO_DEFAULT}
353#define PIN_SPI_NPCS1 {PIO_PD25B_SPI0_NPCS1, PIOD, ID_PIOD, PIO_PERIPH_B, PIO_DEFAULT}
354#define PIN_SPI_NPCS3 {PIO_PD27B_SPI0_NPCS3, PIOD, ID_PIOD, PIO_PERIPH_B, PIO_DEFAULT}
355
356/** List of SPI pin definitions (MISO, MOSI & SPCK). */
357#define PINS_SPI  PIN_SPI_MISO, PIN_SPI_MOSI, PIN_SPI_SPCK
358
359/** PCK0 */
360#define PIN_PCK0  {PIO_PB13B_PCK0, PIOB, ID_PIOB, PIO_PERIPH_B, PIO_DEFAULT}
361/** PCK1 */
362#define PIN_PCK1  {PIO_PA17B_PCK1, PIOB, ID_PIOB, PIO_PERIPH_B, PIO_DEFAULT}
363/** PCK2 */
364#define PIN_PCK2   {PIO_PA18B_PCK2, PIOA, ID_PIOA, PIO_PERIPH_B, PIO_DEFAULT}
365
366
367/** PIO PARALLEL CAPTURE */
368/** Parallel Capture Mode Data Enable1 */
369#define PIN_PIODCEN1 PIO_PA15
370/** Parallel Capture Mode Data Enable2 */
371#define PIN_PIODCEN2 PIO_PA16
372
373/** TWI version 3.xx */
374#define TWI_V3XX
375/** TWI0 data pin */
376#define PIN_TWI_TWD0 {PIO_PA3A_TWD0, PIOA, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT}
377/** TWI0 clock pin */
378#define PIN_TWI_TWCK0 {PIO_PA4A_TWCK0, PIOA, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT}
379/** TWI0 pins */
380#define PINS_TWI0  {PIN_TWI_TWD0, PIN_TWI_TWCK0}
381
382/** TWI1 data pin */
383#define PIN_TWI_TWD1 {PIO_PB4A_TWD1, PIOB, ID_PIOB, PIO_PERIPH_A, PIO_DEFAULT}
384/** TWI1 clock pin */
385#define PIN_TWI_TWCK1 {PIO_PB5A_TWCK1, PIOB, ID_PIOB, PIO_PERIPH_A,PIO_DEFAULT}
386/** TWI1 pins */
387#define PINS_TWI1  {PIN_TWI_TWD1, PIN_TWI_TWCK1}
388
389/** USART0 pin RX */
390#define PIN_USART0_RXD {PIO_PB0C_RXD0, PIOB, ID_PIOB, PIO_PERIPH_C, PIO_DEFAULT}
391/** USART0 pin TX */
392#define PIN_USART0_TXD {PIO_PB1C_TXD0, PIOB, ID_PIOB, PIO_PERIPH_C, PIO_DEFAULT}
393/** USART0 pin CTS */
394#define PIN_USART0_CTS {PIO_PB2C_CTS0, PIOB, ID_PIOB, PIO_PERIPH_C, PIO_DEFAULT}
395/** USART0 pin RTS */
396#define PIN_USART0_RTS {PIO_PB3C_RTS0, PIOB, ID_PIOB, PIO_PERIPH_C, PIO_DEFAULT}
397/** USART0 pin SCK */
398#define PIN_USART0_SCK {PIO_PB13C_SCK0, PIOB, ID_PIOB, PIO_PERIPH_C,PIO_DEFAULT}
399
400/** USART1 pin RX */
401#define PIN_USART1_RXD {PIO_PA21A_RXD1, PIOA, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT}
402/** USART1 pin TX */
403#define PIN_USART1_TXD {PIO_PB4D_TXD1, PIOB, ID_PIOB, PIO_PERIPH_D, PIO_DEFAULT}
404/** USART1 pin CTS */
405#define PIN_USART1_CTS {PIO_PA25A_CTS1, PIOA, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT}
406/** USART1 pin RTS */
407#define PIN_USART1_RTS {PIO_PA24A_RTS1, PIOA, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT}
408/** USART1 pin ENABLE */
409#define PIN_USART1_EN {PIO_PA23A_SCK1, PIOA, ID_PIOA, PIO_OUTPUT_0, PIO_DEFAULT}
410/** USART1 pin SCK */
411#define PIN_USART1_SCK {PIO_PA23A_SCK1, PIOA, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT}
412
413/** USART2 pin RX */
414#define PIN_USART2_RXD {PIO_PD15B_RXD2, PIOD, ID_PIOD, PIO_PERIPH_B, PIO_DEFAULT}
415/** USART2 pin TX */
416#define PIN_USART2_TXD {PIO_PD16B_TXD2, PIOD, ID_PIOD, PIO_PERIPH_B, PIO_DEFAULT}
417/** USART2 pin CTS */
418#define PIN_USART2_CTS {PIO_PD19B_CTS2, PIOD, ID_PIOD, PIO_PERIPH_B, PIO_DEFAULT}
419/** USART2 pin RTS */
420#define PIN_USART2_RTS {PIO_PD18B_RTS2, PIOD, ID_PIOD, PIO_PERIPH_B, PIO_DEFAULT}
421/** USART2 pin SCK */
422#define PIN_USART2_SCK {PIO_PD17B_SCK2, PIOD, ID_PIOD, PIO_PERIPH_B, PIO_DEFAULT}
423
424/*Pins for USART0 as 7816 mode*/
425/** PIN used for reset the smartcard */
426#define PIN_ISO7816_RSTMC  {PIO_PB2C_CTS0, PIOB, ID_PIOB, PIO_OUTPUT_0, PIO_DEFAULT}
427/** Pins used for connect the smartcard */
428#define PINS_ISO7816        PIN_USART0_TXD, PIN_USART0_SCK,PIN_ISO7816_RSTMC
429
430/** MCAN0 pin Transmit Data (TXD) */
431#define PIN_MCAN0_TXD {PIO_PB2A_CANTX0, PIOA, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT}
432/** MCAN0 pin Receive Data (RXD) */
433#define PIN_MCAN0_RXD {PIO_PB3A_CANRX0, PIOA, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT}
434
435/** MCAN1 pin Transmit Data (TXD) */
436#define PIN_MCAN1_TXD {PIO_PC14C_CANTX1, PIOC, ID_PIOC, PIO_PERIPH_C, PIO_DEFAULT}
437/** MCAN1 pin Receive Data (RXD) */
438#define PIN_MCAN1_RXD {PIO_PC12C_CANRX1, PIOC, ID_PIOC, PIO_PERIPH_C, PIO_DEFAULT}
439
440/*----------------------------------------------------------------------------*/
441/**
442 * \page samv7_Xplained_ultra_gmac "SAM V71 Xplained Ultra - GMAC"
443 * \section GMAC
444 * - \ref BOARD_GMAC_PHY_ADDR
445 * - \ref BOARD_GMAC_PHY_COMP_KSZ8061RNB
446 * - \ref BOARD_GMAC_MODE_RMII
447 * - \ref BOARD_GMAC_PINS
448 * - \ref BOARD_GMAC_RESET_PIN
449 *
450 */
451/** PHY address */
452#define BOARD_GMAC_PHY_ADDR             1
453/** PHY Component */
454#define BOARD_GMAC_PHY_COMP_KSZ8061RNB  1
455/** Board GMAC power control - ALWAYS ON */
456#define BOARD_GMAC_POWER_ALWAYS_ON
457/** Board GMAC work mode - RMII/MII (1 / 0) */
458#define BOARD_GMAC_MODE_RMII            1
459
460/** The PIN list of PIO for GMAC */
461#define BOARD_GMAC_PINS \
462        { (PIO_PD0A_GTXCK | PIO_PD1A_GTXEN | PIO_PD2A_GTX0 | PIO_PD3A_GTX1 \
463                | PIO_PD4A_GRXDV | PIO_PD5A_GRX0 | PIO_PD6A_GRX1 | PIO_PD7A_GRXER \
464                | PIO_PD8A_GMDC | PIO_PD9A_GMDIO),PIOD, ID_PIOD, PIO_PERIPH_A, PIO_DEFAULT}, \
465        {PIO_PC30, PIOC, ID_PIOC, PIO_INPUT,    PIO_PULLUP},\
466        {PIO_PA29, PIOA, ID_PIOA, PIO_INPUT,    PIO_DEFAULT}
467
468/** The PIN list of PIO for GMAC */
469#define BOARD_GMAC_RESET_PIN {PIO_PC10, PIOC, ID_PIOC, PIO_OUTPUT_1, PIO_PULLUP}
470
471/** The runtime pin configure list for GMAC */
472#define BOARD_GMAC_RUN_PINS  BOARD_GMAC_PINS
473
474
475/*----------------------------------------------------------------------------*/
476/**
477 * \page samv7_Xplained_ultra_isi "SAM V71 Xplained Ultra - ISI"
478 * This page lists all the IO definitions connected to ISI module.
479 * ISI
480 * - \ref PIN_ISI_D0
481 * - \ref PIN_ISI_D1
482 * - \ref PIN_ISI_D2
483 * - \ref PIN_ISI_D3
484 * - \ref PIN_ISI_D4
485 * - \ref PIN_ISI_D5
486 * - \ref PIN_ISI_D6
487 * - \ref PIN_ISI_D7
488 * - \ref PIN_ISI_D8
489 * - \ref PIN_ISI_D9
490 * - \ref BOARD_ISI_VSYNC
491 * - \ref BOARD_ISI_HSYNC
492 * - \ref BOARD_ISI_PCK
493 * - \ref BOARD_ISI_PINS
494 *
495 */
496#define PIN_ISI_D0  {PIO_PD22D_ISI_D0,  PIOD, ID_PIOD, PIO_PERIPH_D, PIO_PULLUP}
497#define PIN_ISI_D1  {PIO_PD21D_ISI_D1,  PIOD, ID_PIOD, PIO_PERIPH_D, PIO_PULLUP}
498#define PIN_ISI_D2  {PIO_PB3D_ISI_D2,   PIOB, ID_PIOB, PIO_PERIPH_D, PIO_PULLUP}
499#define PIN_ISI_D3  {PIO_PA9B_ISI_D3,   PIOA, ID_PIOA, PIO_PERIPH_B, PIO_PULLUP}
500#define PIN_ISI_D4  {PIO_PA5B_ISI_D4,   PIOA, ID_PIOA, PIO_PERIPH_B, PIO_PULLUP}
501#define PIN_ISI_D5  {PIO_PD11D_ISI_D5,  PIOD, ID_PIOD, PIO_PERIPH_D, PIO_PULLUP}
502#define PIN_ISI_D6  {PIO_PD12D_ISI_D6,  PIOD, ID_PIOD, PIO_PERIPH_D, PIO_PULLUP}
503#define PIN_ISI_D7  {PIO_PA27D_ISI_D7,  PIOA, ID_PIOA, PIO_PERIPH_D, PIO_PULLUP}
504#define PIN_ISI_D8  {PIO_PD27D_ISI_D8,  PIOD, ID_PIOD, PIO_PERIPH_D, PIO_PULLUP}
505#define PIN_ISI_D9  {PIO_PD28D_ISI_D9,  PIOD, ID_PIOD, PIO_PERIPH_D, PIO_PULLUP}
506
507#define BOARD_ISI_VSYNC {PIO_PD25D_ISI_VSYNC, PIOD, ID_PIOD, PIO_PERIPH_D, PIO_DEFAULT}
508#define BOARD_ISI_HSYNC {PIO_PD24D_ISI_HSYNC, PIOD, ID_PIOD, PIO_PERIPH_D, PIO_DEFAULT}
509#define BOARD_ISI_PCK   {PIO_PA24D_ISI_PCK, PIOA, ID_PIOA, PIO_PERIPH_D, PIO_DEFAULT}
510
511#define BOARD_ISI_PCK0  { PIO_PA6B_PCK0,  PIOA, ID_PIOA, PIO_PERIPH_B, PIO_DEFAULT }
512#define BOARD_ISI_RST   { 1 << 13, PIOB, ID_PIOB, PIO_OUTPUT_1, PIO_DEFAULT }
513#define BOARD_ISI_PWD   { 1 << 19,  PIOC, ID_PIOC, PIO_OUTPUT_1, PIO_DEFAULT }
514
515#define BOARD_ISI_PINS \
516        PIN_ISI_D0, PIN_ISI_D1, PIN_ISI_D2,PIN_ISI_D3,PIN_ISI_D4, PIN_ISI_D5,\
517        PIN_ISI_D6,PIN_ISI_D7,PIN_ISI_D8, PIN_ISI_D9,BOARD_ISI_VSYNC ,\
518        BOARD_ISI_HSYNC ,BOARD_ISI_PCK, BOARD_ISI_RST, BOARD_ISI_PWD,BOARD_ISI_PCK0
519
520/*----------------------------------------------------------------------------*/
521/**
522 * \page samv7_Xplained_ultra_usb "SAM V71 Xplained Ultra - USB device"
523 *
524 * \section Definitions
525 * - \ref BOARD_USB_BMATTRIBUTES
526 *
527 * \section vBus
528 * - \ref PIN_USB_VBUS
529 *
530 */
531
532/**
533 * USB attributes configuration descriptor (bus or self powered,
534 * remote wakeup)
535 */
536#define BOARD_USB_BMATTRIBUTES USBConfigurationDescriptor_SELFPOWERED_NORWAKEUP
537
538/** USB VBus monitoring pin definition. */
539#define PIN_USB_VBUS {PIO_PC16, PIOC, ID_PIOC, PIO_INPUT, PIO_DEFAULT}
540
541
542/*----------------------------------------------------------------------------*/
543/**
544 * \page samv7_Xplained_ultra_extcomp "SAM V71 Xplained Ultra - External components"
545 * This page lists the definitions related to external on-board components
546 * located in the board.h file for the SAM V71 Xplained Ultra board.
547 *
548 * LCD
549 */
550/** Indicates board has an ILI9325 external component to manage LCD. */
551#define BOARD_LCD_ILI9488
552//#define BOARD_LCD_SPI_EXT1
553#define BOARD_LCD_SPI_EXT2
554
555/** SPI pin definition for LCD */
556#if defined (BOARD_LCD_SPI_EXT1)
557/** SPI MISO pin definition. */
558#define LCD_SPI_MISO {PIO_PD20B_SPI0_MISO, PIOD, ID_PIOD, PIO_PERIPH_B, PIO_DEFAULT}
559/** SPI MOSI pin definition. */
560#define LCD_SPI_MOSI {PIO_PD21B_SPI0_MOSI, PIOD, ID_PIOD, PIO_PERIPH_B, PIO_DEFAULT}
561/** SPI SPCK pin definition. */
562#define LCD_SPI_SPCK {PIO_PD22B_SPI0_SPCK, PIOD, ID_PIOD, PIO_PERIPH_B, PIO_DEFAULT}
563/** SPI chip select pin definition. */
564#define LCD_SPI_NPCS {PIO_PD27B_SPI0_NPCS3, PIOD, ID_PIOD, PIO_PERIPH_B,PIO_DEFAULT}
565
566/** SPI chip select pin definition. */
567#define LCD_SPI_NPCS    {PIO_PD25B_SPI0_NPCS1, PIOD, ID_PIOD, PIO_PERIPH_B,PIO_DEFAULT}
568
569/** LCD pins definition. */
570#define BOARD_SPI_LCD_PINS  {LCD_SPI_MISO, LCD_SPI_MOSI, LCD_SPI_SPCK, LCD_SPI_NPCS}
571
572/** Back-light pin definition. */
573
574#define BOARD_SPI_LCD_BACKLIGHT_PIN  \
575        {PIO_PA0A_PWMC0_PWMH0, PIOA, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT}
576
577/** PWMC PWM0 pin definition: Output Low. */
578#define LCD_SPI_PIN_RESET   {PIO_PD28, PIOD, ID_PIOD, PIO_OUTPUT_1, PIO_DEFAULT}
579
580/** PWM channel for LED0 */
581#define CHANNEL_PWM_LCD 0
582
583#endif
584/*ENDIF BOARD_LCD_SPI_EXT1 */
585
586#if defined (BOARD_LCD_SPI_EXT2)
587/** SPI MISO pin definition. */
588#define LCD_SPI_MISO {PIO_PD20B_SPI0_MISO, PIOD, ID_PIOD, PIO_PERIPH_B, PIO_DEFAULT}
589/** SPI MOSI pin definition. */
590#define LCD_SPI_MOSI {PIO_PD21B_SPI0_MOSI, PIOD, ID_PIOD, PIO_PERIPH_B, PIO_DEFAULT}
591/** SPI SPCK pin definition. */
592#define LCD_SPI_SPCK {PIO_PD22B_SPI0_SPCK, PIOD, ID_PIOD, PIO_PERIPH_B, PIO_DEFAULT}
593/** SPI chip select pin definition. */
594#define LCD_SPI_NPCS {PIO_PD27B_SPI0_NPCS3, PIOD, ID_PIOD, PIO_PERIPH_B,PIO_DEFAULT}
595
596/** LCD pins definition. */
597#define BOARD_SPI_LCD_PINS  {LCD_SPI_MISO, LCD_SPI_MOSI, LCD_SPI_SPCK, LCD_SPI_NPCS}
598
599/** Back-light pin definition. */
600
601#define BOARD_SPI_LCD_PIN_BACKLIGHT  \
602        {PIO_PC19B_PWMC0_PWMH2, PIOC, ID_PIOC, PIO_OUTPUT_1, PIO_DEFAULT}
603
604/** PWMC PWM0 pin definition: Output Low. */
605#define LCD_SPI_PIN_RESET   {PIO_PA24, PIOA, ID_PIOA, PIO_OUTPUT_1, PIO_DEFAULT}
606
607/** LCD command/data select pin */
608#define BOARD_SPI_LCD_PIN_CDS   {PIO_PA6, PIOA, ID_PIOA, PIO_OUTPUT_1, PIO_DEFAULT}
609
610/** PWM channel for LED0 */
611#define CHANNEL_PWM_LCD 2
612
613#endif
614/*ENDIF BOARD_LCD_SPI_EXT2 */
615
616/** SMC pin definition for LCD */
617/** LCD data pin */
618#define PIN_EBI_LCD_DATAL           {0xFF, PIOC, ID_PIOC, PIO_PERIPH_A, PIO_PULLUP}
619#define PIN_EBI_LCD_DATAH_0         {0x3F, PIOE, ID_PIOE, PIO_PERIPH_A, PIO_PULLUP}
620#define PIN_EBI_LCD_DATAH_1         {PIO_PA15A_D14|PIO_PA16A_D15, PIOA, ID_PIOA, PIO_PERIPH_A, PIO_PULLUP}
621/** LCD WE pin */
622#define PIN_EBI_LCD_NWE             {PIO_PC8A_NWE,  PIOC, ID_PIOC, PIO_PERIPH_A, PIO_PULLUP}
623/** LCD RD pin */
624#define PIN_EBI_LCD_NRD             {PIO_PC11A_NRD, PIOC, ID_PIOC, PIO_PERIPH_A, PIO_PULLUP}
625/* LCD CS pin (NCS3) */
626#define PIN_EBI_LCD_CS              {PIO_PD19A_NCS3, PIOD, ID_PIOD, PIO_PERIPH_A, PIO_PULLUP}
627/** LCD command/data select pin */
628#define BOARD_EBI_LCD_PIN_CDS       {PIO_PC30, PIOC, ID_PIOC, PIO_OUTPUT_1, PIO_DEFAULT}
629/** Back-light pin definition. */
630#define BOARD_EBI_LCD_PIN_BACKLIGHT {PIO_PC9B_TIOB7, PIOC, ID_PIOC, PIO_PERIPH_B, PIO_DEFAULT}
631/** LCD reset pin */
632#define LCD_EBI_PIN_RESET           {PIO_PC13, PIOC, ID_PIOC, PIO_OUTPUT_1, PIO_DEFAULT}
633
634/** LCD pins definition. */
635#define BOARD_EBI_LCD_PINS          \
636        {PIN_EBI_LCD_DATAL, PIN_EBI_LCD_DATAH_0, PIN_EBI_LCD_DATAH_1, \
637                PIN_EBI_LCD_NWE,PIN_EBI_LCD_NRD,PIN_EBI_LCD_CS}
638
639
640/** Display width in pixels. */
641#define BOARD_LCD_WIDTH             320
642/** Display height in pixels. */
643#define BOARD_LCD_HEIGHT            480
644
645
646/*----------------------------------------------------------------------------*/
647/**
648 * \page samv7_Xplained_ultra_mem "SAM V71 Xplained Ultra - Memories"
649 * This page lists definitions related to internal & external on-board memories.
650 * \section SDRAM
651 * - \ref PIN_SDRAM_D0_7
652 * - \ref PIN_SDRAM_D8_13
653 * - \ref PIN_SDRAM_D14_15
654 * - \ref PIN_SDRAM_A0_9
655 * - \ref PIN_SDRAM_SDA10
656 * - \ref PIN_SDRAM_CAS
657 * - \ref PIN_SDRAM_RAS
658 * - \ref PIN_SDRAM_SDCKE
659 * - \ref PIN_SDRAM_SDCK
660 * - \ref PIN_SDRAM_SDSC
661 * - \ref PIN_SDRAM_NBS0
662 * - \ref PIN_SDRAM_NBS1
663 * - \ref PIN_SDRAM_SDWE
664 * - \ref PIN_SDRAM_BA0
665 *
666 * \section SDMMC
667 * - \ref BOARD_MCI_PIN_CD
668 * - \ref BOARD_MCI_PIN_CK
669 * - \ref BOARD_MCI_PINS_SLOTA
670 * - \ref BOARD_SD_PINS
671 *
672 * \section QSPI
673 * - \ref PINS_QSPI_IO
674 * - \ref PINS_QSPI_IO3
675 * - \ref PINS_QSPI
676 */
677
678/** List of all SDRAM pin definitions. */
679#define BOARD_SDRAM_SIZE  (2*1024*1024)
680#define PIN_SDRAM_D0_7    {0x000000FF, PIOC, ID_PIOC, PIO_PERIPH_A, PIO_DEFAULT}
681#define PIN_SDRAM_D8_13   {0x0000003F, PIOE, ID_PIOE, PIO_PERIPH_A, PIO_DEFAULT}
682#define PIN_SDRAM_D14_15  {0x00018000, PIOA, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT}
683#define PIN_SDRAM_A0_9    {0x3FF00000, PIOC, ID_PIOC, PIO_PERIPH_A, PIO_DEFAULT}
684#define PIN_SDRAM_SDA10   {0x00002000, PIOD, ID_PIOD, PIO_PERIPH_C, PIO_DEFAULT}
685
686#define PIN_SDRAM_CAS     {0x00020000, PIOD, ID_PIOD, PIO_PERIPH_C, PIO_DEFAULT}
687#define PIN_SDRAM_RAS     {0x00010000, PIOD, ID_PIOD, PIO_PERIPH_C, PIO_DEFAULT}
688#define PIN_SDRAM_SDCKE   {0x00004000, PIOD, ID_PIOD, PIO_PERIPH_C, PIO_DEFAULT}
689#define PIN_SDRAM_SDCK    {0x00800000, PIOD, ID_PIOD, PIO_PERIPH_C, PIO_DEFAULT}
690#define PIN_SDRAM_SDSC    {0x00008000, PIOC, ID_PIOC, PIO_PERIPH_A, PIO_DEFAULT}
691#define PIN_SDRAM_NBS0    {0x00040000, PIOC, ID_PIOC, PIO_PERIPH_A, PIO_DEFAULT}
692#define PIN_SDRAM_NBS1    {0x00008000, PIOD, ID_PIOD, PIO_PERIPH_C, PIO_DEFAULT}
693#define PIN_SDRAM_SDWE    {0x20000000, PIOD, ID_PIOD, PIO_PERIPH_C, PIO_DEFAULT}
694#define PIN_SDRAM_BA0     {0x00100000, PIOA, ID_PIOA, PIO_PERIPH_C, PIO_DEFAULT}
695
696#define BOARD_SDRAM_PINS PIN_SDRAM_D0_7, PIN_SDRAM_D8_13 , PIN_SDRAM_D14_15,\
697        PIN_SDRAM_A0_9, PIN_SDRAM_SDA10, PIN_SDRAM_BA0, \
698        PIN_SDRAM_CAS, PIN_SDRAM_RAS, PIN_SDRAM_SDCKE,PIN_SDRAM_SDCK,\
699        PIN_SDRAM_SDSC,PIN_SDRAM_NBS0 ,PIN_SDRAM_NBS1,PIN_SDRAM_SDWE
700
701
702/** List of all MCI pin definitions. */
703
704/** MCI0 Card detect pin definition. (PE5) */
705#define BOARD_MCI_PIN_CD  {PIO_PD18, PIOD, ID_PIOD, PIO_INPUT, PIO_PULLUP}
706/** MCI0 Clock . */
707#define BOARD_MCI_PIN_CK  {PIO_PA25D_MCCK, PIOA, ID_PIOA, PIO_PERIPH_D, PIO_DEFAULT}
708
709/** MCI0 Solt A IO pins definition. (PC4-PC13) */
710#define BOARD_MCI_PINS_SLOTA \
711        {(PIO_PA30C_MCDA0 | PIO_PA31C_MCDA1 | PIO_PA26C_MCDA2 | PIO_PA27C_MCDA3 | PIO_PA28C_MCCDA),\
712                PIOA, ID_PIOA, PIO_PERIPH_C, PIO_DEFAULT}
713
714/** MCI pins that shall be configured to access the SD card. */
715#define BOARD_SD_PINS     {BOARD_MCI_PINS_SLOTA, BOARD_MCI_PIN_CK}
716/** MCI Card Detect pin. */
717#define BOARD_SD_PIN_CD   BOARD_MCI_PIN_CD
718/** Total number of MCI interface */
719#define BOARD_NUM_MCI     1
720
721/** List of all SQPI pin definitions. */
722#define PINS_QSPI_IO   \
723        {(PIO_PA11A_QCS | PIO_PA13A_QIO0 | PIO_PA12A_QIO1 | PIO_PA17A_QIO2 | PIO_PA14A_QSCK),\
724                PIOA, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT}
725#define PINS_QSPI_IO3   {PIO_PD31A_QIO3, PIOD, ID_PIOD, PIO_PERIPH_A, PIO_DEFAULT}
726#define PINS_QSPI      {PINS_QSPI_IO, PINS_QSPI_IO3}
727
728/*----------------------------------------------------------------------------*/
729/**
730 * \page samv7_Xplained_ultra_chipdef "SAM V71 Xplained Ultra - Individual chip definition"
731 * This page lists the definitions related to different chip's definition
732 *
733 * \section USART
734 * - \ref BOARD_PIN_USART_RXD
735 * - \ref BOARD_PIN_USART_TXD
736 * - \ref BOARD_PIN_USART_CTS
737 * - \ref BOARD_PIN_USART_RTS
738 * - \ref BOARD_PIN_USART_EN
739 * - \ref BOARD_USART_BASE
740 * - \ref BOARD_ID_USART
741 */
742
743/** Rtc */
744#define BOARD_RTC_ID   ID_RTC
745
746/** TWI ID for QTouch application to use */
747#define BOARD_ID_TWI_AT42    ID_TWI0
748/** TWI Base for QTouch application to use */
749#define BOARD_BASE_TWI_AT42  TWI0
750/** TWI pins for QTouch application to use */
751#define BOARD_PINS_TWI_AT42  PINS_TWI0
752
753/** USART RX pin for application */
754#define BOARD_PIN_USART_RXD  PIN_USART1_RXD
755/** USART TX pin for application */
756#define BOARD_PIN_USART_TXD  PIN_USART1_TXD
757/** USART CTS pin for application */
758#define BOARD_PIN_USART_CTS  PIN_USART1_CTS
759/** USART RTS pin for application */
760#define BOARD_PIN_USART_RTS  PIN_USART1_RTS
761/** USART ENABLE pin for application */
762#define BOARD_PIN_USART_EN  PIN_USART1_EN
763/** USART Base for application */
764#define BOARD_USART_BASE  USART1
765/** USART ID for application */
766#define BOARD_ID_USART   ID_USART1
767
768
769
770/*----------------------------------------------------------------------------*/
771/*
772* USB pins
773*/
774#define PINS_VBUS_EN   {PIO_PC16, PIOC, ID_PIOC, PIO_OUTPUT_1, PIO_DEFAULT}
775#endif /* #ifndef _BOARD_V71_XULT_H_ */
776
Note: See TracBrowser for help on using the repository browser.