stm32: common: Extract MCO source setting
This adds MCO source selection to some targets, and removes and standardizes the mask/shift usage for all targets. For devices that support MCO2, this supports only MCO1. No attempt has been made to extract MCO prescaler, which is not available on all F1 and F3.
This commit is contained in:
@@ -119,6 +119,8 @@
|
||||
#define RCC_CFGR_MCOPRE_DIV4 2
|
||||
#define RCC_CFGR_MCOPRE_DIV8 3
|
||||
#define RCC_CFGR_MCOPRE_DIV16 4
|
||||
#define RCC_CFGR_MCOPRE_SHIFT 28
|
||||
#define RCC_CFGR_MCOPRE (0x7 << RCC_CFGR_MCOPRE_SHIFT)
|
||||
|
||||
/* MCO: Microcontroller clock output */
|
||||
#define RCC_CFGR_MCO_NOCLK 0x0
|
||||
@@ -129,6 +131,8 @@
|
||||
#define RCC_CFGR_MCO_PLLCLK 0x5
|
||||
#define RCC_CFGR_MCO_LSICLK 0x6
|
||||
#define RCC_CFGR_MCO_LSECLK 0x7
|
||||
#define RCC_CFGR_MCO_SHIFT 24
|
||||
#define RCC_CFGR_MCO_MASK 0x7
|
||||
|
||||
/* PLL Output division selection */
|
||||
#define RCC_CFGR_PLLDIV_DIV2 0x1
|
||||
|
||||
Reference in New Issue
Block a user