cfg_clk_default.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2014-2016 Freie Universität Berlin
3  * 2015 Zolertia SL
4  * 2020 Inria
5  *
6  * This file is subject to the terms and conditions of the GNU Lesser
7  * General Public License v2.1. See the file LICENSE in the top level
8  * directory for more details.
9  */
10 
11 #pragma once
12 
26 #include <stdint.h>
27 
28 #include "cpu.h"
29 #include "periph_cpu.h"
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
40 /*
41  * 0: use internal 32KHz RCOSC
42  * 1: use external 32KHz XOSC
43  */
44 #ifndef SYS_CTRL_OSC32K_USE_XTAL
45 #define SYS_CTRL_OSC32K_USE_XTAL (1)
46 #endif
47 /*
48  * 0: use internal 16MHz RCOSC
49  * 1: use external 32MHz XOSC, required for RF operation
50  */
51 #ifndef SYS_CTRL_OSC_USE_XTAL
52 #define SYS_CTRL_OSC_USE_XTAL (1)
53 #endif
54 
55 #if SYS_CTRL_OSC_USE_XTAL
56 #define CLOCK_OSC (XOSC32M_FREQ)
57 #else
58 #define CLOCK_OSC (RCOSC16M_FREQ)
59 #endif
60 
61 #if SYS_CTRL_OSC32K_USE_XTAL
62 #define CLOCK_OSC32K (XOSC32K_FREQ) /* XCOSC frequency */
63 #else
64 #define CLOCK_OSC32K (RCOSC32K_FREQ) /* XCOSC frequency */
65 #endif
66 
67 /* System clock frequency 32MHz */
68 #ifndef CLOCK_CORECLOCK
69 #define CLOCK_CORECLOCK (CLOCK_OSC)
70 #endif
71 /* I/O clock rate setting 16MHz */
72 #ifndef CLOCK_IO
73 #define CLOCK_IO (CLOCK_OSC / 2)
74 #endif
77 #ifdef __cplusplus
78 }
79 #endif
80