1 /**************************************************************************//**
2  * @file     system_ARMCM0plus.c
3  * @brief    CMSIS Device System Source File for
4  *           ARMCM0plus Device
5  * @version  V2.0.0
6  * @date     06. April 2023
7  ******************************************************************************/
8 /*
9  * Copyright (c) 2009-2023 Arm Limited. All rights reserved.
10  *
11  * SPDX-License-Identifier: Apache-2.0
12  *
13  * Licensed under the Apache License, Version 2.0 (the License); you may
14  * not use this file except in compliance with the License.
15  * You may obtain a copy of the License at
16  *
17  * www.apache.org/licenses/LICENSE-2.0
18  *
19  * Unless required by applicable law or agreed to in writing, software
20  * distributed under the License is distributed on an AS IS BASIS, WITHOUT
21  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22  * See the License for the specific language governing permissions and
23  * limitations under the License.
24  */
25 
26 #if defined (ARMCM0P)
27   #include "ARMCM0plus.h"
28 #else
29   #error device not specified!
30 #endif
31 
32 /*----------------------------------------------------------------------------
33   Define clocks
34  *----------------------------------------------------------------------------*/
35 #define  XTAL            (50000000UL)     /* Oscillator frequency */
36 
37 #define  SYSTEM_CLOCK    (XTAL / 2U)
38 
39 /*----------------------------------------------------------------------------
40   Exception / Interrupt Vector table
41  *----------------------------------------------------------------------------*/
42 extern const VECTOR_TABLE_Type __VECTOR_TABLE[48];
43 
44 /*----------------------------------------------------------------------------
45   System Core Clock Variable
46  *----------------------------------------------------------------------------*/
47 uint32_t SystemCoreClock = SYSTEM_CLOCK;  /* System Core Clock Frequency */
48 
49 
50 /*----------------------------------------------------------------------------
51   System Core Clock update function
52  *----------------------------------------------------------------------------*/
SystemCoreClockUpdate(void)53 void SystemCoreClockUpdate (void)
54 {
55   SystemCoreClock = SYSTEM_CLOCK;
56 }
57 
58 /*----------------------------------------------------------------------------
59   System initialization function
60  *----------------------------------------------------------------------------*/
SystemInit(void)61 void SystemInit (void)
62 {
63 
64 #if defined (__VTOR_PRESENT) && (__VTOR_PRESENT == 1U)
65   SCB->VTOR = (uint32_t) &(__VECTOR_TABLE[0]);
66 #endif
67 
68   SystemCoreClock = SYSTEM_CLOCK;
69 }
70