| LPCOpen Platform v1.03 LPCOpen Platform for NXP LPC Microcontrollers

- Main Page
- Modules
- Data Structures
- Files
- Related Pages

- File List
- Globals

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
board_keil_mcb_18574357.h
Go to the documentation of this file.
1 /*
2 * @brief Keil MCB 1857/4357 board file
3 *
4 * @note
5 * Copyright(C) NXP Semiconductors, 2012
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_KEIL_MCB_18574357_H_
33 #define __BOARD_KEIL_MCB_18574357_H_
34
35 #include "chip.h"
36 #include "board_api.h"
37 #include "lpc_phy.h"
38 #include "uda1380.h"
39
40 #ifdef __cplusplus
41 extern "C" {
42 #endif
43
73 #define BOARD_KEIL_MCB_18574357
74
75 #define LED_NUMBER_OF 1
76
77 #define BUTTONS_BUTTON1_GPIO_PORT_NUM 2
78 #define BUTTONS_BUTTON1_GPIO_BIT_NUM 0
79 #define JOYSTICK_UP_GPIO_PORT_NUM 6
80 #define JOYSTICK_UP_GPIO_BIT_NUM 10
81 #define JOYSTICK_DOWN_GPIO_PORT_NUM 6
82 #define JOYSTICK_DOWN_GPIO_BIT_NUM 11
83 #define JOYSTICK_LEFT_GPIO_PORT_NUM 6
84 #define JOYSTICK_LEFT_GPIO_BIT_NUM 12
85 #define JOYSTICK_RIGHT_GPIO_PORT_NUM 6
86 #define JOYSTICK_RIGHT_GPIO_BIT_NUM 13
87 #define JOYSTICK_PRESS_GPIO_PORT_NUM 6
88 #define JOYSTICK_PRESS_GPIO_BIT_NUM 8
89
90 #define JOY_UP 0x01
91 #define JOY_DOWN 0x02
92 #define JOY_LEFT 0x04
93 #define JOY_RIGHT 0x08
94 #define JOY_PRESS 0x10
95 #define NO_BUTTON_PRESSED 0x00
96
97 #define BUTTONS_BUTTON1 0x01
98
99 #define LEDS_LED1 0x01
100 #define LEDS_LED2 0x02
101 #define LEDS_LED3 0x04
102 #define LEDS_LED4 0x08
103 #define LEDS_NO_LEDS 0x00
104
105 /* UDA1380 address */
106 #define I2CDEV_UDA1380_ADDR (0x34 >> 1)
107 #define UDA1380_I2C_BUS I2C0
108
109 /* Frame buffer address for lcd */
110 #define FRAMEBUFFER_ADDR 0x28000000
111
112 extern const LCD_Config_T MCB4300_LCD;
113 #define BOARD_LCD MCB4300_LCD
114
116 #define SSP_ID LPC_SSP0
117 #define C_GLCD_H_SIZE 240
118 #define C_GLCD_V_SIZE 320
119
122 #define TSC_I2C_ADDR (0x82 >> 1) /* Touchscreen 7-bit I2C address */
123 #define TSC_I2C_BUS I2C0
124
126 #define SYS_CTRL1 0x03
127 #define SYS_CTRL2 0x04
128 #define INT_CTRL 0x09
129 #define INT_EN 0x0A
130 #define INT_STA 0x0B
131 #define GPIO_ALT_FUNCT 0x17
132 #define ADC_CTRL1 0x20
133 #define ADC_CTRL2 0x21
134 #define TSC_CTRL 0x40
135 #define TSC_CFG 0x41
136 #define FIFO_TH 0x4A
137 #define FIFO_STA 0x4B
138 #define FIFO_SIZE 0x4C
139 #define DATA_X 0x4D
140 #define DATA_Y 0x4F
141 #define DATA_Z 0x51
142 #define TSC_FRACTION_Z 0x56
143 #define TSC_I_DRIVE 0x58
144 #define TSC_SHIELD 0x59
145 #define DATA_XYZ 0xD7
146
151 void Board_ADC_Init(void);
152
158 void Board_I2C_Init(I2C_ID_T id);
159
169 STATIC INLINE void Board_I2C_EnableFastPlus(I2C_ID_T id)
170 {
171 Chip_SCU_I2C0PinConfig(I2C0_FAST_MODE_PLUS);
172 }
173
180 STATIC INLINE void Board_I2C_DisableFastPlus(I2C_ID_T id)
181 {
182 Chip_SCU_I2C0PinConfig(I2C0_STANDARD_FAST_MODE);
183 }
184
189 void Board_GPIO_Int_Init(void);
190
195 void Board_SDMMC_Init(void);
196
202 void Board_SSP_Init(LPC_SSP_T *pSSP);
203
209 void Board_ENET_GetMacADDR(uint8_t *mcaddr);
210
216 void Board_UART_Init(LPC_USART_T *pUART);
217
222 void Board_LCD_Init(void);
223
228 void Board_InitLCDController(void);
229
234 void Board_InitTouchController(void);
235
245 bool Board_GetTouchPos(int16_t *pX, int16_t *pY);
246
256 bool Board_I2C_GetTouchPos(int16_t *pX, int16_t *pY);
257
262 void Board_SetLCDBacklight(uint8_t Intensity);
263
268 void Board_Buttons_Init (void);
269
274 void Board_Joystick_Init (void);
275
280 uint8_t Joystick_GetStatus (void);
281
286 uint32_t Buttons_GetStatus(void);
287
294 void Board_Audio_Init(LPC_I2S_T *pI2S, int micIn);
295
301 void Board_DAC_Init(LPC_DAC_T *pDAC);
302
303 //FIXME Should we remove this function?
304 void Serial_CreateStream(void *Stream);
305
310 #ifdef __cplusplus
311 }
312 #endif
313
314 #endif /* __BOARD_KEIL_MCB_18574357_H_ */