periph_common_conf.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2020 Koen Zandberg <koen@bergzand.net>
3  * 2023 Gunar Schorcht <gunar@schorcht.net>
4  *
5  * This file is subject to the terms and conditions of the GNU Lesser
6  * General Public License v2.1. See the file LICENSE in the top level
7  * directory for more details.
8  */
9 
10 #pragma once
11 
23 #include "macros/units.h"
24 #include "periph_cpu.h"
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
30 #if defined(MODULE_USBDEV_SYNOPSYS_DWC2) || defined(MODULE_TINYUSB_DEVICE)
31 /* If the USB OTG peripheral is used, the USB clock of 48 MHz is derived by
32  * dividing the PLL clock by 1, 1.5, 2, or 2.5. That is the maximum core clock
33  * frequency can be 96 MHz. */
34 #define CLOCK_CORECLOCK MHZ(96)
35 #else
36 #define CLOCK_CORECLOCK MHZ(108)
37 #endif
38 
39 #define CLOCK_AHB CLOCK_CORECLOCK
40 #define CLOCK_APB1 CLOCK_AHB/2
41 #define CLOCK_APB2 CLOCK_AHB
47 #if CONFIG_BOARD_HAS_LXTAL
48 #define RTT_CLOCK_FREQUENCY (32768U)
49 #else
50 #define RTT_CLOCK_FREQUENCY (40000U)
51 #endif
52 
53 #define RTT_MAX_FREQUENCY (RTT_CLOCK_FREQUENCY) /* maximum RTT frequency in Hz */
54 
55 #ifndef RTT_FREQUENCY
56 #define RTT_FREQUENCY (RTT_MAX_FREQUENCY) /* RTT frequency in Hz */
57 #endif
60 #ifdef __cplusplus
61 }
62 #endif
63 
Unit helper macros.