aboutsummaryrefslogtreecommitdiff
path: root/lib/chibios/os/hal/boards/ST_EVB_SPC560BC/board.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chibios/os/hal/boards/ST_EVB_SPC560BC/board.c')
-rw-r--r--lib/chibios/os/hal/boards/ST_EVB_SPC560BC/board.c66
1 files changed, 66 insertions, 0 deletions
diff --git a/lib/chibios/os/hal/boards/ST_EVB_SPC560BC/board.c b/lib/chibios/os/hal/boards/ST_EVB_SPC560BC/board.c
new file mode 100644
index 000000000..058a32762
--- /dev/null
+++ b/lib/chibios/os/hal/boards/ST_EVB_SPC560BC/board.c
@@ -0,0 +1,66 @@
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, 0, 0, 0, 0, 0, 0, 0, 0,
38 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
39};
40
41/**
42 * @brief PAL setup.
43 */
44const PALConfig pal_default_config = {
45 PAL_MODE_UNCONNECTED, /* Default mode for all undefined pads. */
46 spc_siu_init,
47 spc_padsels_init
48};
49#endif
50
51/*
52 * Early initialization code.
53 * This initialization must be performed just after stack setup and before
54 * any other initialization.
55 */
56void __early_init(void) {
57
58 spc_clock_init();
59}
60
61/*
62 * Board-specific initialization code.
63 */
64void boardInit(void) {
65
66}