diff options
Diffstat (limited to 'lib/chibios/os/hal/boards/EA_LPCXPRESSO_BB_11U14/board.c')
-rw-r--r-- | lib/chibios/os/hal/boards/EA_LPCXPRESSO_BB_11U14/board.c | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/lib/chibios/os/hal/boards/EA_LPCXPRESSO_BB_11U14/board.c b/lib/chibios/os/hal/boards/EA_LPCXPRESSO_BB_11U14/board.c new file mode 100644 index 000000000..7527e53ac --- /dev/null +++ b/lib/chibios/os/hal/boards/EA_LPCXPRESSO_BB_11U14/board.c | |||
@@ -0,0 +1,65 @@ | |||
1 | /* | ||
2 | ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio | ||
3 | |||
4 | Licensed under the Apache License, Version 2.0 (the "License"); | ||
5 | you may not use this file except in compliance with the License. | ||
6 | You may obtain a copy of the License at | ||
7 | |||
8 | http://www.apache.org/licenses/LICENSE-2.0 | ||
9 | |||
10 | Unless required by applicable law or agreed to in writing, software | ||
11 | distributed under the License is distributed on an "AS IS" BASIS, | ||
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
13 | See the License for the specific language governing permissions and | ||
14 | limitations under the License. | ||
15 | */ | ||
16 | |||
17 | #include "hal.h" | ||
18 | |||
19 | /** | ||
20 | * @brief PAL setup. | ||
21 | * @details Digital I/O ports static configuration as defined in @p board.h. | ||
22 | * This variable is used by the HAL when initializing the PAL driver. | ||
23 | */ | ||
24 | #if HAL_USE_PAL || defined(__DOXYGEN__) | ||
25 | const PALConfig pal_default_config = { | ||
26 | {VAL_GPIO0DATA, VAL_GPIO0DIR}, | ||
27 | {VAL_GPIO1DATA, VAL_GPIO1DIR} | ||
28 | }; | ||
29 | #endif | ||
30 | |||
31 | /* | ||
32 | * Early initialization code. | ||
33 | * This initialization must be performed just after stack setup and before | ||
34 | * any other initialization. | ||
35 | */ | ||
36 | void __early_init(void) { | ||
37 | |||
38 | lpc_clock_init(); | ||
39 | } | ||
40 | |||
41 | /* | ||
42 | * Board-specific initialization code. | ||
43 | */ | ||
44 | void boardInit(void) { | ||
45 | |||
46 | /* | ||
47 | * Extra, board-specific, initializations. | ||
48 | * NOTE: PIO1_2 is associated also to the JTAG, if you need to use JTAG | ||
49 | * you must comment that line first. | ||
50 | */ | ||
51 | LPC_IOCON->PIO0_7 = 0x80; /* Disables pull-up on LED2 output. */ | ||
52 | LPC_IOCON->TRST_PIO0_14 = 0x81; /* Disables pull-up on LED3B output | ||
53 | and makes it GPIO1_2. */ | ||
54 | LPC_IOCON->PIO0_21 = 0x80; /* Disables pull-up on LED3R output.*/ | ||
55 | LPC_IOCON->PIO0_22 = 0x80; /* Disables pull-up on LED3G output.*/ | ||
56 | |||
57 | /* SSP0 mapping.*/ | ||
58 | LPC_IOCON->PIO1_29 = 0x81; /* SCK0 without resistors. */ | ||
59 | LPC_IOCON->PIO0_8 = 0x81; /* MISO0 without resistors. */ | ||
60 | LPC_IOCON->PIO0_9 = 0x81; /* MOSI0 without resistors. */ | ||
61 | |||
62 | /* USART mapping.*/ | ||
63 | LPC_IOCON->PIO0_18 = 0x81; /* RDX without resistors. */ | ||
64 | LPC_IOCON->PIO0_19 = 0x81; /* TDX without resistors. */ | ||
65 | } | ||