1 /**
2 ******************************************************************************
3 * @file system_tae32f53xx.c
4 * @author MCD Application Team
5 * @brief CMSIS Cortex-M3 Device Peripheral Access Layer System Source File.
6 *
7 *
8 * 1. This file provides two functions and one global variable to be called from
9 * user application:
10 * - SystemInit(): Setups the system interrupt vector.
11 * This function is called at startup just after reset and
12 * before branch to main program. This call is made inside
13 * the "startup_tae32f53xx.c" file.
14 *
15 * - SystemCoreClock variable: Contains the core clock (HCLK), it can be used
16 * by the user application to setup the SysTick
17 * timer or configure other parameters.
18 *
19 * - SystemCoreClockUpdate(): Updates the variable SystemCoreClock and must
20 * be called whenever the core clock is changed
21 * during program execution.
22 *
23 * 2. After each device reset the LSI (32 KHz) is used as system clock source.
24 * Then SystemInit() function is called, in "startup_tae32f53xx.c" file, to
25 * configure the system clock before to branch to main program.
26 *
27 * 3. The default value of HSE crystal is set to 8 MHz, refer to "HSE_VALUE".
28 * When HSE is used as system clock source, directly or through PLL, and you
29 * are using different crystal you have to adapt the HSE value to your own
30 * configuration.
31 *
32 ******************************************************************************
33 * @attention
34 *
35 * <h2><center>© Copyright (c) 2020 Tai-Action.
36 * All rights reserved.</center></h2>
37 *
38 * This software is licensed by Tai-Action under BSD 3-Clause license,
39 * the "License"; You may not use this file except in compliance with the
40 * License. You may obtain a copy of the License at:
41 * opensource.org/licenses/BSD-3-Clause
42 *
43 ******************************************************************************
44 */
45
46 /* Includes ------------------------------------------------------------------*/
47 #include "tae32f53xx.h"
48
49
50 /** @addtogroup TAE_CMSIS
51 * @{
52 */
53
54 /** @defgroup TAE32F53xx_System TAE32F53xx System
55 * @brief TAE32F53xx System
56 * @{
57 */
58
59
60 /* Private typedef -----------------------------------------------------------*/
61 /* Private defines -----------------------------------------------------------*/
62 /* Private macro -------------------------------------------------------------*/
63 /* Private variables ---------------------------------------------------------*/
64 /** @defgroup TAE32F53xx_System_Private_Variables TAE32F53xx System Private Variables
65 * @brief TAE32F53xx System Private Variables
66 * @{
67 */
68
69 /**
70 * @brief Import the Interrupt Vector Table
71 */
72 extern void (* const __VECTOR_TABLE[])(void) ;
73
74 /**
75 * @}
76 */
77
78 /* Private function prototypes -----------------------------------------------*/
79 /* Exported variables --------------------------------------------------------*/
80 /** @defgroup TAE32F53xx_System_Exported_Variables TAE32F53xx System Exported Variables
81 * @brief TAE32F53xx System Exported Variables
82 * @{
83 */
84
85 /**
86 * @brief SYSCLK System Clock Frequency (Core Clock), default value 32K.
87 * @note This variable is updated by calling SystemCoreClockUpdate()
88 */
89 uint32_t SystemCoreClock = 32000UL;
90
91 /**
92 * @}
93 */
94
95 /* Exported functions --------------------------------------------------------*/
96 /** @defgroup TAE32F53xx_System_Exported_Functions TAE32F53xx System Exported Functions
97 * @brief TAE32F53xx System Exported Functions
98 * @{
99 */
100
101 /**
102 * @brief Initialize the Interrupt Vector.
103 * @note This function should be used only after reset.
104 * @param None
105 * @return None
106 */
SystemInit(void)107 void SystemInit(void)
108 {
109 //Interrupt Vector Config
110 SCB->VTOR = (uint32_t)__VECTOR_TABLE;
111 }
112
113 /**
114 * @brief Update SystemCoreClock variable
115 * @note Each time the system core clock changes, this function must be called
116 * to update SystemCoreClock variable value. Otherwise, any configuration
117 * based on this variable will be incorrect.
118 * @note The system frequency update by this function is not the real
119 * frequency in the chip.
120 * @param None
121 * @retval None
122 */
SystemCoreClockUpdate(uint32_t sysclk)123 void SystemCoreClockUpdate(uint32_t sysclk)
124 {
125 if (sysclk) {
126 SystemCoreClock = sysclk;
127 }
128 }
129
130 /**
131 * @}
132 */
133
134 /* Private functions ---------------------------------------------------------*/
135
136
137 /**
138 * @}
139 */
140
141 /**
142 * @}
143 */
144
145 /************************* (C) COPYRIGHT Tai-Action *****END OF FILE***********/
146
147