tests: gadget0: stm32f3: use library clock setups
F3 rcc configs were overhauled and we can now use standard init code instead of specifying our own custom clock config.
This commit is contained in:
@@ -39,28 +39,12 @@
|
|||||||
do { } while (0)
|
do { } while (0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const struct rcc_clock_scale this_clock_config = {
|
|
||||||
/* 72MHZ from 8MHZ external clock from stlink MCO */
|
|
||||||
.pllsrc = RCC_CFGR_PLLSRC_HSE_PREDIV,
|
|
||||||
.pllmul = RCC_CFGR_PLLMUL_MUL9,
|
|
||||||
.plldiv = RCC_CFGR2_PREDIV_NODIV,
|
|
||||||
.usbdiv1 = false,
|
|
||||||
.flash_waitstates = 2,
|
|
||||||
.hpre = RCC_CFGR_HPRE_DIV_NONE,
|
|
||||||
.ppre1 = RCC_CFGR_PPRE1_DIV_2,
|
|
||||||
.ppre2 = RCC_CFGR_PPRE2_DIV_NONE,
|
|
||||||
.ahb_frequency = 72e6,
|
|
||||||
.apb1_frequency = 32e6,
|
|
||||||
.apb2_frequency = 72e6,
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
rcc_periph_clock_enable(RCC_GPIOE);
|
rcc_periph_clock_enable(RCC_GPIOE);
|
||||||
gpio_mode_setup(GPIOE, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE, GPIO11|GPIO12);
|
gpio_mode_setup(GPIOE, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE, GPIO11|GPIO12);
|
||||||
gpio_set(GPIOE, GPIO12);
|
gpio_set(GPIOE, GPIO12);
|
||||||
rcc_clock_setup_pll(&this_clock_config);
|
rcc_clock_setup_pll(&rcc_hse8mhz_configs[RCC_CLOCK_HSE8_72MHZ]);
|
||||||
|
|
||||||
rcc_periph_clock_enable(RCC_GPIOA);
|
rcc_periph_clock_enable(RCC_GPIOA);
|
||||||
/*
|
/*
|
||||||
|
|||||||
Reference in New Issue
Block a user