1 /*********************************************************************************************************************
2  * @file     system_XMC4500.h
3  * @brief    Device specific initialization for the XMC4500-Series according to CMSIS
4  * @version  V1.7
5  * @date     10 February 2015
6  *
7  * @cond
8  *********************************************************************************************************************
9  * Copyright (c) 2012-2016, Infineon Technologies AG
10  * All rights reserved.
11  *
12  * Redistribution and use in source and binary forms, with or without modification,are permitted provided that the
13  * following conditions are met:
14  *
15  * Redistributions of source code must retain the above copyright notice, this list of conditions and the following
16  * disclaimer.
17  *
18  * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following
19  * disclaimer in the documentation and/or other materials provided with the distribution.
20  *
21  * Neither the name of the copyright holders nor the names of its contributors may be used to endorse or promote
22  * products derived from this software without specific prior written permission.
23  *
24  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
25  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE  FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
28  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
29  * WHETHER IN CONTRACT, STRICT LIABILITY,OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  *
32  * To improve the quality of the software, users are encouraged to share modifications, enhancements or bug fixes with
33  * Infineon Technologies AG dave@infineon.com).
34  *********************************************************************************************************************
35  *
36  **************************** Change history *********************************
37  *****************************************************************************
38  * @endcond
39  */
40 
41 #ifndef SYSTEM_XMC4500_H
42 #define SYSTEM_XMC4500_H
43 
44 /*******************************************************************************
45  * HEADER FILES
46  *******************************************************************************/
47 
48 #include <stdint.h>
49 
50 /*******************************************************************************
51  * MACROS
52  *******************************************************************************/
53 
54 #define	OFI_FREQUENCY        (24000000UL)  /**< 24MHz Backup Clock (fOFI) frequency. */
55 #define OSI_FREQUENCY        (32768UL)    /**< 32KHz Internal Slow Clock source (fOSI) frequency. */
56 
57 /*******************************************************************************
58  * GLOBAL VARIABLES
59  *******************************************************************************/
60 
61 extern uint32_t SystemCoreClock;     /*!< System Clock Frequency (Core Clock)  */
62 extern uint8_t g_chipid[16];
63 
64 /*******************************************************************************
65  * API PROTOTYPES
66  *******************************************************************************/
67 
68 #ifdef __cplusplus
69 extern "C" {
70 #endif
71 
72 /**
73  * @brief Initialize the system
74  *
75  */
76 void SystemInit(void);
77 
78 /**
79  * @brief Initialize CPU settings
80  *
81  */
82 void SystemCoreSetup(void);
83 
84 /**
85  * @brief Initialize clock
86  *
87  */
88 void SystemCoreClockSetup(void);
89 
90 /**
91  * @brief Update SystemCoreClock variable
92  *
93  */
94 void SystemCoreClockUpdate(void);
95 
96 /**
97  * @brief Returns frequency of the high performace oscillator
98  * User needs to overload this function to return the correct oscillator frequency
99  */
100 uint32_t OSCHP_GetFrequency(void);
101 
102 #ifdef __cplusplus
103 }
104 #endif
105 
106 #endif
107