100 lines
3.3 KiB
C
100 lines
3.3 KiB
C
/*
|
|
** ###################################################################
|
|
** Processors: MCXA153VFM
|
|
** MCXA153VFT
|
|
** MCXA153VLH
|
|
**
|
|
** Compilers: GNU C Compiler
|
|
** IAR ANSI C/C++ Compiler for ARM
|
|
** Keil ARM C/C++ Compiler
|
|
** MCUXpresso Compiler
|
|
**
|
|
** Reference manual: MCXA1 User manual
|
|
** Version: rev. 1.0, 2022-03-29
|
|
** Build: b231121
|
|
**
|
|
** 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-2023 NXP
|
|
** SPDX-License-Identifier: BSD-3-Clause
|
|
**
|
|
** http: www.nxp.com
|
|
** mail: support@nxp.com
|
|
**
|
|
** Revisions:
|
|
** - rev. 1.0 (2022-03-29)
|
|
** Initial version based on v0.1UM
|
|
**
|
|
** ###################################################################
|
|
*/
|
|
|
|
/*!
|
|
* @file MCXA153
|
|
* @version 1.0
|
|
* @date 2022-03-29
|
|
* @brief Device specific configuration file for MCXA153 (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()
|
|
---------------------------------------------------------------------------- */
|
|
|
|
__attribute__ ((weak)) void SystemInit (void) {
|
|
|
|
SCB->CPACR |= ((3UL << 0*2) | (3UL << 1*2)); /* set CP0, CP1 Full Access in Secure mode (enable PowerQuad) */
|
|
#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
|
|
SCB_NS->CPACR |= ((3UL << 0*2) | (3UL << 1*2)); /* set CP0, CP1 Full Access in Normal mode (enable PowerQuad) */
|
|
#endif /* (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */
|
|
|
|
SCB->NSACR |= ((3UL << 0) | (3UL << 10)); /* enable CP0, CP1, CP10, CP11 Non-secure Access */
|
|
|
|
#if defined(__MCUXPRESSO)
|
|
extern void(*const g_pfnVectors[]) (void);
|
|
SCB->VTOR = (uint32_t) &g_pfnVectors;
|
|
#else
|
|
extern void *__Vectors;
|
|
SCB->VTOR = (uint32_t) &__Vectors;
|
|
#endif
|
|
/* Enable the LPCAC */
|
|
SYSCON->LPCAC_CTRL |= SYSCON_LPCAC_CTRL_LPCAC_MEM_REQ_MASK;
|
|
SYSCON->LPCAC_CTRL &= ~SYSCON_LPCAC_CTRL_DIS_LPCAC_MASK;
|
|
SystemInitHook();
|
|
}
|
|
|
|
/* ----------------------------------------------------------------------------
|
|
-- SystemCoreClockUpdate()
|
|
---------------------------------------------------------------------------- */
|
|
|
|
void SystemCoreClockUpdate (void) {
|
|
|
|
}
|
|
|
|
/* ----------------------------------------------------------------------------
|
|
-- SystemInitHook()
|
|
---------------------------------------------------------------------------- */
|
|
|
|
__attribute__ ((weak)) void SystemInitHook (void) {
|
|
/* Void implementation of the weak function. */
|
|
}
|