]> git.sur5r.net Git - freertos/blob - FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/LPCOpen/lpc_core/lpc_board/boards_18xx_43xx/ngx_xplorer_18304330/board_ngx_xplorer_18304330.h
Update LPC18xx FreeRTOS+UDP demo to use LPCOpen USB and Ethernet drivers.
[freertos] / FreeRTOS-Plus / Demo / FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC / ThirdParty / LPCOpen / lpc_core / lpc_board / boards_18xx_43xx / ngx_xplorer_18304330 / board_ngx_xplorer_18304330.h
1 /*\r
2  * @brief NGX Xplorer 1830/4330 board file\r
3  *\r
4  * @note\r
5  * Copyright(C) NXP Semiconductors, 2012\r
6  * All rights reserved.\r
7  *\r
8  * @par\r
9  * Software that is described herein is for illustrative purposes only\r
10  * which provides customers with programming information regarding the\r
11  * LPC products.  This software is supplied "AS IS" without any warranties of\r
12  * any kind, and NXP Semiconductors and its licensor disclaim any and\r
13  * all warranties, express or implied, including all implied warranties of\r
14  * merchantability, fitness for a particular purpose and non-infringement of\r
15  * intellectual property rights.  NXP Semiconductors assumes no responsibility\r
16  * or liability for the use of the software, conveys no license or rights under any\r
17  * patent, copyright, mask work right, or any other intellectual property rights in\r
18  * or to any products. NXP Semiconductors reserves the right to make changes\r
19  * in the software without notification. NXP Semiconductors also makes no\r
20  * representation or warranty that such application will be suitable for the\r
21  * specified use without further testing or modification.\r
22  *\r
23  * @par\r
24  * Permission to use, copy, modify, and distribute this software and its\r
25  * documentation is hereby granted, under NXP Semiconductors' and its\r
26  * licensor's relevant copyrights in the software, without fee, provided that it\r
27  * is used in conjunction with NXP Semiconductors microcontrollers.  This\r
28  * copyright, permission, and disclaimer notice must appear in all copies of\r
29  * this code.\r
30  */\r
31 \r
32 #ifndef __BOARD_NGX_XPLORER_18304330_H_\r
33 #define __BOARD_NGX_XPLORER_18304330_H_\r
34 \r
35 #include "chip.h"\r
36 #include "board_api.h"\r
37 #include "lpc_phy.h"\r
38 #include "uda1380.h"\r
39 \r
40 #ifdef __cplusplus\r
41 extern "C" {\r
42 #endif\r
43 \r
44 /** @defgroup BOARD_NGX_XPLORER_18304330 LPC1830 and LPC4330 NGX Xplorer board support functions\r
45  * @ingroup BOARDS_18XX_43XX\r
46  * @{\r
47  */\r
48 \r
49 /** @defgroup BOARD_NGX_XPLORER_1830_OPTIONS BOARD: LPC1830 NGX Xplorer board builds options\r
50  * This board has options that configure its operation at build-time.<br>\r
51  *\r
52  * For more information on driver options see<br>\r
53  * @ref LPCOPEN_DESIGN_ARPPROACH<br>\r
54  * @{\r
55  */\r
56 \r
57 /**\r
58  * @}\r
59  */\r
60 \r
61 /** @defgroup BOARD_NGX_XPLORER_4330_OPTIONS BOARD: LPC4330 NGX Xplorer board builds options\r
62  * This board has options that configure its operation at build-time.<br>\r
63  *\r
64  * For more information on driver options see<br>\r
65  * @ref LPCOPEN_DESIGN_ARPPROACH<br>\r
66  * @{\r
67  */\r
68 \r
69 /**\r
70  * @}\r
71  */\r
72 \r
73 #define BOARD_NGX_XPLORER_18304330\r
74 \r
75 #define I2CDEV_UDA1380_ADDR     (0x34 >> 1)\r
76 #define UDA1380_I2C_BUS          I2C0\r
77 \r
78 /* For USBLIB examples */\r
79 #define LEDS_LED1           0x01\r
80 #define LEDS_LED2           0x02\r
81 #define LEDS_LED3           0x04\r
82 #define LEDS_LED4           0x08\r
83 #define LEDS_NO_LEDS        0x00\r
84 #define BUTTONS_BUTTON1     0x01\r
85 #define JOY_UP              0x01\r
86 #define JOY_DOWN            0x02\r
87 #define JOY_LEFT            0x04\r
88 #define JOY_RIGHT           0x08\r
89 #define JOY_PRESS           0x10\r
90 #define NO_BUTTON_PRESSED   0x00\r
91 \r
92 /*Define if use SDCARD for Mass Storage Example*/\r
93 //#define CFG_SDCARD\r
94 \r
95 #define BUTTONS_BUTTON1_GPIO_PORT_NUM   0\r
96 #define BUTTONS_BUTTON1_GPIO_BIT_NUM    7\r
97 #define LED1_GPIO_PORT_NUM              1\r
98 #define LED1_GPIO_BIT_NUM               11\r
99 #define LED2_GPIO_PORT_NUM              1\r
100 #define LED2_GPIO_BIT_NUM               12\r
101 \r
102 /**\r
103  * @brief       Sets up board specific I2C interface\r
104  * @param       id      : I2C Peripheral ID (I2C0, I2C1)\r
105  * @return      Nothing\r
106  */\r
107 void Board_I2C_Init(I2C_ID_T id);\r
108 \r
109 /**\r
110  * @brief       Sets up I2C Fast Plus mode\r
111  * @param       id      : Must always be I2C0\r
112  * @return      Nothing\r
113  * @note        This function must be called before calling\r
114  *              Chip_I2C_SetClockRate() to set clock rates above\r
115  *              normal range 100KHz to 400KHz. Only I2C0 supports\r
116  *              this mode.\r
117  */\r
118 STATIC INLINE void Board_I2C_EnableFastPlus(I2C_ID_T id)\r
119 {\r
120         Chip_SCU_I2C0PinConfig(I2C0_FAST_MODE_PLUS);\r
121 }\r
122 \r
123 /**\r
124  * @brief       Disable I2C Fast Plus mode and enables default mode\r
125  * @param       id      : Must always be I2C0\r
126  * @return      Nothing\r
127  * @sa          Board_I2C_EnableFastPlus()\r
128  */\r
129 STATIC INLINE void Board_I2C_DisableFastPlus(I2C_ID_T id)\r
130 {\r
131         Chip_SCU_I2C0PinConfig(I2C0_STANDARD_FAST_MODE);\r
132 }\r
133 \r
134 /**\r
135  * @brief       Initializes board specific GPIO Interrupt\r
136  * @return      Nothing\r
137  */\r
138 void Board_GPIO_Int_Init(void);\r
139 \r
140 /**\r
141  * @brief       Initialize pin muxing for SSP interface\r
142  * @param       pSSP    : Pointer to SSP interface to initialize\r
143  * @return      Nothing\r
144  */\r
145 void Board_SSP_Init(LPC_SSP_T *pSSP);\r
146 \r
147 /**\r
148  * @brief       Returns the MAC address assigned to this board\r
149  * @param       mcaddr : Pointer to 6-byte character array to populate with MAC address\r
150  * @return      Nothing\r
151  */\r
152 void Board_ENET_GetMacADDR(uint8_t *mcaddr);\r
153 \r
154 /**\r
155  * @brief       Initialize pin muxing for a UART\r
156  * @param       pUART   : Pointer to UART register block for UART pins to init\r
157  * @return      Nothing\r
158  */\r
159 void Board_UART_Init(LPC_USART_T *pUART);\r
160 \r
161 /**\r
162  * @brief       Initialize pin muxing for SDMMC interface\r
163  * @return      Nothing\r
164  */\r
165 void Board_SDMMC_Init(void);\r
166 \r
167 /**\r
168  * @brief       Initialize button(s) interface on board\r
169  * @return      Nothing\r
170  */\r
171 void Board_Buttons_Init(void);\r
172 \r
173 /**\r
174  * @brief       Initialize joystick interface on board\r
175  * @return      Nothing\r
176  */\r
177 void Board_Joystick_Init(void);\r
178 \r
179 /**\r
180  * @brief       Returns joystick states on board\r
181  * @return      Returns a JOY_* value, ir JOY_PRESS or JOY_UP\r
182  */\r
183 uint8_t Joystick_GetStatus(void);\r
184 \r
185 /**\r
186  * @brief       Returns button(s) state on board\r
187  * @return      Returns BUTTONS_BUTTON1 if button1 is pressed\r
188  */\r
189 uint32_t Buttons_GetStatus (void);\r
190 \r
191 /**\r
192  * @brief       Initialize I2S interface for the board and UDA1380\r
193  * @param       pI2S    : Pointer to I2S register interface used on this board\r
194  * @param       micIn   : If 1 MIC will be used as input, if 0 LINE_IN will be used\r
195  * @return      Nothing\r
196  */\r
197 void Board_Audio_Init(LPC_I2S_T *pI2S, int micIn);\r
198 \r
199 /**\r
200  * @brief       FIXME\r
201  * @param       Stream  : FIXME\r
202  * @return      Nothing\r
203  */\r
204 void Serial_CreateStream(void *Stream);\r
205 \r
206 /**\r
207  * @}\r
208  */\r
209 \r
210 #ifdef __cplusplus\r
211 }\r
212 #endif\r
213 \r
214 #endif /* __BOARD_NGX_XPLORER_18304330_H_ */\r