diff options
Diffstat (limited to 'lib/chibios-contrib/os/hal/boards/OSHCHIP_V1.0/board.c')
-rw-r--r-- | lib/chibios-contrib/os/hal/boards/OSHCHIP_V1.0/board.c | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/lib/chibios-contrib/os/hal/boards/OSHCHIP_V1.0/board.c b/lib/chibios-contrib/os/hal/boards/OSHCHIP_V1.0/board.c new file mode 100644 index 000000000..85e4486b3 --- /dev/null +++ b/lib/chibios-contrib/os/hal/boards/OSHCHIP_V1.0/board.c | |||
@@ -0,0 +1,80 @@ | |||
1 | /* | ||
2 | Copyright (C) 2016 flabbergast | ||
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 | /** | ||
21 | * @brief PAL setup. | ||
22 | * @details Digital I/O ports static configuration as defined in @p board.h. | ||
23 | * This variable is used by the HAL when initializing the PAL driver. | ||
24 | */ | ||
25 | const PALConfig pal_default_config = | ||
26 | { | ||
27 | .pads = { | ||
28 | PAL_MODE_OUTPUT_PUSHPULL, /* P0.0: PIN11 (AREF0) */ | ||
29 | PAL_MODE_OUTPUT_PUSHPULL, /* P0.1: PIN9 (AIN2) */ | ||
30 | PAL_MODE_OUTPUT_PUSHPULL, /* P0.2: PIN10 (AIN3) */ | ||
31 | PAL_MODE_OUTPUT_PUSHPULL, /* P0.3: LED_BLUE */ | ||
32 | PAL_MODE_UNCONNECTED, /* P0.4 */ | ||
33 | PAL_MODE_OUTPUT_PUSHPULL, /* P0.5: LED_GREEN */ | ||
34 | PAL_MODE_UNCONNECTED, /* P0.6 */ | ||
35 | PAL_MODE_UNCONNECTED, /* P0.7 */ | ||
36 | PAL_MODE_OUTPUT_PUSHPULL, /* P0.8: LED_RED */ | ||
37 | PAL_MODE_OUTPUT_PUSHPULL, /* P0.9: PIN7 */ | ||
38 | PAL_MODE_UNCONNECTED, /* P0.10 */ | ||
39 | PAL_MODE_OUTPUT_PUSHPULL, /* P0.11: PIN6 */ | ||
40 | PAL_MODE_OUTPUT_PUSHPULL, /* P0.12: PIN5 */ | ||
41 | PAL_MODE_UNCONNECTED, /* P0.13 */ | ||
42 | PAL_MODE_UNCONNECTED, /* P0.14 */ | ||
43 | PAL_MODE_OUTPUT_PUSHPULL, /* P0.15: PIN4 */ | ||
44 | PAL_MODE_OUTPUT_PUSHPULL, /* P0.16: PIN3 */ | ||
45 | PAL_MODE_UNCONNECTED, /* P0.17 */ | ||
46 | PAL_MODE_INPUT_PULLUP, /* P0.18: PIN2 (RX) */ | ||
47 | PAL_MODE_UNCONNECTED, /* P0.19 */ | ||
48 | PAL_MODE_OUTPUT_PUSHPULL, /* P0.20: PIN1 (TX) */ | ||
49 | PAL_MODE_OUTPUT_PUSHPULL, /* P0.21: PIN15 */ | ||
50 | PAL_MODE_UNCONNECTED, /* P0.22 */ | ||
51 | PAL_MODE_UNCONNECTED, /* P0.23 */ | ||
52 | PAL_MODE_OUTPUT_PUSHPULL, /* P0.24: PIN14 */ | ||
53 | PAL_MODE_UNCONNECTED, /* P0.25 */ | ||
54 | PAL_MODE_OUTPUT_PUSHPULL, /* P0.26: PIN13 (LFXTL) (AIN0) */ | ||
55 | PAL_MODE_OUTPUT_PUSHPULL, /* P0.27: PIN12 (LFXTL) (AIN1) */ | ||
56 | PAL_MODE_UNCONNECTED, /* P0.28 */ | ||
57 | PAL_MODE_UNCONNECTED, /* P0.29 */ | ||
58 | PAL_MODE_UNCONNECTED, /* P0.30 */ | ||
59 | PAL_MODE_UNCONNECTED, /* P0.31 */ | ||
60 | }, | ||
61 | }; | ||
62 | #endif | ||
63 | |||
64 | /** | ||
65 | * @brief Early initialization code. | ||
66 | * @details This initialization is performed just after reset before BSS and | ||
67 | * DATA segments initialization. | ||
68 | */ | ||
69 | void __early_init(void) | ||
70 | { | ||
71 | } | ||
72 | |||
73 | /** | ||
74 | * @brief Late initialization code. | ||
75 | * @note This initialization is performed after BSS and DATA segments | ||
76 | * initialization and before invoking the main() function. | ||
77 | */ | ||
78 | void boardInit(void) | ||
79 | { | ||
80 | } | ||