aboutsummaryrefslogtreecommitdiff
path: root/lib/chibios-contrib/ext/mcux-sdk/devices/LPC54005/project_template/board.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chibios-contrib/ext/mcux-sdk/devices/LPC54005/project_template/board.c')
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC54005/project_template/board.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/lib/chibios-contrib/ext/mcux-sdk/devices/LPC54005/project_template/board.c b/lib/chibios-contrib/ext/mcux-sdk/devices/LPC54005/project_template/board.c
new file mode 100644
index 000000000..64fddff63
--- /dev/null
+++ b/lib/chibios-contrib/ext/mcux-sdk/devices/LPC54005/project_template/board.c
@@ -0,0 +1,40 @@
1/*
2 * Copyright (c) 2016, Freescale Semiconductor, Inc.
3 * Copyright 2016-2017 NXP
4 * All rights reserved.
5 *
6 * SPDX-License-Identifier: BSD-3-Clause
7 */
8
9#include <stdint.h>
10#include "fsl_common.h"
11#include "clock_config.h"
12#include "board.h"
13#include "fsl_debug_console.h"
14
15/*******************************************************************************
16 * Variables
17 ******************************************************************************/
18
19/* Clock rate on the CLKIN pin */
20const uint32_t ExtClockIn = BOARD_EXTCLKINRATE;
21
22/*******************************************************************************
23 * Code
24 ******************************************************************************/
25/* Initialize debug console. */
26status_t BOARD_InitDebugConsole(void)
27{
28#if ((SDK_DEBUGCONSOLE == DEBUGCONSOLE_REDIRECT_TO_SDK) || defined(SDK_DEBUGCONSOLE_UART))
29 status_t result;
30 /* attach 12 MHz clock to FLEXCOMM0 (debug console) */
31 CLOCK_AttachClk(kFRO12M_to_FLEXCOMM0);
32 RESET_PeripheralReset(BOARD_DEBUG_UART_RST);
33 result = DbgConsole_Init(BOARD_DEBUG_UART_BASEADDR, BOARD_DEBUG_UART_BAUDRATE, DEBUG_CONSOLE_DEVICE_TYPE_FLEXCOMM,
34 BOARD_DEBUG_UART_CLK_FREQ);
35 assert(kStatus_Success == result);
36 return result;
37#else
38 return kStatus_Success;
39#endif
40}