1 /**************************************************************************//**
2  * @file     system_m460.h
3  * @version  V3.00
4  * @brief    CMSIS Cortex-M4 Core Peripheral Access Layer Header File for M460
5  *
6  * @copyright SPDX-License-Identifier: Apache-2.0
7  * @copyright Copyright (C) 2021 Nuvoton Technology Corp. All rights reserved.
8 *****************************************************************************/
9 
10 #ifndef __SYSTEM_M460_H__
11 #define __SYSTEM_M460_H__
12 
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16 
17 #include <stdint.h>
18 
19 
20 /*----------------------------------------------------------------------------
21   Define clocks
22  *----------------------------------------------------------------------------*/
23 
24 #ifndef __HSI
25 #define __HSI       (12000000UL)    /*!< PLL default output is 50MHz */
26 #endif
27 
28 #ifndef __HXT
29 #define __HXT       (12000000UL)    /*!< External Crystal Clock Frequency     */
30 #endif
31 
32 #ifndef __LXT
33 #define __LXT       (32768UL)       /*!< External Crystal Clock Frequency 32.768KHz */
34 #endif
35 
36 #define __HIRC      (12000000UL)    /*!< Internal 12M RC Oscillator Frequency */
37 #define __HIRC48M   (48000000UL)    /*!< Internal 48M RC Oscillator Frequency */
38 #define __LIRC      (10000UL)       /*!< Internal 10K RC Oscillator Frequency */
39 #define __SYS_OSC_CLK     (    ___HSI)    /* Main oscillator frequency        */
40 
41 
42 #define __SYSTEM_CLOCK    (1UL*__HXT)
43 
44 #ifndef DEBUG_PORT
45 #define DEBUG_PORT  UART0   /*!< Select Debug Port which is used for retarget.c to output debug message to UART */
46 #endif
47 
48 extern uint32_t SystemCoreClock;     /*!< System Clock Frequency (Core Clock)  */
49 extern uint32_t CyclesPerUs;         /*!< Cycles per micro second              */
50 extern uint32_t PllClock;            /*!< PLL Output Clock Frequency           */
51 
52 
53 /**
54  * Initialize the system
55  *
56  * @param  none
57  * @return none
58  *
59  * @brief  Setup the micro controller system.
60  *         Initialize the System and update the SystemCoreClock variable.
61  */
62 extern void SystemInit (void);
63 
64 /**
65  * Update SystemCoreClock variable
66  *
67  * @param  none
68  * @return none
69  *
70  * @brief  Updates the SystemCoreClock with current core Clock
71  *         retrieved from cpu registers.
72  */
73 extern void SystemCoreClockUpdate (void);
74 
75 #ifdef __cplusplus
76 }
77 #endif
78 
79 #endif /* __SYSTEM_M460_H__ */
80