aboutsummaryrefslogtreecommitdiff
path: root/lib/chibios-contrib/os/hal/boards/SIPEED_LONGAN_NANO/board.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chibios-contrib/os/hal/boards/SIPEED_LONGAN_NANO/board.c')
-rw-r--r--lib/chibios-contrib/os/hal/boards/SIPEED_LONGAN_NANO/board.c49
1 files changed, 49 insertions, 0 deletions
diff --git a/lib/chibios-contrib/os/hal/boards/SIPEED_LONGAN_NANO/board.c b/lib/chibios-contrib/os/hal/boards/SIPEED_LONGAN_NANO/board.c
new file mode 100644
index 000000000..36a27cb58
--- /dev/null
+++ b/lib/chibios-contrib/os/hal/boards/SIPEED_LONGAN_NANO/board.c
@@ -0,0 +1,49 @@
1/*
2 ChibiOS - Copyright (C) 2006..2015 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/**
20 * @brief PAL setup.
21 * @details Digital I/O ports static configuration as defined in @p board.h.
22 * This variable is used by the HAL when initializing the PAL driver.
23 */
24#if HAL_USE_PAL || defined(__DOXYGEN__)
25const PALConfig pal_default_config =
26{
27 {VAL_GPIOAODR, VAL_GPIOACRL, VAL_GPIOACRH},
28 {VAL_GPIOBODR, VAL_GPIOBCRL, VAL_GPIOBCRH},
29 {VAL_GPIOCODR, VAL_GPIOCCRL, VAL_GPIOCCRH},
30 {VAL_GPIODODR, VAL_GPIODCRL, VAL_GPIODCRH},
31};
32#endif
33
34/*
35 * Early initialization code.
36 * This initialization must be performed just after stack setup and before
37 * any other initialization.
38 */
39void __early_init(void) {
40 gd32_clock_init();
41}
42
43/*
44 * Board-specific initialization code.
45 */
46void boardInit(void) {
47 /* Free B4 pin by disabling JTAG NJTRST. */
48 AFIO->PCF0 |= AFIO_PCF0_SWJ_CFG_NOJNTRST;
49}