aboutsummaryrefslogtreecommitdiff
path: root/lib/chibios-contrib/ext/mcux-sdk/boards/lpcxpresso824max/project_template/board.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chibios-contrib/ext/mcux-sdk/boards/lpcxpresso824max/project_template/board.c')
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/boards/lpcxpresso824max/project_template/board.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/lib/chibios-contrib/ext/mcux-sdk/boards/lpcxpresso824max/project_template/board.c b/lib/chibios-contrib/ext/mcux-sdk/boards/lpcxpresso824max/project_template/board.c
new file mode 100644
index 000000000..6041f4d71
--- /dev/null
+++ b/lib/chibios-contrib/ext/mcux-sdk/boards/lpcxpresso824max/project_template/board.c
@@ -0,0 +1,41 @@
1/*
2 * Copyright (c) 2016, Freescale Semiconductor, Inc.
3 * Copyright 2016-2018 NXP
4 *
5 * SPDX-License-Identifier: BSD-3-Clause
6 */
7
8#include <stdint.h>
9#include "fsl_common.h"
10#include "clock_config.h"
11#include "board.h"
12#include "fsl_debug_console.h"
13
14/*******************************************************************************
15 * Variables
16 ******************************************************************************/
17
18/* Clock rate on the CLKIN pin */
19const uint32_t ExtClockIn = BOARD_EXTCLKINRATE;
20
21/*******************************************************************************
22 * Code
23 ******************************************************************************/
24/* Initialize debug console. */
25status_t BOARD_InitDebugConsole(void)
26{
27#if ((SDK_DEBUGCONSOLE == DEBUGCONSOLE_REDIRECT_TO_SDK) || defined(SDK_DEBUGCONSOLE_UART))
28 status_t result;
29 /* Enable clock of uart0. */
30 CLOCK_EnableClock(kCLOCK_Uart0);
31 /* Ser DIV of uart0. */
32 CLOCK_SetClkDivider(kCLOCK_DivUsartClk, 1U);
33 RESET_PeripheralReset(BOARD_DEBUG_USART_RST);
34 result = DbgConsole_Init(BOARD_DEBUG_USART_INSTANCE, BOARD_DEBUG_USART_BAUDRATE, BOARD_DEBUG_USART_TYPE,
35 BOARD_DEBUG_USART_CLK_FREQ);
36 assert(kStatus_Success == result);
37 return result;
38#else
39 return kStatus_Success;
40#endif
41}