ISSDK  1.8
IoT Sensing Software Development Kit
board.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2016, Freescale Semiconductor, Inc.
3  * Copyright 2016 NXP
4  * All rights reserved.
5  *
6  *
7  * SPDX-License-Identifier: BSD-3-Clause
8  */
9 
10 #include "fsl_common.h"
11 #include "fsl_debug_console.h"
12 #include "board.h"
13 
14 /*******************************************************************************
15  * Variables
16  ******************************************************************************/
17 
18 /*******************************************************************************
19  * Code
20  ******************************************************************************/
21 
22 /* Get debug console frequency. */
24 {
25  uint32_t freq;
26 
27  /* To make it simple, we assume default PLL and divider settings, and the only variable
28  from application is use PLL3 source or OSC source */
29  if (CLOCK_GetMux(kCLOCK_UartMux) == 0) /* PLL3 div6 80M */
30  {
31  freq = (CLOCK_GetPllFreq(kCLOCK_PllUsb1) / 6U) / (CLOCK_GetDiv(kCLOCK_UartDiv) + 1U);
32  }
33  else
34  {
35  freq = CLOCK_GetOscFreq() / (CLOCK_GetDiv(kCLOCK_UartDiv) + 1U);
36  }
37 
38  return freq;
39 }
40 
41 /* Initialize debug console. */
43 {
44  uint32_t uartClkSrcFreq = BOARD_DebugConsoleSrcFreq();
45 
47 }
uint32_t BOARD_DebugConsoleSrcFreq(void)
Definition: board.c:25
#define BOARD_DEBUG_UART_BAUDRATE
Definition: board.h:31
#define BOARD_DEBUG_UART_BASEADDR
Definition: board.h:24
void BOARD_InitDebugConsole(void)
Definition: board.c:15
#define BOARD_DEBUG_UART_TYPE
Definition: board.h:23