stm32f3: rcc: Add pll source prediv support

Based on the f0 support, which has identical functionality, but with doxygen
added.  Bits renamed as they are only HSE prediv on some targets, and makes
things more consistent with the f0.

Fixes part of github issue #560
This commit is contained in:
Karl Palsson
2015-11-04 22:04:33 +00:00
parent 489dc5125e
commit a444aa4476
2 changed files with 32 additions and 19 deletions

View File

@@ -365,6 +365,16 @@ void rcc_set_hpre(uint32_t hpre)
RCC_CFGR = (reg32 | (hpre << RCC_CFGR_HPRE_SHIFT));
}
/**
* Set PLL Source pre-divider **CAUTION**.
* On some F3 devices, prediv only applies to HSE source. On others,
* this is _after_ source selection. See also f0.
* @param[in] prediv division by prediv+1 @ref rcc_cfgr2_prediv
*/
void rcc_set_prediv(uint32_t prediv)
{
RCC_CFGR2 = (RCC_CFGR2 & ~RCC_CFGR2_PREDIV) | prediv;
}
void rcc_set_pll_multiplier(uint32_t pll)
{