| 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_ea_devkit_17884088.h
Go to the documentation of this file.
1 /*
2 * @brief Embedded Artists LPC1788 Development Kit 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_EA_DEVKIT_17884088H_
33 #define __BOARD_EA_DEVKIT_17884088H_
34
35 #include "chip.h"
36 #include "board_api.h"
37 #include "lpc_phy.h"
38 #include "lpc_norflash.h"
39 #include "lpc_nandflash.h"
40 #include "lpc_nandflash_k9f1g.h"
41 #include "uda1380.h"
42
43 #ifdef __cplusplus
44 extern "C" {
45 #endif
46
76 #define BOARD_EA_DEVKIT_17884088
78 #define FRAMEBUFFER_ADDR EMC_ADDRESS_DYCS0
80 #define I2CDEV_UDA1380_ADDR 0x1A
81 #define UDA1380_I2C_BUS I2C0
86 #define LEDS_LED1 0x01
87 #define LEDS_LED2 0x02
88 #define LEDS_LED3 0x04
89 #define LEDS_LED4 0x08
90 #define LEDS_NO_LEDS 0x00
91
95 #define BUTTONS_BUTTON1 0x01
96 #define NO_BUTTON_PRESSED 0x00
97
101 #define JOY_UP 0x01
102 #define JOY_DOWN 0x02
103 #define JOY_LEFT 0x04
104 #define JOY_RIGHT 0x08
105 #define JOY_PRESS 0x10
106
110 extern const LCD_Config_T EA320x240;
111
115 #define BOARD_LCD EA320x240
116
123 void Board_ENET_GetMacADDR(uint8_t *mcaddr);
124
130 void Board_UART_Init(LPC_USART_T *pUART);
131
139 void Board_Audio_Init(LPC_I2S_T *pI2S, int micIn);
140
146 void Board_SSP_Init(LPC_SSP_T *pSSP);
147
153 void Board_I2C_Init(I2C_ID_T id);
154
169 STATIC INLINE void Board_I2C_EnableFastPlus(I2C_ID_T id)
170 {
171 /* Free P0[27] & P0[28] as SDA0 and SCL0 respectively*/
172 Chip_IOCON_PinMuxSet(LPC_IOCON, 0, 27, IOCON_FUNC0);
173 Chip_IOCON_PinMuxSet(LPC_IOCON, 0, 28, IOCON_FUNC0);
174
175 /* Use P5[2] & P5[3] as SDA0 and SCL0 respectively */
176 Chip_IOCON_PinMuxSet(LPC_IOCON, 5, 2, IOCON_FUNC5 | IOCON_HIDRIVE_EN);
177 Chip_IOCON_PinMuxSet(LPC_IOCON, 5, 3, IOCON_FUNC5 | IOCON_HIDRIVE_EN);
178 }
179
186 STATIC INLINE void Board_I2C_DisableFastPlus(I2C_ID_T id)
187 {
188 /* Free P5[2] & P5[3] as SDA0 and SCL0 respectively */
189 Chip_IOCON_PinMuxSet(LPC_IOCON, 5, 2, IOCON_FUNC0);
190 Chip_IOCON_PinMuxSet(LPC_IOCON, 5, 3, IOCON_FUNC0);
191
192 /* Use P0[27] & P0[28] as SDA0 and SCL0 respectively*/
193 Chip_IOCON_PinMuxSet(LPC_IOCON, 0, 27, IOCON_FUNC1);
194 Chip_IOCON_PinMuxSet(LPC_IOCON, 0, 28, IOCON_FUNC1);
195 }
196
202 void Board_CAN_Init(LPC_CAN_T *pCAN);
203
208 void Board_LCD_Init(void);
209
214 void Board_InitLCDController(void);
215
220 void Board_InitTouchController(void);
221
228 bool Board_GetTouchPos(int16_t *pX, int16_t *pY);
229
235 void Board_SetLCDBacklight(uint8_t Intensity);
236
241 void Board_Buttons_Init(void);
242
247 uint32_t Buttons_GetStatus(void);
248
253 void Board_Joystick_Init(void);
254
259 uint8_t Joystick_GetStatus(void);
260
265 void Board_RTC_EV_Init(void);
266
272 void Serial_CreateStream(void *Stream);
273
278 void Board_SDC_Init(void);
279
280 #if defined(CHIP_LPC407X_8X)
281
285 void Board_CMP_Init(void);
286
291 void Board_SPIFI_Init(void);
292
293 #endif
294
301 STATIC INLINE void Board_NorFlash_WriteCmd(uint32_t addr, uint16_t data)
302 {
303 *((volatile uint16_t *) (EMC_ADDRESS_CS0 | (addr << 1))) = data;
304 }
305
311 STATIC INLINE uint16_t Board_NorFlash_ReadCmdData(uint32_t addr)
312 {
313 return *((volatile uint16_t *) (EMC_ADDRESS_CS0 | (addr << 1)));
314 }
315
322 STATIC INLINE void Board_NorFlash_WriteWord(uint32_t addr, uint16_t data)
323 {
324 *((volatile uint16_t *) (EMC_ADDRESS_CS0 | addr)) = data;
325 }
326
332 STATIC INLINE uint16_t Board_NorFlash_ReadWord(uint32_t addr)
333 {
334 return *((volatile uint16_t *) (EMC_ADDRESS_CS0 | addr));
335 }
336
337 #if defined(NAND_SUPPORTED_LOCKEDCS)
338
343 STATIC INLINE void Board_NANDFLash_CSLatch(bool activeCS)
344 {
345 /* NAND FLASH active GPIO/CS state is low */
346 Chip_GPIO_WritePortBit(LPC_GPIO, 4, 31, !activeCS);
347 }
348
349 #endif
350
351 #define NANDFLASH_READY_PORT 2
352 #define NANDFLASH_READY_PIN 21
353
358 void Board_NANDFLash_Init(void);
359
365 STATIC INLINE bool Board_NANDFLash_GetReady(void)
366 {
367 return (Chip_GPIO_ReadPortBit(LPC_GPIO, NANDFLASH_READY_PORT, NANDFLASH_READY_PIN)) ? true : false;
368 }
369
375 STATIC INLINE void Board_NANDFLash_WriteCmd(uint8_t cmd)
376 {
377 *((volatile uint8_t *) (EMC_ADDRESS_CS1 | (1 << 20))) = cmd;
378 }
379
385 STATIC INLINE void Board_NANDFLash_WriteAddr(uint8_t addr)
386 {
387 *((volatile uint8_t *) (EMC_ADDRESS_CS1 | (1 << 19))) = addr;
388 }
389
395 STATIC INLINE void Board_NANDFLash_WriteByte(uint8_t data)
396 {
397 *((volatile uint8_t *) (EMC_ADDRESS_CS1)) = data;
398 }
399
404 STATIC INLINE uint8_t Board_NANDFLash_ReadByte(void)
405 {
406 return *((volatile uint8_t *) (EMC_ADDRESS_CS1));
407 }
408
413 #ifdef __cplusplus
414 }
415 #endif
416
417 #endif /* __BOARD_EA_DEVKIT_17884088H_ */