/* * Copyright 2019 NXP * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ /* * How to set up clock using clock driver functions: * * 1. Setup clock sources. * * 2. Set up all dividers. * * 3. Set up all selectors to provide selected clocks. */ /* TEXT BELOW IS USED AS SETTING FOR TOOLS ************************************* !!GlobalInfo product: Clocks v5.0 processor: LPC845 package_id: LPC845M301JBD48 mcu_data: ksdk2_0 processor_version: 5.0.0 board: LPC845BREAKOUT * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS **********/ #include "fsl_power.h" #include "fsl_clock.h" #include "clock_config.h" /******************************************************************************* * Definitions ******************************************************************************/ /******************************************************************************* * Variables ******************************************************************************/ /* System clock frequency. */ extern uint32_t SystemCoreClock; /******************************************************************************* ************************ BOARD_InitBootClocks function ************************ ******************************************************************************/ void BOARD_InitBootClocks(void) { BOARD_BootClockFRO18M(); } /******************************************************************************* ******************** Configuration BOARD_BootClockFRO18M ********************** ******************************************************************************/ /* TEXT BELOW IS USED AS SETTING FOR TOOLS ************************************* !!Configuration name: BOARD_BootClockFRO18M called_from_default_init: true outputs: - {id: FROHF_clock.outFreq, value: 18 MHz} - {id: System_clock.outFreq, value: 18 MHz} settings: - {id: SYSCON.ADCCLKSEL.sel, value: NO_CLOCK} - {id: SYSCON.CLKOUTSEL.sel, value: NO_CLOCK} - {id: SYSCON.FRG0CLKSEL.sel, value: NO_CLOCK} - {id: SYSCON.FRG1CLKSEL.sel, value: NO_CLOCK} - {id: SYSCON.FRO_DIRECT.sel, value: SYSCON.fro_osc} - {id: SYSCON.SCTCLKSEL.sel, value: NO_CLOCK} - {id: SYSCON_PDRUNCFG0_PDEN_PLL_CFG, value: Power_down} sources: - {id: SYSCON.fro_osc.outFreq, value: 18 MHz} * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS **********/ /******************************************************************************* * Variables for BOARD_BootClockFRO18M configuration ******************************************************************************/ /******************************************************************************* * Code for BOARD_BootClockFRO18M configuration ******************************************************************************/ void BOARD_BootClockFRO18M(void) { /*!< Set up the clock sources */ /*!< Set up FRO */ POWER_DisablePD(kPDRUNCFG_PD_FRO_OUT); /*!< Ensure FRO is on */ POWER_DisablePD(kPDRUNCFG_PD_FRO); /*!< Ensure FRO is on */ CLOCK_SetFroOscFreq(kCLOCK_FroOscOut18M); /*!< Set up FRO freq */ CLOCK_SetFroOutClkSrc(kCLOCK_FroSrcFroOsc); /*!< Set FRO clock source */ POWER_DisablePD(kPDRUNCFG_PD_SYSOSC); /*!< Ensure Main osc is on */ CLOCK_Select(kEXT_Clk_From_SysOsc); /*!