]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/board_sama5d2-vb-bga289.h
Add SAMA5D2 Xplained IAR demo.
[freertos] / FreeRTOS / Demo / CORTEX_A5_SAMA5D2x_Xplained_IAR / AtmelFiles / target / sama5d2 / board_sama5d2-vb-bga289.h
1 /**\r
2  * \page sama5d2_xult_board_desc sama5d2-XULT - Board Description\r
3  *\r
4  * \section Purpose\r
5  *\r
6  * This file is dedicated to describe the sama5d2-XULT board.\r
7  *\r
8  * \section Contents\r
9  *\r
10  *  - sama5d2-XULT\r
11  *  - For sama5d2-XULT information, see \subpage sama5d2_xult_board_info.\r
12  *  - For operating frequency information, see \subpage sama5d2_xult_opfreq.\r
13  *  - For using portable PIO definitions, see \subpage sama5d2_xult_piodef.\r
14  *  - For on-board memories, see \subpage sama5d2_xult_mem.\r
15  *  - Several USB definitions are included here, see \subpage sama5d2_xult_usb.\r
16  *  - For External components, see \subpage sama5d2_xult_extcomp.\r
17  *  - For Individual chip definition, see \subpage sama5d2_xult_chipdef.\r
18  *\r
19  * To get more software details and the full list of parameters related to the\r
20  * sama5d2-XULT board configuration, please have a look at the source file:\r
21  * \ref board.h\n\r
22  *\r
23  * \section Usage\r
24  *\r
25  *  - The code for booting the board is provided by board_cstartup_xxx.c and\r
26  *    board_lowlevel.c.\r
27  *  - For using board PIOs, board characteristics (clock, etc.) and external\r
28  *    components, see board.h.\r
29  *  - For manipulating memories, see board_memories.h.\r
30  *\r
31  * This file can be used as a template and modified to fit a custom board, with\r
32  * specific PIOs usage or memory connections.\r
33  */\r
34 \r
35 /**\r
36  *  \file board.h\r
37  *\r
38  *  Definition of sama5d2-xb\r
39  *  characteristics, sama5d2-dependant PIOs and external components interfacing.\r
40  */\r
41 \r
42 #ifndef _BOARD_D2_H\r
43 #define _BOARD_D2_H\r
44 \r
45 /*----------------------------------------------------------------------------\r
46  *        Headers\r
47  *----------------------------------------------------------------------------*/\r
48 \r
49 #include "chip.h"\r
50 \r
51 #include "board_lowlevel.h"\r
52 #include "board_memories.h"\r
53 \r
54 /*----------------------------------------------------------------------------\r
55  *        HW BOARD Definitions\r
56  *----------------------------------------------------------------------------*/\r
57 \r
58 /**\r
59  * \page sama5d2_vb_board_info "sama5d2-vb - Board informations"\r
60  * This page lists several definition related to the board description.\r
61  *\r
62  * \section Definitions\r
63  * - \ref BOARD_NAME\r
64  */\r
65 \r
66 /** Name of the board */\r
67 #define BOARD_NAME "sama5d2-vb-bga289"\r
68 \r
69 /*----------------------------------------------------------------------------*/\r
70 /**\r
71  *  \page sama5d2_xult_opfreq "sama5d2-XULT - Operating frequencies"\r
72  *  This page lists several definition related to the board operating frequency\r
73  *  (when using the initialization done by board_lowlevel.c).\r
74  */\r
75 \r
76 /** Frequency of the board slow clock oscillator */\r
77 #define BOARD_SLOW_CLOCK_EXT_OSC 32768\r
78 \r
79 /** Frequency of the board main clock oscillator */\r
80 #define BOARD_MAIN_CLOCK_EXT_OSC 12000000\r
81 \r
82 /** \def Board PIT tick resolution */\r
83 #define BOARD_TIMER_RESOLUTION   1000\r
84 \r
85 /* =================== PIN CONSOLE definition ================== */\r
86 \r
87 /** CONSOLE pin definition, Use only UART */\r
88 #define PINS_CONSOLE            PINS_UART0_IOS1\r
89 #define CONSOLE_PER_ADD         UART0\r
90 #define CONSOLE_ID              ID_UART0\r
91 #define CONSOLE_BAUDRATE        57600\r
92 #define CONSOLE_DRIVER          DRV_UART\r
93 \r
94 /* =================== PIN LED definition ====================== */\r
95 \r
96 /* RGB LED index */\r
97 #define LED_RED   0    /* led red shared with SDMMC0 (eMMC) card detect used only by RomBoot */\r
98 #define LED_GREEN 1\r
99 #define LED_BLUE  2\r
100 \r
101 /** LED #0 pin definition (Red). */\r
102 #define PIN_LED_0       { PIO_GROUP_D, PIO_PD21, PIO_OUTPUT_0, PIO_OPENDRAIN }\r
103 \r
104 /** LED #1 pin definition (Green). */\r
105 #define PIN_LED_1       { PIO_GROUP_D, PIO_PD22, PIO_OUTPUT_0, PIO_OPENDRAIN }\r
106 \r
107 /** List of all LEDs definitions. */\r
108 #define PINS_LEDS       { PIN_LED_0, PIN_LED_1 }\r
109 \r
110 /* =================== PIN PUSH BUTTON definition ============== */\r
111 \r
112 #define PIO_CFG_PB  (PIO_PULLUP | PIO_DEBOUNCE)\r
113 \r
114 #define PIN_PUSHBUTTON_1 { PIO_GROUP_D, PIO_PD23, PIO_INPUT, PIO_CFG_PB }\r
115 \r
116 #define PIN_PUSHBUTTON_2 { PIO_GROUP_D, PIO_PD24, PIO_INPUT, PIO_CFG_PB }\r
117 \r
118 /** List of all push button definitions. */\r
119 #define PINS_PUSHBUTTONS { PIN_PUSHBUTTON_1, PIN_PUSHBUTTON_2 }\r
120 \r
121 /** Push button index. */\r
122 #define PUSHBUTTON_BP1 0\r
123 #define PUSHBUTTON_BP2 1\r
124 \r
125 /* ================== PIN USB definition ======================= */\r
126 \r
127 /** USB VBus pin */\r
128 #define PIN_USB_VBUS      {\\r
129         { PIO_GROUP_C, PIO_PC29, PIO_INPUT, PIO_DEFAULT },\\r
130 }\r
131 /** USB OverCurrent detection*/\r
132 #define PIN_USB_OVCUR     {\\r
133         { PIO_GROUP_C, PIO_PC31, PIO_INPUT, PIO_DEFAULT },\\r
134 }\r
135 /** USB Power Enable A, Active high */\r
136 #define PIN_USB_POWER_ENA {\\r
137         { PIO_GROUP_C, PIO_PC30, PIO_OUTPUT_0, PIO_DEFAULT },\\r
138 }\r
139 /** USB Power Enable B, Active high  */\r
140 #define PIN_USB_POWER_ENB {\\r
141         { PIO_GROUP_D, PIO_PD0, PIO_OUTPUT_0, PIO_DEFAULT },\\r
142 }\r
143 \r
144 /* ================= PIN LCD IRQ definition ===================== */\r
145 \r
146 #define PIO_CFG_LCD_IRQ  (PIO_PULLUP | PIO_IT_FALL_EDGE)\r
147 \r
148 #define PIN_QT1070_IRQ {\\r
149         { PIO_GROUP_B, PIO_PB7, PIO_INPUT, PIO_CFG_LCD_IRQ },\\r
150 }\r
151 #define PIN_MXT336S_IRQ {\\r
152         { PIO_GROUP_B, PIO_PB8, PIO_INPUT, PIO_CFG_LCD_IRQ },\\r
153 }\r
154 #define PIN_MXT768E_IRQ {\\r
155         { PIO_GROUP_B, PIO_PB8, PIO_INPUT, PIO_CFG_LCD_IRQ },\\r
156 }\r
157 \r
158 /* =================== PIN ISC definition ======================= */\r
159 \r
160 #define PIN_ISC_RST     {\\r
161         { PIO_GROUP_B, PIO_PB11, PIO_OUTPUT_1, PIO_DEFAULT },\\r
162 }\r
163 #define PIN_ISC_PWD     {\\r
164         { PIO_GROUP_B, PIO_PB12, PIO_OUTPUT_1, PIO_DEFAULT  },\\r
165 }\r
166 \r
167 /* =================== PIN SDMMC definition ===================== */\r
168 \r
169 #define SDMMC0_PINS  { PINS_SDMMC0_8B_IOS1, PIN_SDMMC0_CK_IOS1,\\r
170                        PIN_SDMMC0_CD_IOS1, PIN_SDMMC0_VDDSEL_IOS1,\\r
171                        PIN_SDMMC0_RSTN_IOS1, PIN_SDMMC0_WP_IOS1 }\r
172 \r
173 #define SDMMC1_PINS  { PINS_SDMMC1_4B_IOS1, PIN_SDMMC1_CK_IOS1,\\r
174                        PIN_SDMMC1_CD_IOS1, PIN_SDMMC1_RSTN_IOS1,\\r
175                        PIN_SDMMC1_WP_IOS1 }\r
176 \r
177 /* =================== PIN CAN definition ======================= */\r
178 /* CAN0 {PC1; PC2} is wired to the J18 connector via an AT6561 transceiver. */\r
179 /* CAN1 {PC26; PC27} is wired to the J19 connector via an AT6561 transceiver. */\r
180 \r
181 #define CAN0_PINS          PINS_CAN0_IOS0\r
182 \r
183 #ifdef MCAN1\r
184 #define CAN1_PINS          PINS_CAN1_IOS0\r
185 #endif\r
186 \r
187 /* =================== NANDFLASH device definition =================== */\r
188 \r
189 #define BOARD_NANDFLASH_PINS      PINS_NFC_IOS1\r
190 #define BOARD_NANDFLASH_ADDR      EBI_CS3_ADDR\r
191 #define BOARD_NANDFLASH_CS        3\r
192 #define BOARD_NANDFLASH_BUS_WIDTH 8\r
193 \r
194 #endif /* #ifndef _BOARD_D2_H */\r