Contiki 3.x
system_MK60DZ10.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014, Eistec AB.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  * 1. Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  * notice, this list of conditions and the following disclaimer in the
12  * documentation and/or other materials provided with the distribution.
13  * 3. Neither the name of the copyright holder nor the names of its contributors
14  * may be used to endorse or promote products derived from this software
15  * without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
21  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27  * POSSIBILITY OF SUCH DAMAGE.
28  *
29  * This file is part of the Mulle platform port of the Contiki operating system.
30  *
31  */
32 
33 /**
34  * \file
35  * \brief Device specific configuration file for MK60DZ10 (header file)
36  *
37  * Provides a system configuration function and a global variable that contains
38  * the system frequency. It configures the device clocks and initializes the
39  * oscillator that is part of the microcontroller device.
40  */
41 
42 #ifndef SYSTEM_MK60DZ10_H_
43 #define SYSTEM_MK60DZ10_H_
44 
45 #include <stdint.h>
46 
47 #ifdef __cplusplus
48 extern "C" {
49 #endif
50 
51 /**
52  * \brief Current core clock frequency
53  *
54  * MCGOUTCLK divided by OUTDIV1 clocks the ARM Cortex-M4 core.
55  */
56 extern uint32_t SystemCoreClock;
57 
58 /**
59  * \brief Current system clock frequency
60  *
61  * MCGOUTCLK divided by OUTDIV1 clocks the crossbar switch and bus masters
62  * directly connected to the crossbar. In addition, this clock is used for UART0
63  * and UART1.
64  */
65 extern uint32_t SystemSysClock;
66 
67 /**
68  * \brief Current bus clock frequency
69  *
70  * MCGOUTCLK divided by OUTDIV2 clocks the bus slaves and peripherals (excluding
71  * memories).
72  */
73 extern uint32_t SystemBusClock;
74 
75 /**
76  * \brief Current FlexBus clock frequency
77  *
78  * MCGOUTCLK divided by OUTDIV3 clocks the external FlexBus interface.
79  */
80 extern uint32_t SystemFlexBusClock;
81 
82 /**
83  * \brief Current flash clock frequency
84  *
85  * MCGOUTCLK divided by OUTDIV4 clocks the flash memory.
86  */
87 extern uint32_t SystemFlashClock;
88 
89 
90 /**
91  * \brief Setup the microcontroller system.
92  *
93  * Typically this function configures the oscillator (PLL) that is part of the
94  * microcontroller device. For systems with variable clock speed it also updates
95  * the variable SystemCoreClock. SystemInit is called from startup_device file.
96  */
97 void SystemInit(void);
98 
99 /**
100  * \brief Updates all of the SystemCoreClock variables.
101  *
102  * It must be called whenever the core clock is changed during program
103  * execution. SystemCoreClockUpdate() evaluates the clock register settings and
104  * calculates the current core clock.
105  */
106 void SystemCoreClockUpdate(void);
107 
108 #ifdef __cplusplus
109 } /* extern "C" */
110 #endif
111 
112 #endif /* #if !defined(SYSTEM_MK60DZ10_H_) */
void SystemInit(void)
Initialize the system.
uint32_t SystemFlexBusClock
Current FlexBus clock frequency.
uint32_t SystemFlashClock
Current flash clock frequency.
uint32_t SystemCoreClock
Current core clock frequency.
void SystemCoreClockUpdate(void)
Update internal SystemCoreClock variable.
uint32_t SystemSysClock
Current system clock frequency.
uint32_t SystemBusClock
Current bus clock frequency.