[stm32f4] Remove rcc typedefs added prefixes to clock related enums.

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_
This commit is contained in:
Piotr Esden-Tempski
2015-02-25 18:12:12 -08:00
parent b1049f9a6f
commit d680be81b5
4 changed files with 90 additions and 90 deletions

View File

@@ -72,14 +72,14 @@ LGPL License Terms @ref lgpl_license
/* --- Function prototypes ------------------------------------------------- */
typedef enum {
SCALE1,
SCALE2,
} vos_scale_t;
enum pwr_vos_scale {
PWR_SCALE1,
PWR_SCALE2,
};
BEGIN_DECLS
void pwr_set_vos_scale(vos_scale_t scale);
void pwr_set_vos_scale(enum pwr_vos_scale scale);
END_DECLS

View File

@@ -546,15 +546,15 @@ extern uint32_t rcc_apb2_frequency;
/* --- Function prototypes ------------------------------------------------- */
typedef enum {
CLOCK_3V3_48MHZ,
CLOCK_3V3_84MHZ,
CLOCK_3V3_120MHZ,
CLOCK_3V3_168MHZ,
CLOCK_3V3_END
} clock_3v3_t;
enum rcc_clock_3v3 {
RCC_CLOCK_3V3_48MHZ,
RCC_CLOCK_3V3_84MHZ,
RCC_CLOCK_3V3_120MHZ,
RCC_CLOCK_3V3_168MHZ,
RCC_CLOCK_3V3_END
};
typedef struct {
struct rcc_clock_scale {
uint8_t pllm;
uint16_t plln;
uint8_t pllp;
@@ -566,15 +566,19 @@ typedef struct {
uint8_t power_save;
uint32_t apb1_frequency;
uint32_t apb2_frequency;
} clock_scale_t;
};
extern const clock_scale_t hse_8mhz_3v3[CLOCK_3V3_END];
extern const clock_scale_t hse_12mhz_3v3[CLOCK_3V3_END];
extern const clock_scale_t hse_16mhz_3v3[CLOCK_3V3_END];
extern const clock_scale_t hse_25mhz_3v3[CLOCK_3V3_END];
extern const struct rcc_clock_scale rcc_hse_8mhz_3v3[RCC_CLOCK_3V3_END];
extern const struct rcc_clock_scale rcc_hse_12mhz_3v3[RCC_CLOCK_3V3_END];
extern const struct rcc_clock_scale rcc_hse_16mhz_3v3[RCC_CLOCK_3V3_END];
extern const struct rcc_clock_scale rcc_hse_25mhz_3v3[RCC_CLOCK_3V3_END];
enum rcc_osc {
PLL, HSE, HSI, LSE, LSI
RCC_PLL,
RCC_HSE,
RCC_HSI,
RCC_LSE,
RCC_LSI
};
#define _REG_BIT(base, bit) (((base) << 5) + (bit))
@@ -854,7 +858,7 @@ void rcc_set_main_pll_hsi(uint32_t pllm, uint32_t plln, uint32_t pllp,
void rcc_set_main_pll_hse(uint32_t pllm, uint32_t plln, uint32_t pllp,
uint32_t pllq);
uint32_t rcc_system_clock_source(void);
void rcc_clock_setup_hse_3v3(const clock_scale_t *clock);
void rcc_clock_setup_hse_3v3(const struct rcc_clock_scale *clock);
END_DECLS