21 Commits

Author SHA1 Message Date
Karl Palsson
c9c5cb7c9c style: fix some of the easier style bugs
No real changes.
2017-03-30 21:48:07 +00:00
Karl Palsson
08aac020ad stm32: rcc: provide async routines for osc checks
Start providing async routines for all blocking routines, to make it
easier to use libopencm3 in some RTOS environments.  This is not in
anyway intended to be complete, this just covers a single blocking
routine, rcc_wait_for_osc_ready.  Documentation added to the top level,
and provided for all stm32 families.
2016-08-18 23:41:04 +00:00
Karl Palsson
492a943b7e stm32f0: rcc: No APB1, and no restrictions on APB speed
Improperly copied from F1 code.

Fixes github issue #636
2016-03-15 23:23:56 +00:00
Karl Palsson
3a7cbec776 stm32l/stm32f: name space standardization [BREAKING]
As done by esden for the F4, remove typedefs and add prefixes to clock enums
This extends this to all stm32 families.

    Let's not hide the fact that these variables are structs/enums.

    We are filling up the namespace badly enough, we should be prefixing as
    much as we can with the module names at least. As users we already run
    often enough in namespace colisions we don't have to make it worse.

    * CLOCK_3V3_xxx enums renamed to RCC_CLOCK_3V3_xxx
    * clock enums (PLL, HSI, HSE ...) prefixed with RCC_
    * scale enum of pwr module prefixed with PWR_
2015-12-14 23:26:42 +01:00
Piotr Esden-Tempski
b1049f9a6f [Style] Stylefix sweep over the whole codebase. 2015-12-14 22:57:15 +01:00
Karl Palsson
fd100ea6c2 stm32f0: rcc: doxygen update prediv
After adding support to the f3, add missing doxygen support to the f0
equivalent.  This improves things and keeps them consistent until/if they are
pulled out as common code.
2015-11-08 15:36:32 +00:00
Karl Palsson
7063e5cdc9 stm32f0: rcc: properly set USB clock source
Missing breaks in switch statement.

Fixes Github issue #524
2015-09-05 16:12:39 +00:00
Karl Palsson
5746fd4d25 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.
2015-04-29 01:22:27 +00:00
Karl Palsson
f473d40038 stm32f0: check correct registers for ready flags
F0 should check the oscillator ready bits in the regular registers, just
like the docs claim, and just like every other stm32, rather than trying
to check for the interrupt flags.

Reported-by: n1b on irc
Signed-off-by: Karl Palsson <karlp@tweak.net.au>
2015-04-21 17:24:23 +00:00
Daniel Serpell
ca41131f97 stm32: f0: Fixes setting of PLL multiplication factor
Really use RCC_CFGR_PLLMUL negated as a mask.

Signed-off-by: Daniel Serpell <daniel.serpell@gmail.com>
2015-01-12 22:44:03 -03:00
Kuldeep Singh Dhaka
342ec6e9e3 [STM32F0] Add support functions for USB clock setup in F072 chips.
There is remaining an issue with PREDIV connected just after clock multiplexer (only F072). This should be fixed in another commit.
2014-12-18 23:43:04 +01:00
Chuck McManis
9ddfcb0e53 Rename rcc_ppre1_frequency and rcc_ppre2_frequency
Rename rcc_ppre1_frequency and rcc_ppre2_frequency to rcc_apb1_frequency and rcc_apb2_frequency
Also add rcc_ahb_frequency (although it is not set correctly in all cases) which will be fixed by
the rcc commits later. Also fixup the only use in the library of these variables, the USART code.

And fix the typos that resulted
Make l1 generic too
2014-12-13 19:49:04 -08:00
Chuck McManis
99f83eedcd stm32/f0: rcc.c Use common version instead of duplicate code.
Pulls out duplicate calls from f0/rcc.c and uses the common version which
also means that f0 can use rcc_peripheral_enable() now which is in common
but not the old rcc versions.
2014-12-03 11:14:26 +00:00
Frantisek Burian
55750d5dc6 [F0] Updated RCC module to be compatible wih RM0091 Rev. 5 2014-02-07 07:46:53 +01:00
Frantisek Burian
8d5ad52e0f Fix the stm32f0 evident bugs 2014-02-06 11:23:01 +01:00
Piotr Esden-Tempski
a909b5ca9e [Style] Global style fix run. 2014-01-03 01:07:30 +01:00
Onno Kortmann
fe6b542357 STM32F0: Correctly clear pll source bits. 2013-12-16 19:42:21 +00:00
Onno Kortmann
f622437cfb STM32F0: Fix PLL multiplication factor for 48MHz setup
It was set to overclocking configuration!
2013-12-16 19:37:07 +00:00
Onno Kortmann
868d65d872 STM32F0: Turn on PLL clock source when asked to
The STM32F05xxx/06xxx manual describes on p.98 (Sec 7.4.1) the RCC_CR
register, on which it says that bit 24 is the PLLON bit which has to be
enabled before using the PLL. This causes the PLL to be enabled with
rcc_osc_on(PLL).
2013-12-16 19:37:06 +00:00
BuFran
81982916e2 [Doxygen] Add complete documentation page to STM32F0 2013-08-22 17:18:42 -07:00
BuFran
18c4d299c1 [STM32F0] Add preliminary support for the family 2013-08-22 17:18:35 -07:00