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 
24 #ifndef CFG_CLK_DEFAULT_H
25 #define CFG_CLK_DEFAULT_H
26 
27 #include <stdint.h>
28 
29 #include "cpu.h"
30 #include "periph_cpu.h"
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
41 /*
42  * 0: use internal 32KHz RCOSC
43  * 1: use external 32KHz XOSC
44  */
45 #ifndef SYS_CTRL_OSC32K_USE_XTAL
46 #define SYS_CTRL_OSC32K_USE_XTAL (1)
47 #endif
48 /*
49  * 0: use internal 16MHz RCOSC
50  * 1: use external 32MHz XOSC, required for RF operation
51  */
52 #ifndef SYS_CTRL_OSC_USE_XTAL
53 #define SYS_CTRL_OSC_USE_XTAL (1)
54 #endif
55 
56 #if SYS_CTRL_OSC_USE_XTAL
57 #define CLOCK_OSC (XOSC32M_FREQ)
58 #else
59 #define CLOCK_OSC (RCOSC16M_FREQ)
60 #endif
61 
62 #if SYS_CTRL_OSC32K_USE_XTAL
63 #define CLOCK_OSC32K (XOSC32K_FREQ) /* XCOSC frequency */
64 #else
65 #define CLOCK_OSC32K (RCOSC32K_FREQ) /* XCOSC frequency */
66 #endif
67 
68 /* System clock frequency 32MHz */
69 #ifndef CLOCK_CORECLOCK
70 #define CLOCK_CORECLOCK (CLOCK_OSC)
71 #endif
72 /* I/O clock rate setting 16MHz */
73 #ifndef CLOCK_IO
74 #define CLOCK_IO (CLOCK_OSC / 2)
75 #endif
76 
78 #ifdef __cplusplus
79 }
80 #endif
81 
82 #endif /* CFG_CLK_DEFAULT_H */
83