1 /*********************************************************************************************************************
2  * @file     system_XMC4700.h
3  * @brief    Device specific initialization for the XMC4700-Series according to CMSIS
4  * @version  V1.0
5  * @date     22 May 2015
6  *
7  * @cond
8  *********************************************************************************************************************
9  * Copyright (c) 2015-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  * V1.0, 22 May 2015, JFT, Initial version
38  *****************************************************************************
39  * @endcond
40  */
41 
42 #ifndef SYSTEM_XMC4700_H
43 #define SYSTEM_XMC4700_H
44 
45 /*******************************************************************************
46  * HEADER FILES
47  *******************************************************************************/
48 
49 #include <stdint.h>
50 
51 /*******************************************************************************
52  * MACROS
53  *******************************************************************************/
54 
55 #define	OFI_FREQUENCY        (24000000UL)  /**< 24MHz Backup Clock (fOFI) frequency. */
56 #define OSI_FREQUENCY        (32768UL)    /**< 32KHz Internal Slow Clock source (fOSI) frequency. */
57 
58 /*******************************************************************************
59  * GLOBAL VARIABLES
60  *******************************************************************************/
61 
62 extern uint32_t SystemCoreClock;     /*!< System Clock Frequency (Core Clock)  */
63 extern uint8_t g_chipid[16];
64 
65 /*******************************************************************************
66  * API PROTOTYPES
67  *******************************************************************************/
68 
69 #ifdef __cplusplus
70 extern "C" {
71 #endif
72 
73 /**
74  * @brief Initialize the system
75  *
76  */
77 void SystemInit(void);
78 
79 /**
80  * @brief Initialize CPU settings
81  *
82  */
83 void SystemCoreSetup(void);
84 
85 /**
86  * @brief Initialize clock
87  *
88  */
89 void SystemCoreClockSetup(void);
90 
91 /**
92  * @brief Update SystemCoreClock variable
93  *
94  */
95 void SystemCoreClockUpdate(void);
96 
97 /**
98  * @brief Returns frequency of the high performace oscillator
99  * User needs to overload this function to return the correct oscillator frequency
100  */
101 uint32_t OSCHP_GetFrequency(void);
102 
103 #ifdef __cplusplus
104 }
105 #endif
106 
107 #endif
108