diff options
Diffstat (limited to 'lib/chibios/os/hal/boards/ST_EVB_SPC56EL/board.c')
-rw-r--r-- | lib/chibios/os/hal/boards/ST_EVB_SPC56EL/board.c | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/lib/chibios/os/hal/boards/ST_EVB_SPC56EL/board.c b/lib/chibios/os/hal/boards/ST_EVB_SPC56EL/board.c new file mode 100644 index 000000000..cc7015a12 --- /dev/null +++ b/lib/chibios/os/hal/boards/ST_EVB_SPC56EL/board.c | |||
@@ -0,0 +1,70 @@ | |||
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 | #if HAL_USE_PAL || defined(__DOXYGEN__) | ||
20 | /* Initial setup of all defined pads, the list is terminated by a {-1, 0, 0}.*/ | ||
21 | static const spc_siu_init_t spc_siu_init[] = { | ||
22 | {PCR(PORT_B, PB_LIN0_TDX), PAL_HIGH, PAL_MODE_OUTPUT_ALTERNATE(1)}, | ||
23 | {PCR(PORT_B, PB_LIN0_RDX), PAL_HIGH, PAL_MODE_INPUT}, | ||
24 | {PCR(PORT_D, PD_BUTTON1), PAL_LOW, PAL_MODE_INPUT}, | ||
25 | {PCR(PORT_D, PD_BUTTON2), PAL_LOW, PAL_MODE_INPUT}, | ||
26 | {PCR(PORT_D, PD_BUTTON3), PAL_LOW, PAL_MODE_INPUT}, | ||
27 | {PCR(PORT_D, PD_BUTTON4), PAL_LOW, PAL_MODE_INPUT}, | ||
28 | {PCR(PORT_D, PD_LED1), PAL_HIGH, PAL_MODE_OUTPUT_PUSHPULL}, | ||
29 | {PCR(PORT_D, PD_LED2), PAL_HIGH, PAL_MODE_OUTPUT_PUSHPULL}, | ||
30 | {PCR(PORT_D, PD_LED3), PAL_HIGH, PAL_MODE_OUTPUT_PUSHPULL}, | ||
31 | {PCR(PORT_D, PD_LED4), PAL_HIGH, PAL_MODE_OUTPUT_PUSHPULL}, | ||
32 | {-1, 0, 0} | ||
33 | }; | ||
34 | |||
35 | /* Initialization array for the PSMI registers.*/ | ||
36 | static const uint8_t spc_padsels_init[SPC5_SIUL_NUM_PADSELS] = { | ||
37 | 0, 0, 0, 0, 0, 0, 0, 0, | ||
38 | 0, 0, 0, 0, 0, 0, 0, 0, | ||
39 | 0, 0, 0, 0, 0, 0, 0, 0, | ||
40 | 0, 0, 0, 0, 0, 0, 0, 0, | ||
41 | 0, 0, 0, 0, 0, 0, 0, 0, | ||
42 | 0, 0, 0, 0, | ||
43 | }; | ||
44 | |||
45 | /** | ||
46 | * @brief PAL setup. | ||
47 | */ | ||
48 | const PALConfig pal_default_config = | ||
49 | { | ||
50 | PAL_MODE_UNCONNECTED, | ||
51 | spc_siu_init, | ||
52 | spc_padsels_init | ||
53 | }; | ||
54 | #endif | ||
55 | |||
56 | /* | ||
57 | * Early initialization code. | ||
58 | * This initialization must be performed just after stack setup and before | ||
59 | * any other initialization. | ||
60 | */ | ||
61 | void __early_init(void) { | ||
62 | |||
63 | spc_clock_init(); | ||
64 | } | ||
65 | |||
66 | /* | ||
67 | * Board-specific initialization code. | ||
68 | */ | ||
69 | void boardInit(void) { | ||
70 | } | ||