99 lines
3.1 KiB
C
99 lines
3.1 KiB
C
/*
|
|
** ###################################################################
|
|
** Processors: LPC54102J256BD64_cm4
|
|
** LPC54102J256UK49_cm4
|
|
** LPC54102J512BD64_cm4
|
|
** LPC54102J512UK49_cm4
|
|
**
|
|
** Compilers: Keil ARM C/C++ Compiler
|
|
** IAR ANSI C/C++ Compiler for ARM
|
|
** MCUXpresso Compiler
|
|
**
|
|
** Reference manual: LPC5410x User manual Rev. 2.4 25 May 2016
|
|
** Version: rev. 1.0, 2016-04-29
|
|
** Build: b180802
|
|
**
|
|
** Abstract:
|
|
** Provides a system configuration function and a global variable that
|
|
** contains the system frequency. It configures the device and initializes
|
|
** the oscillator (PLL) that is part of the microcontroller device.
|
|
**
|
|
** Copyright 2016 Freescale Semiconductor, Inc.
|
|
** Copyright 2016-2018 NXP
|
|
**
|
|
** SPDX-License-Identifier: BSD-3-Clause
|
|
**
|
|
** http: www.nxp.com
|
|
** mail: support@nxp.com
|
|
**
|
|
** Revisions:
|
|
** - rev. 1.0 (2016-04-29)
|
|
** Initial version.
|
|
**
|
|
** ###################################################################
|
|
*/
|
|
|
|
/*!
|
|
* @file LPC54102_cm4
|
|
* @version 1.0
|
|
* @date 2016-04-29
|
|
* @brief Device specific configuration file for LPC54102_cm4 (implementation
|
|
* file)
|
|
*
|
|
* Provides a system configuration function and a global variable that contains
|
|
* the system frequency. It configures the device and initializes the oscillator
|
|
* (PLL) that is part of the microcontroller device.
|
|
*/
|
|
|
|
#include <stdint.h>
|
|
#include "fsl_device_registers.h"
|
|
|
|
|
|
|
|
/* ----------------------------------------------------------------------------
|
|
-- Core clock
|
|
---------------------------------------------------------------------------- */
|
|
|
|
uint32_t SystemCoreClock = DEFAULT_SYSTEM_CLOCK;
|
|
|
|
/* ----------------------------------------------------------------------------
|
|
-- SystemInit()
|
|
---------------------------------------------------------------------------- */
|
|
|
|
void SystemInit (void) {
|
|
#if ((__FPU_PRESENT == 1) && (__FPU_USED == 1))
|
|
SCB->CPACR |= ((3UL << 10*2) | (3UL << 11*2)); /* set CP10, CP11 Full Access */
|
|
#endif /* ((__FPU_PRESENT == 1) && (__FPU_USED == 1)) */
|
|
|
|
#if defined(__CODE_RED)
|
|
extern void(*const g_pfnVectors[]) (void);
|
|
SCB->VTOR = (uint32_t) &g_pfnVectors;
|
|
#else
|
|
extern void *__Vectors;
|
|
SCB->VTOR = (uint32_t) &__Vectors;
|
|
#endif
|
|
/* Optionally enable RAM banks that may be off by default at reset */
|
|
#if !defined (DONT_ENABLE_DISABLED_RAMBANKS)
|
|
SYSCON->AHBCLKCTRLSET[0] = SYSCON_AHBCLKCTRL_SRAM2_MASK;
|
|
#endif
|
|
|
|
SystemInitHook();
|
|
}
|
|
|
|
/* ----------------------------------------------------------------------------
|
|
-- SystemCoreClockUpdate()
|
|
---------------------------------------------------------------------------- */
|
|
|
|
void SystemCoreClockUpdate (void) {
|
|
|
|
|
|
}
|
|
|
|
/* ----------------------------------------------------------------------------
|
|
-- SystemInitHook()
|
|
---------------------------------------------------------------------------- */
|
|
|
|
__attribute__ ((weak)) void SystemInitHook (void) {
|
|
/* Void implementation of the weak function. */
|
|
}
|