LPCOpen Platform for LPC18XX/43XX microcontrollers
18XX43XX
LPCOpen Platform for the NXP LPC18XX/43XX family of Microcontrollers
Main Page
Modules
Data Structures
Files
File List
Globals
software
lpc_core
lpc_board
boards_43xx
keil_mcb_4357
board.h
Go to the documentation of this file.
1
/*
2
* @brief Keil MCB 4357 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_4357
78
79
/* Build for RMII interface */
80
#define USE_RMII
81
#define BOARD_ENET_PHY_ADDR 0x01
82
83
#define LED_NUMBER_OF 1
84
85
#define BUTTONS_BUTTON1_GPIO_PORT_NUM 2
86
#define BUTTONS_BUTTON1_GPIO_BIT_NUM 0
87
#define JOYSTICK_UP_GPIO_PORT_NUM 6
88
#define JOYSTICK_UP_GPIO_BIT_NUM 10
89
#define JOYSTICK_DOWN_GPIO_PORT_NUM 6
90
#define JOYSTICK_DOWN_GPIO_BIT_NUM 11
91
#define JOYSTICK_LEFT_GPIO_PORT_NUM 6
92
#define JOYSTICK_LEFT_GPIO_BIT_NUM 12
93
#define JOYSTICK_RIGHT_GPIO_PORT_NUM 6
94
#define JOYSTICK_RIGHT_GPIO_BIT_NUM 13
95
#define JOYSTICK_PRESS_GPIO_PORT_NUM 6
96
#define JOYSTICK_PRESS_GPIO_BIT_NUM 8
97
98
#define JOY_UP 0x01
99
#define JOY_DOWN 0x02
100
#define JOY_LEFT 0x04
101
#define JOY_RIGHT 0x08
102
#define JOY_PRESS 0x10
103
#define NO_BUTTON_PRESSED 0x00
104
105
#define BUTTONS_BUTTON1 0x01
106
107
#define LEDS_LED1 0x01
108
#define LEDS_LED2 0x02
109
#define LEDS_LED3 0x04
110
#define LEDS_LED4 0x08
111
#define LEDS_NO_LEDS 0x00
112
113
/* UDA1380 address */
114
#define I2CDEV_UDA1380_ADDR (0x34 >> 1)
115
#define UDA1380_I2C_BUS I2C0
116
117
/* Frame buffer address for lcd */
118
#define FRAMEBUFFER_ADDR 0x28000000
119
120
extern
const
LCD_CONFIG_T
MCB4300_LCD
;
121
#define BOARD_LCD MCB4300_LCD
122
124
#define SSP_ID LPC_SSP0
125
#define C_GLCD_H_SIZE 240
126
#define C_GLCD_V_SIZE 320
127
130
#define TSC_I2C_ADDR (0x82 >> 1)
/* Touchscreen 7-bit I2C address */
131
#define TSC_I2C_BUS I2C0
132
134
#define SYS_CTRL1 0x03
135
#define SYS_CTRL2 0x04
136
#define INT_CTRL 0x09
137
#define INT_EN 0x0A
138
#define INT_STA 0x0B
139
#define GPIO_ALT_FUNCT 0x17
140
#define ADC_CTRL1 0x20
141
#define ADC_CTRL2 0x21
142
#define TSC_CTRL 0x40
143
#define TSC_CFG 0x41
144
#define FIFO_TH 0x4A
145
#define FIFO_STA 0x4B
146
#define FIFO_SIZE 0x4C
147
#define DATA_X 0x4D
148
#define DATA_Y 0x4F
149
#define DATA_Z 0x51
150
#define TSC_FRACTION_Z 0x56
151
#define TSC_I_DRIVE 0x58
152
#define TSC_SHIELD 0x59
153
#define DATA_XYZ 0xD7
154
159
void
Board_ADC_Init
(
void
);
160
166
void
Board_I2C_Init
(
I2C_ID_T
id
);
167
177
STATIC
INLINE
void
Board_I2C_EnableFastPlus
(
I2C_ID_T
id
)
178
{
179
Chip_SCU_I2C0PinConfig
(
I2C0_FAST_MODE_PLUS
);
180
}
181
188
STATIC
INLINE
void
Board_I2C_DisableFastPlus
(
I2C_ID_T
id
)
189
{
190
Chip_SCU_I2C0PinConfig
(
I2C0_STANDARD_FAST_MODE
);
191
}
192
197
void
Board_GPIO_Int_Init
(
void
);
198
203
void
Board_SDMMC_Init
(
void
);
204
210
void
Board_SSP_Init
(
LPC_SSP_T
*pSSP);
211
217
void
Board_ENET_GetMacADDR
(uint8_t *mcaddr);
218
224
void
Board_UART_Init
(
LPC_USART_T
*pUART);
225
230
void
Board_LCD_Init
(
void
);
231
236
void
Board_InitLCDController
(
void
);
237
242
void
Board_InitTouchController
(
void
);
243
253
bool
Board_GetTouchPos
(int16_t *pX, int16_t *pY);
254
264
bool
Board_I2C_GetTouchPos
(int16_t *pX, int16_t *pY);
265
270
void
Board_SetLCDBacklight
(uint8_t Intensity);
271
276
void
Board_Buttons_Init
(
void
);
277
282
void
Board_Joystick_Init
(
void
);
283
288
uint8_t
Joystick_GetStatus
(
void
);
289
294
uint32_t
Buttons_GetStatus
(
void
);
295
302
void
Board_Audio_Init
(
LPC_I2S_T
*pI2S,
int
micIn);
303
308
#include "
board_api.h
"
309
#include "
lpc_phy.h
"
310
#include "
uda1380.h
"
311
312
#ifdef __cplusplus
313
}
314
#endif
315
316
#endif
/* __BOARD_H_ */
Generated on Fri Feb 20 2015 21:29:41 for LPCOpen Platform for LPC18XX/43XX microcontrollers by
1.8.3.1