LPCOpen Platform for LPC18XX/43XX microcontrollers  18XX43XX
LPCOpen Platform for the NXP LPC18XX/43XX family of Microcontrollers
board.h
Go to the documentation of this file.
1 /*
2  * @brief Keil MCB 1857 board file
3  *
4  * @note
5  * Copyright(C) NXP Semiconductors, 2013
6  * All rights reserved.
7  *
8  * @par
9  * Software that is described herein is for illustrative purposes only
10  * which provides customers with programming information regarding the
11  * LPC products. This software is supplied "AS IS" without any warranties of
12  * any kind, and NXP Semiconductors and its licensor disclaim any and
13  * all warranties, express or implied, including all implied warranties of
14  * merchantability, fitness for a particular purpose and non-infringement of
15  * intellectual property rights. NXP Semiconductors assumes no responsibility
16  * or liability for the use of the software, conveys no license or rights under any
17  * patent, copyright, mask work right, or any other intellectual property rights in
18  * or to any products. NXP Semiconductors reserves the right to make changes
19  * in the software without notification. NXP Semiconductors also makes no
20  * representation or warranty that such application will be suitable for the
21  * specified use without further testing or modification.
22  *
23  * @par
24  * Permission to use, copy, modify, and distribute this software and its
25  * documentation is hereby granted, under NXP Semiconductors' and its
26  * licensor's relevant copyrights in the software, without fee, provided that it
27  * is used in conjunction with NXP Semiconductors microcontrollers. This
28  * copyright, permission, and disclaimer notice must appear in all copies of
29  * this code.
30  */
31 
32 #ifndef __BOARD_H_
33 #define __BOARD_H_
34 
35 #include "chip.h"
36 /* board_api.h is included at the bottom of this file after DEBUG setup */
37 
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41 
59 #define DEBUG_ENABLE
60 
65 //#define DEBUG_SEMIHOSTING
66 
70 #define DEBUG_UART LPC_USART3
71 
76 /* Board name */
77 #define BOARD_KEIL_MCB_1857
78 
79 
80 
81 
82 
83 
84 
85 
86 
87 
88 /* Build for RMII interface */
89 #define USE_RMII
90 #define BOARD_ENET_PHY_ADDR 0x01
91 
92 
93 #define BOARD_KEIL_MCB_1857
94 
95 #define LED_NUMBER_OF 1
96 
97 #define BUTTONS_BUTTON1_GPIO_PORT_NUM 2
98 #define BUTTONS_BUTTON1_GPIO_BIT_NUM 0
99 #define JOYSTICK_UP_GPIO_PORT_NUM 6
100 #define JOYSTICK_UP_GPIO_BIT_NUM 10
101 #define JOYSTICK_DOWN_GPIO_PORT_NUM 6
102 #define JOYSTICK_DOWN_GPIO_BIT_NUM 11
103 #define JOYSTICK_LEFT_GPIO_PORT_NUM 6
104 #define JOYSTICK_LEFT_GPIO_BIT_NUM 12
105 #define JOYSTICK_RIGHT_GPIO_PORT_NUM 6
106 #define JOYSTICK_RIGHT_GPIO_BIT_NUM 13
107 #define JOYSTICK_PRESS_GPIO_PORT_NUM 6
108 #define JOYSTICK_PRESS_GPIO_BIT_NUM 8
109 
110 #define JOY_UP 0x01
111 #define JOY_DOWN 0x02
112 #define JOY_LEFT 0x04
113 #define JOY_RIGHT 0x08
114 #define JOY_PRESS 0x10
115 #define NO_BUTTON_PRESSED 0x00
116 
117 #define BUTTONS_BUTTON1 0x01
118 
119 #define LEDS_LED1 0x01
120 #define LEDS_LED2 0x02
121 #define LEDS_LED3 0x04
122 #define LEDS_LED4 0x08
123 #define LEDS_NO_LEDS 0x00
124 
125 /* UDA1380 address */
126 #define I2CDEV_UDA1380_ADDR (0x34 >> 1)
127 #define UDA1380_I2C_BUS I2C0
128 
129 /* Frame buffer address for lcd */
130 #define FRAMEBUFFER_ADDR 0x28000000
131 
132 extern const LCD_CONFIG_T MCB4300_LCD;
133 #define BOARD_LCD MCB4300_LCD
134 
136 #define SSP_ID LPC_SSP0
137 #define C_GLCD_H_SIZE 240
138 #define C_GLCD_V_SIZE 320
139 
142 #define TSC_I2C_ADDR (0x82 >> 1) /* Touchscreen 7-bit I2C address */
143 #define TSC_I2C_BUS I2C0
144 
146 #define SYS_CTRL1 0x03
147 #define SYS_CTRL2 0x04
148 #define INT_CTRL 0x09
149 #define INT_EN 0x0A
150 #define INT_STA 0x0B
151 #define GPIO_ALT_FUNCT 0x17
152 #define ADC_CTRL1 0x20
153 #define ADC_CTRL2 0x21
154 #define TSC_CTRL 0x40
155 #define TSC_CFG 0x41
156 #define FIFO_TH 0x4A
157 #define FIFO_STA 0x4B
158 #define FIFO_SIZE 0x4C
159 #define DATA_X 0x4D
160 #define DATA_Y 0x4F
161 #define DATA_Z 0x51
162 #define TSC_FRACTION_Z 0x56
163 #define TSC_I_DRIVE 0x58
164 #define TSC_SHIELD 0x59
165 #define DATA_XYZ 0xD7
166 
171 void Board_ADC_Init(void);
172 
178 void Board_I2C_Init(I2C_ID_T id);
179 
190 {
192 }
193 
201 {
203 }
204 
209 void Board_GPIO_Int_Init(void);
210 
215 void Board_SDMMC_Init(void);
216 
222 void Board_SSP_Init(LPC_SSP_T *pSSP);
223 
229 void Board_ENET_GetMacADDR(uint8_t *mcaddr);
230 
236 void Board_UART_Init(LPC_USART_T *pUART);
237 
242 void Board_LCD_Init(void);
243 
248 void Board_InitLCDController(void);
249 
254 void Board_InitTouchController(void);
255 
265 bool Board_GetTouchPos(int16_t *pX, int16_t *pY);
266 
276 bool Board_I2C_GetTouchPos(int16_t *pX, int16_t *pY);
277 
282 void Board_SetLCDBacklight(uint8_t Intensity);
283 
288 void Board_Buttons_Init (void);
289 
294 void Board_Joystick_Init (void);
295 
300 uint8_t Joystick_GetStatus (void);
301 
306 uint32_t Buttons_GetStatus(void);
307 
314 void Board_Audio_Init(LPC_I2S_T *pI2S, int micIn);
315 
321 void Board_DAC_Init(LPC_DAC_T *pDAC);
322 
327 #include "board_api.h"
328 #include "lpc_phy.h"
329 #include "uda1380.h"
330 
331 #ifdef __cplusplus
332 }
333 #endif
334 
335 #endif /* __BOARD_H_ */