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:
Karl Palsson
2015-01-12 05:44:41 +01:00
parent 7ba1b57481
commit 5746fd4d25
11 changed files with 41 additions and 27 deletions

View File

@@ -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