diff --git a/boards/b-l072z-lrwan1/include/periph_conf.h b/boards/b-l072z-lrwan1/include/periph_conf.h index 3381fb6bd7..80d28470c4 100644 --- a/boards/b-l072z-lrwan1/include/periph_conf.h +++ b/boards/b-l072z-lrwan1/include/periph_conf.h @@ -25,7 +25,7 @@ #endif #include "periph_cpu.h" -#include "l0l1/cfg_clock_default.h" +#include "clk_conf.h" #include "cfg_rtt_default.h" #include "cfg_i2c1_pb8_pb9.h" #include "cfg_timer_tim2.h" diff --git a/boards/b-l475e-iot01a/include/periph_conf.h b/boards/b-l475e-iot01a/include/periph_conf.h index 46b8d94ba0..240653e38c 100644 --- a/boards/b-l475e-iot01a/include/periph_conf.h +++ b/boards/b-l475e-iot01a/include/periph_conf.h @@ -25,7 +25,7 @@ #endif #include "periph_cpu.h" -#include "l4/cfg_clock_default.h" +#include "clk_conf.h" #include "cfg_rtt_default.h" #ifdef __cplusplus diff --git a/boards/common/blxxxpill/include/periph_conf.h b/boards/common/blxxxpill/include/periph_conf.h index 9439892737..73069ec308 100644 --- a/boards/common/blxxxpill/include/periph_conf.h +++ b/boards/common/blxxxpill/include/periph_conf.h @@ -35,7 +35,7 @@ #endif #include "periph_cpu.h" -#include "f1f3/cfg_clock_default.h" +#include "clk_conf.h" #ifdef __cplusplus extern "C" { diff --git a/boards/common/iotlab/include/periph_conf_common.h b/boards/common/iotlab/include/periph_conf_common.h index 17c2edeeee..51af7f58d2 100644 --- a/boards/common/iotlab/include/periph_conf_common.h +++ b/boards/common/iotlab/include/periph_conf_common.h @@ -32,7 +32,7 @@ #define CLOCK_HSE MHZ(16) #include "periph_cpu.h" -#include "f1f3/cfg_clock_default.h" +#include "clk_conf.h" #ifdef __cplusplus extern "C" { diff --git a/boards/f4vi1/include/periph_conf.h b/boards/f4vi1/include/periph_conf.h index 94f327f0bb..4c30e43ed2 100644 --- a/boards/f4vi1/include/periph_conf.h +++ b/boards/f4vi1/include/periph_conf.h @@ -30,7 +30,7 @@ #define CLOCK_HSE MHZ(16) #include "periph_cpu.h" -#include "f2f4f7/cfg_clock_default_180.h" +#include "clk_conf.h" #ifdef __cplusplus extern "C" { diff --git a/boards/fox/include/periph_conf.h b/boards/fox/include/periph_conf.h index 1047e61a77..1dcb09590c 100644 --- a/boards/fox/include/periph_conf.h +++ b/boards/fox/include/periph_conf.h @@ -31,7 +31,7 @@ #define CLOCK_HSE MHZ(16) #include "periph_cpu.h" -#include "f1f3/cfg_clock_default.h" +#include "clk_conf.h" #ifdef __cplusplus extern "C" { diff --git a/boards/i-nucleo-lrwan1/include/periph_conf.h b/boards/i-nucleo-lrwan1/include/periph_conf.h index f97514f0f7..7d2d40f651 100644 --- a/boards/i-nucleo-lrwan1/include/periph_conf.h +++ b/boards/i-nucleo-lrwan1/include/periph_conf.h @@ -25,7 +25,7 @@ #endif #include "periph_cpu.h" -#include "l0l1/cfg_clock_default.h" +#include "clk_conf.h" #include "cfg_rtt_default.h" #include "cfg_timer_tim2.h" diff --git a/boards/im880b/include/periph_conf.h b/boards/im880b/include/periph_conf.h index d4e2bfc464..778a5b273b 100644 --- a/boards/im880b/include/periph_conf.h +++ b/boards/im880b/include/periph_conf.h @@ -27,7 +27,7 @@ #endif #include "periph_cpu.h" -#include "l0l1/cfg_clock_default.h" +#include "clk_conf.h" #ifdef __cplusplus extern "C" { diff --git a/boards/limifrog-v1/include/periph_conf.h b/boards/limifrog-v1/include/periph_conf.h index e919e4efe6..a3fdd27e8f 100644 --- a/boards/limifrog-v1/include/periph_conf.h +++ b/boards/limifrog-v1/include/periph_conf.h @@ -20,7 +20,7 @@ #define PERIPH_CONF_H #include "periph_cpu.h" -#include "l0l1/cfg_clock_default.h" +#include "clk_conf.h" #ifdef __cplusplus extern "C" { diff --git a/boards/lobaro-lorabox/include/periph_conf.h b/boards/lobaro-lorabox/include/periph_conf.h index 37aa291cc7..b9f06c8718 100644 --- a/boards/lobaro-lorabox/include/periph_conf.h +++ b/boards/lobaro-lorabox/include/periph_conf.h @@ -32,7 +32,7 @@ #endif #include "periph_cpu.h" -#include "l0l1/cfg_clock_default.h" +#include "clk_conf.h" #include "cfg_timer_tim2.h" #ifdef __cplusplus diff --git a/boards/lsn50/include/periph_conf.h b/boards/lsn50/include/periph_conf.h index 8caf9b212c..e6e6df7a17 100644 --- a/boards/lsn50/include/periph_conf.h +++ b/boards/lsn50/include/periph_conf.h @@ -25,7 +25,7 @@ #endif #include "periph_cpu.h" -#include "l0l1/cfg_clock_default.h" +#include "clk_conf.h" #include "cfg_rtt_default.h" #include "cfg_timer_tim2.h" diff --git a/boards/maple-mini/include/periph_conf.h b/boards/maple-mini/include/periph_conf.h index a278044de4..d642b103c6 100644 --- a/boards/maple-mini/include/periph_conf.h +++ b/boards/maple-mini/include/periph_conf.h @@ -20,7 +20,7 @@ #define PERIPH_CONF_H #include "periph_cpu.h" -#include "f1f3/cfg_clock_default.h" +#include "clk_conf.h" #ifdef __cplusplus extern "C" { diff --git a/boards/msbiot/include/periph_conf.h b/boards/msbiot/include/periph_conf.h index 86670a9e50..353d05ea72 100644 --- a/boards/msbiot/include/periph_conf.h +++ b/boards/msbiot/include/periph_conf.h @@ -28,7 +28,7 @@ #define CLOCK_HSE MHZ(16) #include "periph_cpu.h" -#include "f2f4f7/cfg_clock_default_180.h" +#include "clk_conf.h" #ifdef __cplusplus extern "C" { diff --git a/boards/nucleo-f103rb/include/periph_conf.h b/boards/nucleo-f103rb/include/periph_conf.h index 73765a9d74..c5db89ef2c 100644 --- a/boards/nucleo-f103rb/include/periph_conf.h +++ b/boards/nucleo-f103rb/include/periph_conf.h @@ -30,7 +30,7 @@ #endif #include "periph_cpu.h" -#include "f1f3/cfg_clock_default.h" +#include "clk_conf.h" #ifdef __cplusplus extern "C" { diff --git a/boards/nucleo-f207zg/include/periph_conf.h b/boards/nucleo-f207zg/include/periph_conf.h index ca1332c0e4..fe3ed343a9 100644 --- a/boards/nucleo-f207zg/include/periph_conf.h +++ b/boards/nucleo-f207zg/include/periph_conf.h @@ -32,7 +32,7 @@ #endif #include "periph_cpu.h" -#include "f2f4f7/cfg_clock_default_120.h" +#include "clk_conf.h" #include "cfg_i2c1_pb8_pb9.h" #include "cfg_usb_otg_fs.h" #include "mii.h" diff --git a/boards/nucleo-f302r8/include/periph_conf.h b/boards/nucleo-f302r8/include/periph_conf.h index 03b486231c..bf674de8f5 100644 --- a/boards/nucleo-f302r8/include/periph_conf.h +++ b/boards/nucleo-f302r8/include/periph_conf.h @@ -34,7 +34,7 @@ #endif #include "periph_cpu.h" -#include "f1f3/cfg_clock_default.h" +#include "clk_conf.h" #include "cfg_timer_tim2.h" #ifdef __cplusplus diff --git a/boards/nucleo-f303k8/include/periph_conf.h b/boards/nucleo-f303k8/include/periph_conf.h index 608ec4f06d..3fe6b20c1d 100644 --- a/boards/nucleo-f303k8/include/periph_conf.h +++ b/boards/nucleo-f303k8/include/periph_conf.h @@ -29,7 +29,7 @@ #endif #include "periph_cpu.h" -#include "f1f3/cfg_clock_default.h" +#include "clk_conf.h" #include "cfg_timer_tim2.h" #ifdef __cplusplus diff --git a/boards/nucleo-f303re/include/periph_conf.h b/boards/nucleo-f303re/include/periph_conf.h index 981a8b039b..7e9abb1663 100644 --- a/boards/nucleo-f303re/include/periph_conf.h +++ b/boards/nucleo-f303re/include/periph_conf.h @@ -32,7 +32,7 @@ #endif #include "periph_cpu.h" -#include "f1f3/cfg_clock_default.h" +#include "clk_conf.h" #include "cfg_timer_tim2.h" #ifdef __cplusplus diff --git a/boards/nucleo-f303ze/include/periph_conf.h b/boards/nucleo-f303ze/include/periph_conf.h index 26a145a62a..0b36610fe5 100644 --- a/boards/nucleo-f303ze/include/periph_conf.h +++ b/boards/nucleo-f303ze/include/periph_conf.h @@ -30,7 +30,7 @@ #endif #include "periph_cpu.h" -#include "f1f3/cfg_clock_default.h" +#include "clk_conf.h" #include "cfg_timer_tim2.h" #ifdef __cplusplus diff --git a/boards/nucleo-f334r8/include/periph_conf.h b/boards/nucleo-f334r8/include/periph_conf.h index 0064365d99..3beccc5c40 100644 --- a/boards/nucleo-f334r8/include/periph_conf.h +++ b/boards/nucleo-f334r8/include/periph_conf.h @@ -31,7 +31,7 @@ #endif #include "periph_cpu.h" -#include "f1f3/cfg_clock_default.h" +#include "clk_conf.h" #include "cfg_timer_tim2.h" #ifdef __cplusplus diff --git a/boards/nucleo-f401re/include/periph_conf.h b/boards/nucleo-f401re/include/periph_conf.h index 006e45f6ca..75144e4985 100644 --- a/boards/nucleo-f401re/include/periph_conf.h +++ b/boards/nucleo-f401re/include/periph_conf.h @@ -30,7 +30,7 @@ #endif #include "periph_cpu.h" -#include "f2f4f7/cfg_clock_default_84.h" +#include "clk_conf.h" #include "cfg_i2c1_pb8_pb9.h" #include "cfg_timer_tim5.h" diff --git a/boards/nucleo-f410rb/include/periph_conf.h b/boards/nucleo-f410rb/include/periph_conf.h index a7c14dddbe..4f532576ea 100644 --- a/boards/nucleo-f410rb/include/periph_conf.h +++ b/boards/nucleo-f410rb/include/periph_conf.h @@ -30,7 +30,7 @@ #endif #include "periph_cpu.h" -#include "f2f4f7/cfg_clock_default_100.h" +#include "clk_conf.h" #include "cfg_i2c1_pb8_pb9.h" #include "cfg_timer_tim5.h" diff --git a/boards/nucleo-f411re/include/periph_conf.h b/boards/nucleo-f411re/include/periph_conf.h index d693942cdb..c980f06345 100644 --- a/boards/nucleo-f411re/include/periph_conf.h +++ b/boards/nucleo-f411re/include/periph_conf.h @@ -30,7 +30,7 @@ #endif #include "periph_cpu.h" -#include "f2f4f7/cfg_clock_default_100.h" +#include "clk_conf.h" #include "cfg_i2c1_pb8_pb9.h" #include "cfg_timer_tim5.h" diff --git a/boards/nucleo-f412zg/include/periph_conf.h b/boards/nucleo-f412zg/include/periph_conf.h index 7de6fc99d8..295944522e 100644 --- a/boards/nucleo-f412zg/include/periph_conf.h +++ b/boards/nucleo-f412zg/include/periph_conf.h @@ -32,7 +32,7 @@ #endif #include "periph_cpu.h" -#include "f2f4f7/cfg_clock_default_100.h" +#include "clk_conf.h" #include "cfg_i2c1_pb8_pb9.h" #include "cfg_timer_tim5.h" #include "cfg_usb_otg_fs.h" diff --git a/boards/nucleo-f413zh/include/periph_conf.h b/boards/nucleo-f413zh/include/periph_conf.h index cd3516d6b1..f9ac88d1f2 100644 --- a/boards/nucleo-f413zh/include/periph_conf.h +++ b/boards/nucleo-f413zh/include/periph_conf.h @@ -32,7 +32,7 @@ #endif #include "periph_cpu.h" -#include "f2f4f7/cfg_clock_default_100.h" +#include "clk_conf.h" #include "cfg_i2c1_pb8_pb9.h" #include "cfg_rtt_default.h" #include "cfg_timer_tim5.h" diff --git a/boards/nucleo-f429zi/include/periph_conf.h b/boards/nucleo-f429zi/include/periph_conf.h index 1577dd4d7b..a63cec064e 100644 --- a/boards/nucleo-f429zi/include/periph_conf.h +++ b/boards/nucleo-f429zi/include/periph_conf.h @@ -30,7 +30,7 @@ #endif #include "periph_cpu.h" -#include "f2f4f7/cfg_clock_default_180.h" +#include "clk_conf.h" #include "cfg_i2c1_pb8_pb9.h" #include "cfg_timer_tim5.h" #include "cfg_usb_otg_fs.h" diff --git a/boards/nucleo-f446re/include/periph_conf.h b/boards/nucleo-f446re/include/periph_conf.h index b3877fad85..f6a3270e93 100644 --- a/boards/nucleo-f446re/include/periph_conf.h +++ b/boards/nucleo-f446re/include/periph_conf.h @@ -30,7 +30,7 @@ #endif #include "periph_cpu.h" -#include "f2f4f7/cfg_clock_default_180.h" +#include "clk_conf.h" #include "cfg_i2c1_pb8_pb9.h" #include "cfg_timer_tim5.h" diff --git a/boards/nucleo-f446ze/include/periph_conf.h b/boards/nucleo-f446ze/include/periph_conf.h index 13544fcbe6..c970b4cf51 100644 --- a/boards/nucleo-f446ze/include/periph_conf.h +++ b/boards/nucleo-f446ze/include/periph_conf.h @@ -30,7 +30,7 @@ #endif #include "periph_cpu.h" -#include "f2f4f7/cfg_clock_default_180.h" +#include "clk_conf.h" #include "cfg_i2c1_pb8_pb9.h" #include "cfg_timer_tim5.h" #include "cfg_usb_otg_fs.h" diff --git a/boards/nucleo-f767zi/include/periph_conf.h b/boards/nucleo-f767zi/include/periph_conf.h index 46e6347ee6..9f715925d0 100644 --- a/boards/nucleo-f767zi/include/periph_conf.h +++ b/boards/nucleo-f767zi/include/periph_conf.h @@ -30,7 +30,7 @@ #endif #include "periph_cpu.h" -#include "f2f4f7/cfg_clock_default_216.h" +#include "clk_conf.h" #include "cfg_i2c1_pb8_pb9.h" #include "cfg_rtt_default.h" #include "cfg_timer_tim2.h" diff --git a/boards/nucleo-g070rb/include/periph_conf.h b/boards/nucleo-g070rb/include/periph_conf.h index 8b9a172a82..a9227c1d3d 100644 --- a/boards/nucleo-g070rb/include/periph_conf.h +++ b/boards/nucleo-g070rb/include/periph_conf.h @@ -26,7 +26,7 @@ #define CONFIG_BOARD_HAS_LSE 1 #endif -#include "g0/cfg_clock_default.h" +#include "clk_conf.h" #include "cfg_i2c1_pb8_pb9.h" #include "cfg_rtt_default.h" diff --git a/boards/nucleo-g071rb/include/periph_conf.h b/boards/nucleo-g071rb/include/periph_conf.h index b506564604..2ed0679676 100644 --- a/boards/nucleo-g071rb/include/periph_conf.h +++ b/boards/nucleo-g071rb/include/periph_conf.h @@ -24,7 +24,7 @@ #define CONFIG_BOARD_HAS_LSE 1 #endif -#include "g0/cfg_clock_default.h" +#include "clk_conf.h" #include "cfg_i2c1_pb8_pb9.h" #include "cfg_rtt_default.h" diff --git a/boards/nucleo-g431rb/include/periph_conf.h b/boards/nucleo-g431rb/include/periph_conf.h index 752d9f9fca..885197de9a 100644 --- a/boards/nucleo-g431rb/include/periph_conf.h +++ b/boards/nucleo-g431rb/include/periph_conf.h @@ -33,7 +33,7 @@ #endif #include "periph_cpu.h" -#include "g4/cfg_clock_default.h" +#include "clk_conf.h" #include "cfg_i2c1_pb8_pb9.h" #include "cfg_rtt_default.h" #include "cfg_timer_tim2.h" diff --git a/boards/nucleo-g474re/include/periph_conf.h b/boards/nucleo-g474re/include/periph_conf.h index f291b9189e..6da93ad141 100644 --- a/boards/nucleo-g474re/include/periph_conf.h +++ b/boards/nucleo-g474re/include/periph_conf.h @@ -33,7 +33,7 @@ #endif #include "periph_cpu.h" -#include "g4/cfg_clock_default.h" +#include "clk_conf.h" #include "cfg_i2c1_pb8_pb9.h" #include "cfg_rtt_default.h" #include "cfg_timer_tim5.h" diff --git a/boards/nucleo-l011k4/include/periph_conf.h b/boards/nucleo-l011k4/include/periph_conf.h index 003b62d647..27282c674e 100644 --- a/boards/nucleo-l011k4/include/periph_conf.h +++ b/boards/nucleo-l011k4/include/periph_conf.h @@ -25,7 +25,7 @@ #endif #include "periph_cpu.h" -#include "l0l1/cfg_clock_default.h" +#include "clk_conf.h" #include "cfg_i2c1_pb6_pb7.h" #include "cfg_rtt_default.h" #include "cfg_timer_tim2.h" diff --git a/boards/nucleo-l031k6/include/periph_conf.h b/boards/nucleo-l031k6/include/periph_conf.h index b1acd433c2..e5b4f563bc 100644 --- a/boards/nucleo-l031k6/include/periph_conf.h +++ b/boards/nucleo-l031k6/include/periph_conf.h @@ -27,7 +27,7 @@ #endif #include "periph_cpu.h" -#include "l0l1/cfg_clock_default.h" +#include "clk_conf.h" #include "cfg_i2c1_pb6_pb7.h" #include "cfg_rtt_default.h" #include "cfg_timer_tim2.h" diff --git a/boards/nucleo-l053r8/include/periph_conf.h b/boards/nucleo-l053r8/include/periph_conf.h index 4960222fb9..a9fced3ce3 100644 --- a/boards/nucleo-l053r8/include/periph_conf.h +++ b/boards/nucleo-l053r8/include/periph_conf.h @@ -27,7 +27,7 @@ #endif #include "periph_cpu.h" -#include "l0l1/cfg_clock_default.h" +#include "clk_conf.h" #include "cfg_rtt_default.h" #include "cfg_timer_tim2.h" diff --git a/boards/nucleo-l073rz/include/periph_conf.h b/boards/nucleo-l073rz/include/periph_conf.h index 9a7a0918b4..54adcabf02 100644 --- a/boards/nucleo-l073rz/include/periph_conf.h +++ b/boards/nucleo-l073rz/include/periph_conf.h @@ -27,7 +27,7 @@ #endif #include "periph_cpu.h" -#include "l0l1/cfg_clock_default.h" +#include "clk_conf.h" #include "cfg_rtt_default.h" #include "cfg_timer_tim2.h" diff --git a/boards/nucleo-l152re/include/periph_conf.h b/boards/nucleo-l152re/include/periph_conf.h index c6e80c4dd8..1651fc5c58 100644 --- a/boards/nucleo-l152re/include/periph_conf.h +++ b/boards/nucleo-l152re/include/periph_conf.h @@ -21,7 +21,7 @@ #define PERIPH_CONF_H #include "periph_cpu.h" -#include "l0l1/cfg_clock_default.h" +#include "clk_conf.h" #include "cfg_timer_tim5.h" #ifdef __cplusplus diff --git a/boards/nucleo-l412kb/include/periph_conf.h b/boards/nucleo-l412kb/include/periph_conf.h index 59f7f4a1af..784edf00c3 100644 --- a/boards/nucleo-l412kb/include/periph_conf.h +++ b/boards/nucleo-l412kb/include/periph_conf.h @@ -29,7 +29,7 @@ #endif #include "periph_cpu.h" -#include "l4/cfg_clock_default.h" +#include "clk_conf.h" #include "cfg_i2c1_pb6_pb7.h" #include "cfg_timer_tim2.h" #include "cfg_rtt_default.h" diff --git a/boards/nucleo-l432kc/include/periph_conf.h b/boards/nucleo-l432kc/include/periph_conf.h index 341140dfd4..9b8c31022d 100644 --- a/boards/nucleo-l432kc/include/periph_conf.h +++ b/boards/nucleo-l432kc/include/periph_conf.h @@ -27,7 +27,7 @@ #endif #include "periph_cpu.h" -#include "l4/cfg_clock_default.h" +#include "clk_conf.h" #include "cfg_i2c1_pb6_pb7.h" #include "cfg_rtt_default.h" #include "cfg_timer_tim2.h" diff --git a/boards/nucleo-l433rc/include/periph_conf.h b/boards/nucleo-l433rc/include/periph_conf.h index 32ae46860a..6f818daf75 100644 --- a/boards/nucleo-l433rc/include/periph_conf.h +++ b/boards/nucleo-l433rc/include/periph_conf.h @@ -25,7 +25,7 @@ #endif #include "periph_cpu.h" -#include "l4/cfg_clock_default.h" +#include "clk_conf.h" #include "cfg_rtt_default.h" #include "cfg_timer_tim2.h" diff --git a/boards/nucleo-l452re/include/periph_conf.h b/boards/nucleo-l452re/include/periph_conf.h index 87e7883f39..b290c0c483 100644 --- a/boards/nucleo-l452re/include/periph_conf.h +++ b/boards/nucleo-l452re/include/periph_conf.h @@ -31,7 +31,7 @@ #endif #include "periph_cpu.h" -#include "l4/cfg_clock_default.h" +#include "clk_conf.h" #include "cfg_i2c1_pb8_pb9.h" #include "cfg_rtt_default.h" #include "cfg_timer_tim2.h" diff --git a/boards/nucleo-l476rg/include/periph_conf.h b/boards/nucleo-l476rg/include/periph_conf.h index 5efcf1d4e0..caec629346 100644 --- a/boards/nucleo-l476rg/include/periph_conf.h +++ b/boards/nucleo-l476rg/include/periph_conf.h @@ -29,7 +29,7 @@ #endif #include "periph_cpu.h" -#include "l4/cfg_clock_default.h" +#include "clk_conf.h" #include "cfg_i2c1_pb8_pb9.h" #include "cfg_rtt_default.h" diff --git a/boards/nucleo-l496zg/include/periph_conf.h b/boards/nucleo-l496zg/include/periph_conf.h index 990e12f5f5..ab0459a711 100644 --- a/boards/nucleo-l496zg/include/periph_conf.h +++ b/boards/nucleo-l496zg/include/periph_conf.h @@ -25,7 +25,7 @@ #endif #include "periph_cpu.h" -#include "l4/cfg_clock_default.h" +#include "clk_conf.h" #include "cfg_i2c1_pb8_pb9.h" #include "cfg_rtt_default.h" diff --git a/boards/nucleo-l4r5zi/include/periph_conf.h b/boards/nucleo-l4r5zi/include/periph_conf.h index d7f8ac8ed8..de1e1f49c7 100644 --- a/boards/nucleo-l4r5zi/include/periph_conf.h +++ b/boards/nucleo-l4r5zi/include/periph_conf.h @@ -19,11 +19,7 @@ #ifndef PERIPH_CONF_H #define PERIPH_CONF_H -#include "periph_cpu.h" - /* Add specific clock configuration (HSE, LSE) for this board here */ -#define CLOCK_CORECLOCK_MAX MHZ(120) - #ifndef CONFIG_BOARD_HAS_LSE #define CONFIG_BOARD_HAS_LSE 1 #endif @@ -32,7 +28,8 @@ #define CONFIG_CLOCK_PLL_N (30) #endif -#include "l4/cfg_clock_default.h" +#include "periph_cpu.h" +#include "clk_conf.h" #include "cfg_i2c1_pb8_pb9.h" #include "cfg_rtt_default.h" diff --git a/boards/nucleo-l552ze-q/include/periph_conf.h b/boards/nucleo-l552ze-q/include/periph_conf.h index 985c14a895..f2331145a8 100644 --- a/boards/nucleo-l552ze-q/include/periph_conf.h +++ b/boards/nucleo-l552ze-q/include/periph_conf.h @@ -20,9 +20,7 @@ #define PERIPH_CONF_H /* Add specific clock configuration (HSE, LSE) for this board here */ -#define CLOCK_CORECLOCK_MAX MHZ(110) - -/* Reach 108MHz by by default setting custom PLL_N factor */ +/* Reach 108MHz by default by setting custom PLL_N factor */ #ifndef CONFIG_CLOCK_PLL_N #define CONFIG_CLOCK_PLL_N 27 #endif @@ -33,7 +31,7 @@ #endif #include "periph_cpu.h" -#include "l4/cfg_clock_default.h" +#include "clk_conf.h" #include "cfg_i2c1_pb8_pb9.h" #include "cfg_rtt_default.h" #include "cfg_timer_tim5.h" diff --git a/boards/nz32-sc151/include/periph_conf.h b/boards/nz32-sc151/include/periph_conf.h index 26cc201308..d7b95d71a2 100644 --- a/boards/nz32-sc151/include/periph_conf.h +++ b/boards/nz32-sc151/include/periph_conf.h @@ -20,7 +20,7 @@ #define PERIPH_CONF_H #include "periph_cpu.h" -#include "l0l1/cfg_clock_default.h" +#include "clk_conf.h" #include "cfg_timer_tim5.h" #ifdef __cplusplus diff --git a/boards/olimexino-stm32/include/periph_conf.h b/boards/olimexino-stm32/include/periph_conf.h index f5bedeb1be..46688775d0 100644 --- a/boards/olimexino-stm32/include/periph_conf.h +++ b/boards/olimexino-stm32/include/periph_conf.h @@ -30,7 +30,7 @@ #endif #include "periph_cpu.h" -#include "f1f3/cfg_clock_default.h" +#include "clk_conf.h" #ifdef __cplusplus extern "C" { diff --git a/boards/opencm904/include/periph_conf.h b/boards/opencm904/include/periph_conf.h index f92aa4d10d..cc46f73bc9 100644 --- a/boards/opencm904/include/periph_conf.h +++ b/boards/opencm904/include/periph_conf.h @@ -25,7 +25,7 @@ #endif #include "periph_cpu.h" -#include "f1f3/cfg_clock_default.h" +#include "clk_conf.h" #ifdef __cplusplus extern "C" { diff --git a/boards/p-l496g-cell02/include/periph_conf.h b/boards/p-l496g-cell02/include/periph_conf.h index 9f5061acfc..1b2a0981e0 100644 --- a/boards/p-l496g-cell02/include/periph_conf.h +++ b/boards/p-l496g-cell02/include/periph_conf.h @@ -25,7 +25,7 @@ #endif #include "periph_cpu.h" -#include "l4/cfg_clock_default.h" +#include "clk_conf.h" #include "cfg_rtt_default.h" #include "cfg_timer_tim2.h" diff --git a/boards/p-nucleo-wb55/include/periph_conf.h b/boards/p-nucleo-wb55/include/periph_conf.h index 5cc010830a..dacc45b1c8 100644 --- a/boards/p-nucleo-wb55/include/periph_conf.h +++ b/boards/p-nucleo-wb55/include/periph_conf.h @@ -20,11 +20,7 @@ #ifndef PERIPH_CONF_H #define PERIPH_CONF_H -#include "periph_cpu.h" - /* Add specific clock configuration (HSE, LSE) for this board here */ -#define CLOCK_CORECLOCK_MAX MHZ(64) - #ifndef CONFIG_BOARD_HAS_LSE #define CONFIG_BOARD_HAS_LSE 1 #endif @@ -39,8 +35,8 @@ #define CLOCK_EXTAHB_DIV RCC_EXTCFGR_C2HPRE_3 #define CLOCK_EXTAHB (CLOCK_CORECLOCK / 2) -#include "l4/cfg_clock_default.h" - +#include "periph_cpu.h" +#include "clk_conf.h" #include "cfg_i2c1_pb8_pb9.h" #include "cfg_rtt_default.h" #include "cfg_timer_tim2.h" diff --git a/boards/pyboard/include/periph_conf.h b/boards/pyboard/include/periph_conf.h index cc0da38bb6..ec4cbc447f 100644 --- a/boards/pyboard/include/periph_conf.h +++ b/boards/pyboard/include/periph_conf.h @@ -35,7 +35,7 @@ #define CLOCK_HSE MHZ(12) #include "periph_cpu.h" -#include "f2f4f7/cfg_clock_default_180.h" +#include "clk_conf.h" #include "cfg_usb_otg_fs.h" #ifdef __cplusplus diff --git a/boards/spark-core/include/periph_conf.h b/boards/spark-core/include/periph_conf.h index a60f56052e..c697802656 100644 --- a/boards/spark-core/include/periph_conf.h +++ b/boards/spark-core/include/periph_conf.h @@ -20,7 +20,7 @@ #define PERIPH_CONF_H #include "periph_cpu.h" -#include "f1f3/cfg_clock_default.h" +#include "clk_conf.h" #ifdef __cplusplus extern "C" { diff --git a/boards/stm32f3discovery/include/periph_conf.h b/boards/stm32f3discovery/include/periph_conf.h index c794d365b0..8c480da712 100644 --- a/boards/stm32f3discovery/include/periph_conf.h +++ b/boards/stm32f3discovery/include/periph_conf.h @@ -25,7 +25,7 @@ #endif #include "periph_cpu.h" -#include "f1f3/cfg_clock_default.h" +#include "clk_conf.h" #ifdef __cplusplus extern "C" { diff --git a/boards/stm32f429i-disc1/include/periph_conf.h b/boards/stm32f429i-disc1/include/periph_conf.h index 091536431f..0e40a84a47 100644 --- a/boards/stm32f429i-disc1/include/periph_conf.h +++ b/boards/stm32f429i-disc1/include/periph_conf.h @@ -30,7 +30,7 @@ #endif #include "periph_cpu.h" -#include "f2f4f7/cfg_clock_default_180.h" +#include "clk_conf.h" #include "cfg_timer_tim5.h" #include "cfg_usb_otg_hs_fs.h" diff --git a/boards/stm32f4discovery/include/periph_conf.h b/boards/stm32f4discovery/include/periph_conf.h index 1a985fcbb3..db0295dd8c 100644 --- a/boards/stm32f4discovery/include/periph_conf.h +++ b/boards/stm32f4discovery/include/periph_conf.h @@ -26,7 +26,7 @@ #endif #include "periph_cpu.h" -#include "f2f4f7/cfg_clock_default_180.h" +#include "clk_conf.h" #include "cfg_usb_otg_fs.h" #ifdef __cplusplus diff --git a/boards/stm32l0538-disco/include/periph_conf.h b/boards/stm32l0538-disco/include/periph_conf.h index 0ca3b44a64..d71c85b863 100644 --- a/boards/stm32l0538-disco/include/periph_conf.h +++ b/boards/stm32l0538-disco/include/periph_conf.h @@ -20,7 +20,7 @@ #define PERIPH_CONF_H #include "periph_cpu.h" -#include "l0l1/cfg_clock_default.h" +#include "clk_conf.h" #ifdef __cplusplus extern "C" { diff --git a/boards/stm32l476g-disco/include/periph_conf.h b/boards/stm32l476g-disco/include/periph_conf.h index 54c5dfc100..2c78db5f8c 100644 --- a/boards/stm32l476g-disco/include/periph_conf.h +++ b/boards/stm32l476g-disco/include/periph_conf.h @@ -25,7 +25,7 @@ #endif #include "periph_cpu.h" -#include "l4/cfg_clock_default.h" +#include "clk_conf.h" #include "cfg_rtt_default.h" #ifdef __cplusplus diff --git a/boards/ublox-c030-u201/include/periph_conf.h b/boards/ublox-c030-u201/include/periph_conf.h index fe582f8b31..4a6c166510 100644 --- a/boards/ublox-c030-u201/include/periph_conf.h +++ b/boards/ublox-c030-u201/include/periph_conf.h @@ -33,7 +33,7 @@ #define CLOCK_HSE MHZ(12) #include "periph_cpu.h" -#include "f2f4f7/cfg_clock_default_180.h" +#include "clk_conf.h" #include "cfg_timer_tim5.h" #ifdef __cplusplus diff --git a/boards/weact-f411ce/include/periph_conf.h b/boards/weact-f411ce/include/periph_conf.h index 226c4b8bf1..ba066653fb 100644 --- a/boards/weact-f411ce/include/periph_conf.h +++ b/boards/weact-f411ce/include/periph_conf.h @@ -36,7 +36,7 @@ #define CLOCK_HSE MHZ(25) #include "periph_cpu.h" -#include "f2f4f7/cfg_clock_default_100.h" +#include "clk_conf.h" #include "cfg_i2c1_pb8_pb9.h" #include "cfg_timer_tim5.h" #include "cfg_usb_otg_fs.h" diff --git a/cpu/stm32/Makefile.include b/cpu/stm32/Makefile.include index b1532d538e..514f43a89e 100644 --- a/cpu/stm32/Makefile.include +++ b/cpu/stm32/Makefile.include @@ -84,4 +84,7 @@ $(STM32IRQS_INCLUDE_FILE): $(STM32FAM_INCLUDE_FILE) $(Q)$(RIOTBASE)/cpu/stm32/dist/irqs/gen_irqs.py $(CPU_FAM) endif +# Include clock configuration directory +INCLUDES += -I$(RIOTCPU)/stm32/include/clk + include $(RIOTMAKE)/arch/cortexm.inc.mk diff --git a/cpu/stm32/include/clk/clk_conf.h b/cpu/stm32/include/clk/clk_conf.h new file mode 100644 index 0000000000..797f00284f --- /dev/null +++ b/cpu/stm32/include/clk/clk_conf.h @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2020 Inria + * + * This file is subject to the terms and conditions of the GNU Lesser General + * Public License v2.1. See the file LICENSE in the top level directory for more + * details. + */ + +/** + * @ingroup cpu_stm32 + * @{ + * + * @file + * @brief Main header for STM32 clock configuration + * + * @author Alexandre Abadie +*/ + +#ifndef CLK_CLK_CONF_H +#define CLK_CLK_CONF_H + +#include "kernel_defines.h" +#include "macros/units.h" + +#if defined(CPU_FAM_STM32F0) +#include "f0/cfg_clock_default.h" +#elif defined(CPU_FAM_STM32F1) || defined(CPU_FAM_STM32F3) +#include "f1f3/cfg_clock_default.h" +#elif defined(CPU_FAM_STM32F2) || defined(CPU_FAM_STM32F4) || \ + defined(CPU_FAM_STM32F7) +#include "f2f4f7/cfg_clock_default.h" +#elif defined(CPU_FAM_STM32G0) +#include "g0/cfg_clock_default.h" +#elif defined(CPU_FAM_STM32G4) +#include "g4/cfg_clock_default.h" +#elif defined(CPU_FAM_STM32L0) || defined(CPU_FAM_STM32L1) +#include "l0l1/cfg_clock_default.h" +#elif defined(CPU_FAM_STM32L4) || defined(CPU_FAM_STM32L5) || \ + defined(CPU_FAM_STM32WB) +#include "l4l5wb/cfg_clock_default.h" +#else +#error "No clock configuration available" +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* CLK_CLK_CONF_H */ +/** @} */ diff --git a/boards/common/stm32/include/f0/cfg_clock_default.h b/cpu/stm32/include/clk/f0/cfg_clock_default.h similarity index 96% rename from boards/common/stm32/include/f0/cfg_clock_default.h rename to cpu/stm32/include/clk/f0/cfg_clock_default.h index 559484c5c4..f13ea8b0d7 100644 --- a/boards/common/stm32/include/f0/cfg_clock_default.h +++ b/cpu/stm32/include/clk/f0/cfg_clock_default.h @@ -7,7 +7,7 @@ */ /** - * @ingroup boards_common_stm32 + * @ingroup cpu_stm32 * @{ * * @file @@ -18,10 +18,8 @@ * @author Alexandre Abadie */ -#ifndef F0_CFG_CLOCK_DEFAULT_H -#define F0_CFG_CLOCK_DEFAULT_H - -#include "periph_cpu.h" +#ifndef CLK_F0_CFG_CLOCK_DEFAULT_H +#define CLK_F0_CFG_CLOCK_DEFAULT_H #ifdef __cplusplus extern "C" { @@ -134,5 +132,5 @@ extern "C" { } #endif -#endif /* F0_CFG_CLOCK_DEFAULT_H */ +#endif /* CLK_F0_CFG_CLOCK_DEFAULT_H */ /** @} */ diff --git a/boards/common/stm32/include/f1f3/cfg_clock_default.h b/cpu/stm32/include/clk/f1f3/cfg_clock_default.h similarity index 96% rename from boards/common/stm32/include/f1f3/cfg_clock_default.h rename to cpu/stm32/include/clk/f1f3/cfg_clock_default.h index edbd5cd814..25708941f5 100644 --- a/boards/common/stm32/include/f1f3/cfg_clock_default.h +++ b/cpu/stm32/include/clk/f1f3/cfg_clock_default.h @@ -9,7 +9,7 @@ */ /** - * @ingroup boards_common_stm32 + * @ingroup cpu_stm32 * @{ * * @file @@ -23,10 +23,8 @@ * */ -#ifndef F1F3_CFG_CLOCK_DEFAULT_H -#define F1F3_CFG_CLOCK_DEFAULT_H - -#include "periph_cpu.h" +#ifndef CLK_F1F3_CFG_CLOCK_DEFAULT_H +#define CLK_F1F3_CFG_CLOCK_DEFAULT_H #ifdef __cplusplus extern "C" { @@ -144,5 +142,5 @@ extern "C" { } #endif -#endif /* F1F3_CFG_CLOCK_DEFAULT_H */ +#endif /* CLK_F1F3_CFG_CLOCK_DEFAULT_H */ /** @} */ diff --git a/boards/common/stm32/include/f2f4f7/cfg_clock_common.h b/cpu/stm32/include/clk/f2f4f7/cfg_clock_common.h similarity index 93% rename from boards/common/stm32/include/f2f4f7/cfg_clock_common.h rename to cpu/stm32/include/clk/f2f4f7/cfg_clock_common.h index 6486059671..a7885d42d0 100644 --- a/boards/common/stm32/include/f2f4f7/cfg_clock_common.h +++ b/cpu/stm32/include/clk/f2f4f7/cfg_clock_common.h @@ -9,7 +9,7 @@ */ /** - * @ingroup boards_common_stm32 + * @ingroup cpu_stm32 * @{ * * @file @@ -20,8 +20,8 @@ * @author Alexandre Abadie */ -#ifndef F2F4F7_CFG_CLOCK_COMMON_H -#define F2F4F7_CFG_CLOCK_COMMON_H +#ifndef CLK_F2F4F7_CFG_CLOCK_COMMON_H +#define CLK_F2F4F7_CFG_CLOCK_COMMON_H #ifdef __cplusplus extern "C" { @@ -81,5 +81,5 @@ extern "C" { } #endif -#endif /* F2F4F7_CFG_CLOCK_COMMON_H */ +#endif /* CLK_F2F4F7_CFG_CLOCK_COMMON_H */ /** @} */ diff --git a/cpu/stm32/include/clk/f2f4f7/cfg_clock_default.h b/cpu/stm32/include/clk/f2f4f7/cfg_clock_default.h new file mode 100644 index 0000000000..cfe930b674 --- /dev/null +++ b/cpu/stm32/include/clk/f2f4f7/cfg_clock_default.h @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2020 Inria + * + * This file is subject to the terms and conditions of the GNU Lesser General + * Public License v2.1. See the file LICENSE in the top level directory for more + * details. + */ + +/** + * @ingroup cpu_stm32 + * @{ + * + * @file + * @brief Main header for STM32F2/F4/F7 clock configuration + * + * @author Alexandre Abadie +*/ + +#ifndef CLK_F2F4F7_CFG_CLOCK_DEFAULT_H +#define CLK_F2F4F7_CFG_CLOCK_DEFAULT_H + +#if defined(CPU_FAM_STM32F2) +#include "f2f4f7/cfg_clock_default_120.h" +#elif defined(CPU_FAM_STM32F4) +#if defined(CPU_LINE_STM32F401xC) || defined(CPU_LINE_STM32F401xE) +#include "f2f4f7/cfg_clock_default_84.h" +#elif defined(CPU_LINE_STM32F410Cx) || defined(CPU_LINE_STM32F410Rx) || \ + defined(CPU_LINE_STM32F410Tx) || defined(CPU_LINE_STM32F411xE) || \ + defined(CPU_LINE_STM32F412Cx) || defined(CPU_LINE_STM32F412Rx) || \ + defined(CPU_LINE_STM32F412Vx) || defined(CPU_LINE_STM32F412Zx) || \ + defined(CPU_LINE_STM32F413xx) || defined(CPU_LINE_STM32F423xx) +#include "f2f4f7/cfg_clock_default_100.h" +#elif defined(CPU_LINE_STM32F405xx) || defined(CPU_LINE_STM32F407xx) || \ + defined(CPU_LINE_STM32F415xx) || defined(CPU_LINE_STM32F417xx) || \ + defined(CPU_LINE_STM32F427xx) || defined(CPU_LINE_STM32F437xx) || \ + defined(CPU_LINE_STM32F429xx) || defined(CPU_LINE_STM32F439xx) || \ + defined(CPU_LINE_STM32F446xx) || defined(CPU_LINE_STM32F469xx) || \ + defined(CPU_LINE_STM32F479xx) +#include "f2f4f7/cfg_clock_default_180.h" +#else +#error "No clock configuration available for this F4 line" +#endif +#elif defined(CPU_FAM_STM32F7) +#include "f2f4f7/cfg_clock_default_216.h" +#else +#error "No clock configuration available for this family" +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* CLK_F2F4F7_CFG_CLOCK_DEFAULT_H */ +/** @} */ diff --git a/boards/common/stm32/include/f2f4f7/cfg_clock_default_100.h b/cpu/stm32/include/clk/f2f4f7/cfg_clock_default_100.h similarity index 94% rename from boards/common/stm32/include/f2f4f7/cfg_clock_default_100.h rename to cpu/stm32/include/clk/f2f4f7/cfg_clock_default_100.h index 802772b1ab..280f339dd9 100644 --- a/boards/common/stm32/include/f2f4f7/cfg_clock_default_100.h +++ b/cpu/stm32/include/clk/f2f4f7/cfg_clock_default_100.h @@ -9,7 +9,7 @@ */ /** - * @ingroup boards_common_stm32 + * @ingroup cpu_stm32 * @{ * * @file @@ -20,8 +20,8 @@ * @author Alexandre Abadie */ -#ifndef F2F4F7_CFG_CLOCK_DEFAULT_100_H -#define F2F4F7_CFG_CLOCK_DEFAULT_100_H +#ifndef CLK_F2F4F7_CFG_CLOCK_DEFAULT_100_H +#define CLK_F2F4F7_CFG_CLOCK_DEFAULT_100_H #include "f2f4f7/cfg_clock_common.h" @@ -96,5 +96,5 @@ extern "C" { #error "SYSCLK cannot exceed 100MHz" #endif -#endif /* F2F4F7_CFG_CLOCK_DEFAULT_100_H */ +#endif /* CLK_F2F4F7_CFG_CLOCK_DEFAULT_100_H */ /** @} */ diff --git a/boards/common/stm32/include/f2f4f7/cfg_clock_default_120.h b/cpu/stm32/include/clk/f2f4f7/cfg_clock_default_120.h similarity index 91% rename from boards/common/stm32/include/f2f4f7/cfg_clock_default_120.h rename to cpu/stm32/include/clk/f2f4f7/cfg_clock_default_120.h index e6ebca2432..ed115cbd00 100644 --- a/boards/common/stm32/include/f2f4f7/cfg_clock_default_120.h +++ b/cpu/stm32/include/clk/f2f4f7/cfg_clock_default_120.h @@ -9,7 +9,7 @@ */ /** - * @ingroup boards_common_stm32 + * @ingroup cpu_stm32 * @{ * * @file @@ -20,8 +20,8 @@ * @author Alexandre Abadie */ -#ifndef F2F4F7_CFG_CLOCK_DEFAULT_120_H -#define F2F4F7_CFG_CLOCK_DEFAULT_120_H +#ifndef CLK_F2F4F7_CFG_CLOCK_DEFAULT_120_H +#define CLK_F2F4F7_CFG_CLOCK_DEFAULT_120_H #include "f2f4f7/cfg_clock_common.h" @@ -74,5 +74,5 @@ extern "C" { #error "SYSCLK cannot exceed 120MHz" #endif -#endif /* F2F4F7_CFG_CLOCK_DEFAULT_120_H */ +#endif /* CLK_F2F4F7_CFG_CLOCK_DEFAULT_120_H */ /** @} */ diff --git a/boards/common/stm32/include/f2f4f7/cfg_clock_default_180.h b/cpu/stm32/include/clk/f2f4f7/cfg_clock_default_180.h similarity index 95% rename from boards/common/stm32/include/f2f4f7/cfg_clock_default_180.h rename to cpu/stm32/include/clk/f2f4f7/cfg_clock_default_180.h index 09d0653d4e..f7191bd969 100644 --- a/boards/common/stm32/include/f2f4f7/cfg_clock_default_180.h +++ b/cpu/stm32/include/clk/f2f4f7/cfg_clock_default_180.h @@ -9,7 +9,7 @@ */ /** - * @ingroup boards_common_stm32 + * @ingroup cpu_stm32 * @{ * * @file @@ -20,8 +20,8 @@ * @author Alexandre Abadie */ -#ifndef F2F4F7_CFG_CLOCK_DEFAULT_180_H -#define F2F4F7_CFG_CLOCK_DEFAULT_180_H +#ifndef CLK_F2F4F7_CFG_CLOCK_DEFAULT_180_H +#define CLK_F2F4F7_CFG_CLOCK_DEFAULT_180_H #include "f2f4f7/cfg_clock_common.h" @@ -108,5 +108,5 @@ extern "C" { #error "SYSCLK cannot exceed 180MHz" #endif -#endif /* F2F4F7_CFG_CLOCK_DEFAULT_180_H */ +#endif /* CLK_F2F4F7_CFG_CLOCK_DEFAULT_180_H */ /** @} */ diff --git a/boards/common/stm32/include/f2f4f7/cfg_clock_default_216.h b/cpu/stm32/include/clk/f2f4f7/cfg_clock_default_216.h similarity index 92% rename from boards/common/stm32/include/f2f4f7/cfg_clock_default_216.h rename to cpu/stm32/include/clk/f2f4f7/cfg_clock_default_216.h index 09b25bc966..075f1d6f42 100644 --- a/boards/common/stm32/include/f2f4f7/cfg_clock_default_216.h +++ b/cpu/stm32/include/clk/f2f4f7/cfg_clock_default_216.h @@ -9,7 +9,7 @@ */ /** - * @ingroup boards_common_stm32 + * @ingroup cpu_stm32 * @{ * * @file @@ -20,8 +20,8 @@ * @author Alexandre Abadie */ -#ifndef F2F4F7_CFG_CLOCK_DEFAULT_216_H -#define F2F4F7_CFG_CLOCK_DEFAULT_216_H +#ifndef CLK_F2F4F7_CFG_CLOCK_DEFAULT_216_H +#define CLK_F2F4F7_CFG_CLOCK_DEFAULT_216_H #include "f2f4f7/cfg_clock_common.h" @@ -83,5 +83,5 @@ extern "C" { #error "SYSCLK cannot exceed 216MHz" #endif -#endif /* F2F4F7_CFG_CLOCK_DEFAULT_216_H */ +#endif /* CLK_F2F4F7_CFG_CLOCK_DEFAULT_216_H */ /** @} */ diff --git a/boards/common/stm32/include/f2f4f7/cfg_clock_default_84.h b/cpu/stm32/include/clk/f2f4f7/cfg_clock_default_84.h similarity index 91% rename from boards/common/stm32/include/f2f4f7/cfg_clock_default_84.h rename to cpu/stm32/include/clk/f2f4f7/cfg_clock_default_84.h index e28c004277..c38f4ccbf3 100644 --- a/boards/common/stm32/include/f2f4f7/cfg_clock_default_84.h +++ b/cpu/stm32/include/clk/f2f4f7/cfg_clock_default_84.h @@ -9,7 +9,7 @@ */ /** - * @ingroup boards_common_stm32 + * @ingroup cpu_stm32 * @{ * * @file @@ -20,8 +20,8 @@ * @author Alexandre Abadie */ -#ifndef F2F4F7_CFG_CLOCK_DEFAULT_84_H -#define F2F4F7_CFG_CLOCK_DEFAULT_84_H +#ifndef CLK_F2F4F7_CFG_CLOCK_DEFAULT_84_H +#define CLK_F2F4F7_CFG_CLOCK_DEFAULT_84_H #include "f2f4f7/cfg_clock_common.h" @@ -77,5 +77,5 @@ extern "C" { #error "SYSCLK cannot exceed 84MHz" #endif -#endif /* F2F4F7_CFG_CLOCK_DEFAULT_84_H */ +#endif /* CLK_F2F4F7_CFG_CLOCK_DEFAULT_84_H */ /** @} */ diff --git a/boards/common/stm32/include/f2f4f7/cfg_clock_values.h b/cpu/stm32/include/clk/f2f4f7/cfg_clock_values.h similarity index 92% rename from boards/common/stm32/include/f2f4f7/cfg_clock_values.h rename to cpu/stm32/include/clk/f2f4f7/cfg_clock_values.h index aa3fcc74bf..5795212912 100644 --- a/boards/common/stm32/include/f2f4f7/cfg_clock_values.h +++ b/cpu/stm32/include/clk/f2f4f7/cfg_clock_values.h @@ -9,7 +9,7 @@ */ /** - * @ingroup boards_common_stm32 + * @ingroup cpu_stm32 * @{ * * @file @@ -20,8 +20,8 @@ * @author Alexandre Abadie */ -#ifndef F2F4F7_CFG_CLOCK_VALUES_H -#define F2F4F7_CFG_CLOCK_VALUES_H +#ifndef CLK_F2F4F7_CFG_CLOCK_VALUES_H +#define CLK_F2F4F7_CFG_CLOCK_VALUES_H #ifdef __cplusplus extern "C" { @@ -62,5 +62,5 @@ extern "C" { } #endif -#endif /* F2F4F7_CFG_CLOCK_VALUES_H */ +#endif /* CLK_F2F4F7_CFG_CLOCK_VALUES_H */ /** @} */ diff --git a/boards/common/stm32/include/g0/cfg_clock_default.h b/cpu/stm32/include/clk/g0/cfg_clock_default.h similarity index 95% rename from boards/common/stm32/include/g0/cfg_clock_default.h rename to cpu/stm32/include/clk/g0/cfg_clock_default.h index c0833dbe42..6f8b34d817 100644 --- a/boards/common/stm32/include/g0/cfg_clock_default.h +++ b/cpu/stm32/include/clk/g0/cfg_clock_default.h @@ -7,7 +7,7 @@ */ /** - * @ingroup boards_common_stm32 + * @ingroup cpu_stm32 * @{ * * @file @@ -20,10 +20,8 @@ * @author Alexandre Abadie */ -#ifndef G0_CFG_CLOCK_DEFAULT_H -#define G0_CFG_CLOCK_DEFAULT_H - -#include "periph_cpu.h" +#ifndef CLK_G0_CFG_CLOCK_DEFAULT_H +#define CLK_G0_CFG_CLOCK_DEFAULT_H #ifdef __cplusplus extern "C" { @@ -133,5 +131,5 @@ extern "C" { } #endif -#endif /* G0_CFG_CLOCK_DEFAULT_H */ +#endif /* CLK_G0_CFG_CLOCK_DEFAULT_H */ /** @} */ diff --git a/boards/common/stm32/include/g4/cfg_clock_default.h b/cpu/stm32/include/clk/g4/cfg_clock_default.h similarity index 95% rename from boards/common/stm32/include/g4/cfg_clock_default.h rename to cpu/stm32/include/clk/g4/cfg_clock_default.h index b9b2fa395c..95b043607d 100644 --- a/boards/common/stm32/include/g4/cfg_clock_default.h +++ b/cpu/stm32/include/clk/g4/cfg_clock_default.h @@ -7,7 +7,7 @@ */ /** - * @ingroup boards_common_stm32 + * @ingroup cpu_stm32 * @{ * * @file @@ -16,10 +16,8 @@ * @author Alexandre Abadie */ -#ifndef G4_CFG_CLOCK_DEFAULT_H -#define G4_CFG_CLOCK_DEFAULT_H - -#include "periph_cpu.h" +#ifndef CLK_G4_CFG_CLOCK_DEFAULT_H +#define CLK_G4_CFG_CLOCK_DEFAULT_H #ifdef __cplusplus extern "C" { @@ -125,5 +123,5 @@ extern "C" { } #endif -#endif /* G4_CFG_CLOCK_DEFAULT_H */ +#endif /* CLK_G4_CFG_CLOCK_DEFAULT_H */ /** @} */ diff --git a/boards/common/stm32/include/l0l1/cfg_clock_default.h b/cpu/stm32/include/clk/l0l1/cfg_clock_default.h similarity index 97% rename from boards/common/stm32/include/l0l1/cfg_clock_default.h rename to cpu/stm32/include/clk/l0l1/cfg_clock_default.h index bd9bc64d3f..e0884fe24a 100644 --- a/boards/common/stm32/include/l0l1/cfg_clock_default.h +++ b/cpu/stm32/include/clk/l0l1/cfg_clock_default.h @@ -7,7 +7,7 @@ */ /** - * @ingroup boards_common_stm32 + * @ingroup cpu_stm32 * @{ * * @file @@ -16,8 +16,8 @@ * @author Alexandre Abadie */ -#ifndef L0L1_CFG_CLOCK_DEFAULT_H -#define L0L1_CFG_CLOCK_DEFAULT_H +#ifndef CLK_L0L1_CFG_CLOCK_DEFAULT_H +#define CLK_L0L1_CFG_CLOCK_DEFAULT_H #include "periph_cpu.h" @@ -156,5 +156,5 @@ extern "C" { } #endif -#endif /* L0L1_CFG_CLOCK_DEFAULT_H */ +#endif /* CLK_L0L1_CFG_CLOCK_DEFAULT_H */ /** @} */ diff --git a/boards/common/stm32/include/l4/cfg_clock_default.h b/cpu/stm32/include/clk/l4l5wb/cfg_clock_default.h similarity index 89% rename from boards/common/stm32/include/l4/cfg_clock_default.h rename to cpu/stm32/include/clk/l4l5wb/cfg_clock_default.h index f243860895..a403958143 100644 --- a/boards/common/stm32/include/l4/cfg_clock_default.h +++ b/cpu/stm32/include/clk/l4l5wb/cfg_clock_default.h @@ -8,7 +8,7 @@ */ /** - * @ingroup boards_common_stm32 + * @ingroup cpu_stm32 * @{ * * @file @@ -18,10 +18,8 @@ * @author Alexandre Abadie */ -#ifndef L4_CFG_CLOCK_DEFAULT_H -#define L4_CFG_CLOCK_DEFAULT_H - -#include "periph_cpu.h" +#ifndef CLK_L4L5WB_CFG_CLOCK_DEFAULT_H +#define CLK_L4L5WB_CFG_CLOCK_DEFAULT_H #ifdef __cplusplus extern "C" { @@ -169,9 +167,22 @@ extern "C" { */ #define CLOCK_CORECLOCK \ ((CLOCK_PLL_SRC / CONFIG_CLOCK_PLL_M) * CONFIG_CLOCK_PLL_N) / CONFIG_CLOCK_PLL_R -#ifndef CLOCK_CORECLOCK_MAX + +/* Set max allowed sysclk */ +#if defined(CPU_FAM_STM32WB) +#define CLOCK_CORECLOCK_MAX MHZ(64) +#elif defined(CPU_FAM_STM32L5) +#define CLOCK_CORECLOCK_MAX MHZ(110) +#elif defined(CPU_LINE_STM32L4A6xx) || defined(CPU_LINE_STM32L4P5xx) || \ + defined(CPU_LINE_STM32L4Q5xx) || defined(CPU_LINE_STM32L4R5xx) || \ + defined(CPU_LINE_STM32L4R7xx) || defined(CPU_LINE_STM32L4R9xx) || \ + defined(CPU_LINE_STM32L4S5xx) || defined(CPU_LINE_STM32L4S7xx) || \ + defined(CPU_LINE_STM32L4S9xx) +#define CLOCK_CORECLOCK_MAX MHZ(120) +#else /* all the other L4 */ #define CLOCK_CORECLOCK_MAX MHZ(80) #endif + #if CLOCK_CORECLOCK > CLOCK_CORECLOCK_MAX #if CLOCK_CORECLOCK_MAX == MHZ(64) #error "SYSCLK cannot exceed 64MHz" @@ -202,5 +213,5 @@ extern "C" { } #endif -#endif /* L4_CFG_CLOCK_DEFAULT_H */ +#endif /* CLK_L4L5WB_CFG_CLOCK_DEFAULT_H */ /** @} */