Merge pull request #15706 from aabadie/pr/cpu/stm32_mco_kconfig
cpu/stm32: model MCO clock configuration in kconfig
This commit is contained in:
commit
131c0069d8
@ -5,6 +5,11 @@
|
|||||||
# directory for more details.
|
# directory for more details.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
config CLOCK_HAS_NO_MCO_PRE
|
||||||
|
bool
|
||||||
|
help
|
||||||
|
Indicates that the CPU has no MCO prescaler
|
||||||
|
|
||||||
menu "STM32 clock configuration"
|
menu "STM32 clock configuration"
|
||||||
depends on !CPU_FAM_F2 && !CPU_FAM_F4 && !CPU_FAM_F7
|
depends on !CPU_FAM_F2 && !CPU_FAM_F4 && !CPU_FAM_F7
|
||||||
|
|
||||||
@ -368,4 +373,86 @@ config CLOCK_APB2_DIV
|
|||||||
default 8 if CLOCK_APB2_DIV_8
|
default 8 if CLOCK_APB2_DIV_8
|
||||||
default 16 if CLOCK_APB2_DIV_16
|
default 16 if CLOCK_APB2_DIV_16
|
||||||
|
|
||||||
|
if CPU_FAM_F0 || CPU_FAM_F1 || CPU_FAM_F3 || CPU_FAM_G0 || CPU_FAM_G4 || CPU_FAM_L0 || CPU_FAM_L1 || CPU_FAM_L4 || CPU_FAM_WB
|
||||||
|
config CLOCK_ENABLE_MCO
|
||||||
|
bool "Enable MCU Clock Output (MCO) on PA8"
|
||||||
|
|
||||||
|
choice
|
||||||
|
bool "MCO source"
|
||||||
|
depends on CLOCK_ENABLE_MCO
|
||||||
|
default CLOCK_MCO_USE_PLLCLK
|
||||||
|
|
||||||
|
config CLOCK_MCO_USE_PLLCLK
|
||||||
|
bool "Use PLLCLK as MCO source"
|
||||||
|
|
||||||
|
config CLOCK_MCO_USE_HSE
|
||||||
|
bool "Use HSE as MCO source"
|
||||||
|
|
||||||
|
config CLOCK_MCO_USE_HSI
|
||||||
|
bool "Use HSI as MCO source"
|
||||||
|
|
||||||
|
config CLOCK_MCO_USE_LSE
|
||||||
|
bool "Use LSE as MCO source"
|
||||||
|
depends on CPU_FAM_G0 || CPU_FAM_G4 || CPU_FAM_L0 || CPU_FAM_L1 || CPU_FAM_L4 || CPU_FAM_WB
|
||||||
|
|
||||||
|
config CLOCK_MCO_USE_LSI
|
||||||
|
bool "Use LSI as MCO source"
|
||||||
|
depends on CPU_FAM_G0 || CPU_FAM_G4 || CPU_FAM_L0 || CPU_FAM_L1 || CPU_FAM_L4 || CPU_FAM_WB
|
||||||
|
|
||||||
|
config CLOCK_MCO_USE_MSI
|
||||||
|
bool "Use MSI as MCO source"
|
||||||
|
depends on CPU_FAM_L0 || CPU_FAM_L1 || CPU_FAM_L4 || CPU_FAM_WB
|
||||||
|
|
||||||
|
config CLOCK_MCO_USE_SYSCLK
|
||||||
|
bool "Use SYSCLK as MCO source"
|
||||||
|
|
||||||
|
endchoice
|
||||||
|
|
||||||
|
choice
|
||||||
|
bool "MCO prescaler"
|
||||||
|
depends on !CLOCK_HAS_NO_MCO_PRE && CLOCK_ENABLE_MCO
|
||||||
|
default CLOCK_MCO_PRE_1
|
||||||
|
|
||||||
|
config CLOCK_MCO_PRE_1
|
||||||
|
bool "Divide MCO by 1"
|
||||||
|
|
||||||
|
config CLOCK_MCO_PRE_2
|
||||||
|
bool "Divide MCO by 2"
|
||||||
|
|
||||||
|
config CLOCK_MCO_PRE_4
|
||||||
|
bool "Divide MCO by 4"
|
||||||
|
|
||||||
|
config CLOCK_MCO_PRE_8
|
||||||
|
bool "Divide MCO by 8"
|
||||||
|
|
||||||
|
config CLOCK_MCO_PRE_16
|
||||||
|
bool "Divide MCO by 16"
|
||||||
|
|
||||||
|
config CLOCK_MCO_PRE_32
|
||||||
|
bool "Divide MCO by 32"
|
||||||
|
depends on !CPU_FAM_G4 && !CPU_FAM_L0 && !CPU_FAM_L1 && !CPU_FAM_L4 && !CPU_FAM_WB
|
||||||
|
|
||||||
|
config CLOCK_MCO_PRE_64
|
||||||
|
bool "Divide MCO by 64"
|
||||||
|
depends on !CPU_FAM_G4 && !CPU_FAM_L0 && !CPU_FAM_L1 && !CPU_FAM_L4 && !CPU_FAM_WB
|
||||||
|
|
||||||
|
config CLOCK_MCO_PRE_128
|
||||||
|
bool "Divide MCO by 128"
|
||||||
|
depends on !CPU_FAM_G4 && !CPU_FAM_L0 && !CPU_FAM_L1 && !CPU_FAM_L4 && !CPU_FAM_WB
|
||||||
|
|
||||||
|
endchoice
|
||||||
|
|
||||||
|
config CLOCK_MCO_PRE
|
||||||
|
int
|
||||||
|
default 2 if CLOCK_MCO_PRE_2
|
||||||
|
default 4 if CLOCK_MCO_PRE_4
|
||||||
|
default 8 if CLOCK_MCO_PRE_8
|
||||||
|
default 16 if CLOCK_MCO_PRE_16
|
||||||
|
default 32 if CLOCK_MCO_PRE_32
|
||||||
|
default 64 if CLOCK_MCO_PRE_64
|
||||||
|
default 128 if CLOCK_MCO_PRE_128
|
||||||
|
default 1
|
||||||
|
|
||||||
|
endif # CPU_FAM_F0 || CPU_FAM_F1 || CPU_FAM_F3 || CPU_FAM_G0 || CPU_FAM_G4 || CPU_FAM_L0 || CPU_FAM_L1 || CPU_FAM_L4 || CPU_FAM_WB
|
||||||
|
|
||||||
endmenu
|
endmenu
|
||||||
|
|||||||
@ -17,6 +17,7 @@ config CPU_LINE_STM32F030X6
|
|||||||
config CPU_LINE_STM32F030X8
|
config CPU_LINE_STM32F030X8
|
||||||
bool
|
bool
|
||||||
select CPU_FAM_F0
|
select CPU_FAM_F0
|
||||||
|
select CLOCK_HAS_NO_MCO_PRE
|
||||||
|
|
||||||
config CPU_LINE_STM32F030XC
|
config CPU_LINE_STM32F030XC
|
||||||
bool
|
bool
|
||||||
@ -41,10 +42,12 @@ config CPU_LINE_STM32F048XX
|
|||||||
config CPU_LINE_STM32F051X8
|
config CPU_LINE_STM32F051X8
|
||||||
bool
|
bool
|
||||||
select CPU_FAM_F0
|
select CPU_FAM_F0
|
||||||
|
select CLOCK_HAS_NO_MCO_PRE
|
||||||
|
|
||||||
config CPU_LINE_STM32F058XX
|
config CPU_LINE_STM32F058XX
|
||||||
bool
|
bool
|
||||||
select CPU_FAM_F0
|
select CPU_FAM_F0
|
||||||
|
select CLOCK_HAS_NO_MCO_PRE
|
||||||
|
|
||||||
config CPU_LINE_STM32F070X6
|
config CPU_LINE_STM32F070X6
|
||||||
bool
|
bool
|
||||||
|
|||||||
@ -15,6 +15,7 @@ config CPU_FAM_F1
|
|||||||
select HAS_PERIPH_FLASHPAGE_RAW
|
select HAS_PERIPH_FLASHPAGE_RAW
|
||||||
select HAS_PERIPH_WDT
|
select HAS_PERIPH_WDT
|
||||||
select HAS_BOOTLOADER_STM32
|
select HAS_BOOTLOADER_STM32
|
||||||
|
select CLOCK_HAS_NO_MCO_PRE
|
||||||
|
|
||||||
config CPU_FAM
|
config CPU_FAM
|
||||||
default "f1" if CPU_FAM_F1
|
default "f1" if CPU_FAM_F1
|
||||||
|
|||||||
@ -21,6 +21,7 @@ config CPU_LINE_STM32F302X8
|
|||||||
config CPU_LINE_STM32F302XC
|
config CPU_LINE_STM32F302XC
|
||||||
bool
|
bool
|
||||||
select CPU_FAM_F3
|
select CPU_FAM_F3
|
||||||
|
select CLOCK_HAS_NO_MCO_PRE
|
||||||
|
|
||||||
config CPU_LINE_STM32F302XE
|
config CPU_LINE_STM32F302XE
|
||||||
bool
|
bool
|
||||||
@ -34,6 +35,7 @@ config CPU_LINE_STM32F303XC
|
|||||||
bool
|
bool
|
||||||
select CPU_FAM_F3
|
select CPU_FAM_F3
|
||||||
select HAS_CORTEXM_MPU
|
select HAS_CORTEXM_MPU
|
||||||
|
select CLOCK_HAS_NO_MCO_PRE
|
||||||
|
|
||||||
config CPU_LINE_STM32F303XE
|
config CPU_LINE_STM32F303XE
|
||||||
bool
|
bool
|
||||||
@ -55,14 +57,17 @@ config CPU_LINE_STM32F334X8
|
|||||||
config CPU_LINE_STM32F358XX
|
config CPU_LINE_STM32F358XX
|
||||||
bool
|
bool
|
||||||
select CPU_FAM_F3
|
select CPU_FAM_F3
|
||||||
|
select CLOCK_HAS_NO_MCO_PRE
|
||||||
|
|
||||||
config CPU_LINE_STM32F373XC
|
config CPU_LINE_STM32F373XC
|
||||||
bool
|
bool
|
||||||
select CPU_FAM_F3
|
select CPU_FAM_F3
|
||||||
|
select CLOCK_HAS_NO_MCO_PRE
|
||||||
|
|
||||||
config CPU_LINE_STM32F378XX
|
config CPU_LINE_STM32F378XX
|
||||||
bool
|
bool
|
||||||
select CPU_FAM_F3
|
select CPU_FAM_F3
|
||||||
|
select CLOCK_HAS_NO_MCO_PRE
|
||||||
|
|
||||||
config CPU_LINE_STM32F398XX
|
config CPU_LINE_STM32F398XX
|
||||||
bool
|
bool
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user