aboutsummaryrefslogtreecommitdiffstats
path: root/libmaple/stm32f1/include/series/rcc.h
Commit message (Collapse)AuthorAgeFilesLines
* Sort the rcc_clk_id enumerators semi-alphabetically.Marti Bolivar2012-06-021-27/+27
| | | | | | | | | | | | | | | | Only semi-alphabetically because peripherals are kept together (so the UARTs sort as if they were USARTs). Advantages: - It lets us play numeric comparison and lookup-table hacks, as we now have the property that the rcc_clk_ids for a given peripheral are a contiguous range of integers. - It will hopefully let the compiler emit faster/smaller code for switches over a dev->clk_id. - It's better intuitively. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
* series/rcc.h: Lose BIT().Marti Bolivar2012-05-311-132/+142
| | | | Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
* stm32f1/rcc.h: Add a FIXME.Marti Bolivar2012-05-311-0/+2
| | | | | | Having a separate struct is stupid. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
* RCC: DoxygenMarti Bolivar2012-05-311-45/+43
| | | | | | | Various changes to Doxygen structure, to help leaflabs-docs make sense of everything. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
* Fix a bunch of Doxygen file-level comments.Marti Bolivar2012-05-081-2/+2
| | | | | | | | | | | | | Fix @file in many places. Also fix up the descriptions where it's appropriate. This standardizes the @file formatting across the library to explicitly include any parent directories up to the repository root. Besides being nice, this will hopefully let us manage Doxygen's XML output so as to make extracting series-specific pieces via Breathe in the leaflabs-docs repo possible. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
* Don't conditionally compile rcc_clk_id or nvic_irq_num enumerators.Marti Bolivar2012-04-111-4/+0
| | | | | | | | | | Whether or not a given peripheral is present on an F1 series MCU doesn't matter. It doesn't take up any extra space to include these enumerators, and it's convenient to have them defined so portable libmaple routines can safely refer to them. This can prevent the need for special series-specific versions of some functions. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
* Deprecate rcc_clk_init().Marti Bolivar2012-04-111-4/+3
| | | | | | | | | | | | This function has been with us from the earliest days of libmaple. It's showing its age, as the API it presents is tied to the STM32F1. Deprecate it, and provide instructions for how to use newer, more portable APIs. The new way is more verbose, but we can always add a portable "just set up the PLL, dammit" convenience function later (a nice candidate is to extract an interface from setup_clocks() in boards.cpp). Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
* RCC: Add new mechanism for configuring the main PLL.Marti Bolivar2012-04-111-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new style for configuring the PLL is to initialize a (series-specific) struct rcc_pll_cfg, and pass a pointer to it to rcc_configure_pll(). After that's done, you can use rcc_turn_on_clk(RCC_CLK_PLL) to turn on the main PLL, and busy-wait until rcc_is_clk_ready(RCC_CLK_PLL) is true to make sure the new configuration took effect. - libmaple/rcc.h: -- Add struct rcc_pll_cfg, which specifies a PLL configuration. This specifies a PLL source and a void pointer to series-specific PLL configuration data. -- Add rcc_configure_pll(), which takes a pointer to struct rcc_pll_cfg, and configures the main PLL. It's up to each series to define this function. - stm32f1/rcc.h: Add struct stm32f1_rcc_pll_data, to store F1-specific PLL configuration state. - stm32f1/rcc.c: Add an implementation for rcc_configure_pll(). - stm32f2/rcc.h: Add struct stm32f2_rcc_pll_data, to store F2-specific PLL configuration data. - stm32f2/rcc.c: Add an implementation for rcc_configure_pll(). Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
* stm32f1/rcc.h: Deprecate rcc_clk_init().Marti Bolivar2012-04-111-0/+1
| | | | | | We're going to replace this with a more portable mechanism. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
* RCC: Clean up and sanitize interfaces across F1, F2 series.Marti Bolivar2012-04-111-1/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Additions: - rcc_switch_sysclk(): For changing the clock used as SYSCLK's source. - enum rcc_clk: One for each system and secondary clock source (e.g. HSE, LSE). These are defined on a per-series basis in each of the <series/rcc.h>. - rcc_turn_on_clk(), rcc_turn_off_clk(), rcc_is_clk_ready(): For turning on system and secondary clock sources, and checking whether or not they're ready. Uses enum rcc_clk. Removals: - rcc_clk_init(): There's no way to port this to F2. Move it to the F1 header. This also means we can remove the empty implementation and enum rcc_pll_multiplier from the F2 RCC header, where it doesn't make any sense. Also fix up some includes, and rewrite rcc_clk_init() in terms of the new clock source management functions. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
* Great renaming: use "series" instead of "family".Marti Bolivar2012-04-111-0/+553
This is for greater consistency with the ST application notes, which refer to migrating "across" series (e.g. F1 to F2), but compatibility "within" a family (e.g. F1). So: - Move libmaple/stm32x/include/family to .../include/series/ and fix up includes appropriately. - Refer to "family" headers as "series" headers in comments. - Make similar "find and replace"-style changes to build system variable names and comments. - Move support/ld/stm32/family to .../stm32/series. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>