aboutsummaryrefslogtreecommitdiff
path: root/lib/chibios/os/hal/boards/ST_EVB_SPC560D/board.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chibios/os/hal/boards/ST_EVB_SPC560D/board.c')
-rw-r--r--lib/chibios/os/hal/boards/ST_EVB_SPC560D/board.c71
1 files changed, 71 insertions, 0 deletions
diff --git a/lib/chibios/os/hal/boards/ST_EVB_SPC560D/board.c b/lib/chibios/os/hal/boards/ST_EVB_SPC560D/board.c
new file mode 100644
index 000000000..c3a73d3b1
--- /dev/null
+++ b/lib/chibios/os/hal/boards/ST_EVB_SPC560D/board.c
@@ -0,0 +1,71 @@
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}.*/
21static 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_E, PE_BUTTON1), PAL_LOW, PAL_MODE_INPUT},
25 {PCR(PORT_E, PE_BUTTON2), PAL_LOW, PAL_MODE_INPUT},
26 {PCR(PORT_E, PE_BUTTON3), PAL_LOW, PAL_MODE_INPUT},
27 {PCR(PORT_E, PE_BUTTON4), PAL_LOW, PAL_MODE_INPUT},
28 {PCR(PORT_E, PE_LED1), PAL_HIGH, PAL_MODE_OUTPUT_PUSHPULL},
29 {PCR(PORT_E, PE_LED2), PAL_HIGH, PAL_MODE_OUTPUT_PUSHPULL},
30 {PCR(PORT_E, PE_LED3), PAL_HIGH, PAL_MODE_OUTPUT_PUSHPULL},
31 {PCR(PORT_E, PE_LED4), PAL_HIGH, PAL_MODE_OUTPUT_PUSHPULL},
32 {-1, 0, 0}
33};
34
35/* Initialization array for the PSMI registers.*/
36static 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, 0, 0, 0, 0,
43 0, 0, 0, 0, 0, 0, 0, 0,
44 0, 0, 0, 0, 0, 0, 0,
45};
46
47/**
48 * @brief PAL setup.
49 */
50const PALConfig pal_default_config = {
51 PAL_MODE_UNCONNECTED,
52 spc_siu_init,
53 spc_padsels_init
54};
55#endif
56
57/*
58 * Early initialization code.
59 * This initialization must be performed just after stack setup and before
60 * any other initialization.
61 */
62void __early_init(void) {
63
64 spc_clock_init();
65}
66
67/*
68 * Board-specific initialization code.
69 */
70void boardInit(void) {
71}