diff options
Diffstat (limited to 'lib/chibios/os/hal/boards/ST_EVB_SPC564A/board.c')
-rw-r--r-- | lib/chibios/os/hal/boards/ST_EVB_SPC564A/board.c | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/lib/chibios/os/hal/boards/ST_EVB_SPC564A/board.c b/lib/chibios/os/hal/boards/ST_EVB_SPC564A/board.c new file mode 100644 index 000000000..77d16abaa --- /dev/null +++ b/lib/chibios/os/hal/boards/ST_EVB_SPC564A/board.c | |||
@@ -0,0 +1,58 @@ | |||
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(PORT5, P5_ESCI_A_TX), PAL_HIGH, PAL_MODE_INPUT_ALTERNATE_PRIMARY}, | ||
23 | {PCR(PORT5, P5_ESCI_A_RX), PAL_HIGH, PAL_MODE_INPUT_ALTERNATE_PRIMARY}, | ||
24 | {PCR(PORT11, P11_BUTTON1), PAL_LOW, PAL_MODE_INPUT}, | ||
25 | {PCR(PORT11, P11_BUTTON2), PAL_LOW, PAL_MODE_INPUT}, | ||
26 | {PCR(PORT11, P11_BUTTON3), PAL_LOW, PAL_MODE_INPUT}, | ||
27 | {PCR(PORT11, P11_BUTTON4), PAL_LOW, PAL_MODE_INPUT}, | ||
28 | {PCR(PORT11, P11_LED1), PAL_HIGH, PAL_MODE_OUTPUT_PUSHPULL}, | ||
29 | {PCR(PORT11, P11_LED2), PAL_HIGH, PAL_MODE_OUTPUT_PUSHPULL}, | ||
30 | {PCR(PORT11, P11_LED3), PAL_HIGH, PAL_MODE_OUTPUT_PUSHPULL}, | ||
31 | {PCR(PORT11, P11_LED4), PAL_HIGH, PAL_MODE_OUTPUT_PUSHPULL}, | ||
32 | {-1, 0, 0} | ||
33 | }; | ||
34 | |||
35 | /** | ||
36 | * @brief PAL setup. | ||
37 | */ | ||
38 | const PALConfig pal_default_config = { | ||
39 | spc_siu_init | ||
40 | }; | ||
41 | #endif | ||
42 | |||
43 | /* | ||
44 | * Early initialization code. | ||
45 | * This initialization must be performed just after stack setup and before | ||
46 | * any other initialization. | ||
47 | */ | ||
48 | void __early_init(void) { | ||
49 | |||
50 | spc_clock_init(); | ||
51 | } | ||
52 | |||
53 | |||
54 | /* | ||
55 | * Board-specific initialization code. | ||
56 | */ | ||
57 | void boardInit(void) { | ||
58 | } | ||