LPCOpen Platform for LPC112X microcontrollers  112X
LPCOpen Platform for the NXP LPC112X family of Microcontrollers
board_api.h
Go to the documentation of this file.
1 /*
2  * @brief Common board API functions
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_API_H_
33 #define __BOARD_API_H_
34 
35 #include "lpc_types.h"
36 #include <stdio.h>
37 
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41 
58 void Board_SystemInit(void);
59 
66 void Board_SetupMuxing(void);
67 
73 void Board_SetupClocking(void);
74 
82 void Board_SetupExtMemory(void);
83 
88 void Board_Init(void);
89 
94 void Board_Debug_Init(void);
95 
101 void Board_UARTPutChar(char ch);
102 
107 int Board_UARTGetChar(void);
108 
114 void Board_UARTPutSTR(const char *str);
115 
122 void Board_LED_Set(uint8_t LEDNumber, bool State);
123 
129 bool Board_LED_Test(uint8_t LEDNumber);
130 
136 void Board_LED_Toggle(uint8_t LEDNumber);
137 
147 void Board_SetLCDBacklight(uint8_t Intensity);
148 
153 typedef void (*p_msDelay_func_t)(uint32_t);
154 
155 /* The DEBUG* functions are selected based on system configuration.
156  Code that uses the DEBUG* functions will have their I/O routed to
157  the UART, semihosting, or nowhere. */
158 #if defined(DEBUG_ENABLE)
159 #if defined(DEBUG_SEMIHOSTING)
160 #define DEBUGINIT()
161 #define DEBUGOUT(...) printf(__VA_ARGS__)
162 #define DEBUGSTR(str) printf(str)
163 #define DEBUGIN() (int) EOF
164 
165 #else
166 #define DEBUGINIT() Board_Debug_Init()
167 #define DEBUGOUT(...) printf(__VA_ARGS__)
168 #define DEBUGSTR(str) Board_UARTPutSTR(str)
169 #define DEBUGIN() Board_UARTGetChar()
170 #endif /* defined(DEBUG_SEMIHOSTING) */
171 
172 #else
173 #define DEBUGINIT()
174 #define DEBUGOUT(...)
175 #define DEBUGSTR(str)
176 #define DEBUGIN() (int) EOF
177 #endif /* defined(DEBUG_ENABLE) */
178 
183 #ifdef __cplusplus
184 }
185 #endif
186 
187 #endif /* __BOARD_API_H_ */