stm32f7: rcc: intial stubs support
Reviewed-by: Karl Palsson <karlp@tweak.net.au> (Added defines and used them)
This commit is contained in:
parent
7ee1d948e9
commit
3fc0c9d001
|
@ -159,6 +159,7 @@
|
|||
|
||||
/* SWS: System clock switch status */
|
||||
#define RCC_CFGR_SWS_SHIFT 2
|
||||
#define RCC_CFGR_SWS_MASK 0x3
|
||||
#define RCC_CFGR_SWS_HSI 0x0
|
||||
#define RCC_CFGR_SWS_HSE 0x1
|
||||
#define RCC_CFGR_SWS_PLL 0x2
|
||||
|
|
|
@ -40,7 +40,9 @@ TGT_CFLAGS = -Os -g \
|
|||
|
||||
ARFLAGS = rcs
|
||||
|
||||
OBJS = gpio.o gpio_common_all.o gpio_common_f0234.o
|
||||
OBJS = rcc.o gpio.o gpio_common_all.o gpio_common_f0234.o
|
||||
|
||||
OBJS += rcc_common_all.o
|
||||
|
||||
OBJS += rng_common_v1.o
|
||||
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
#include <libopencm3/stm32/rcc.h>
|
||||
|
||||
uint32_t rcc_ahb_frequency = 16000000;
|
||||
uint32_t rcc_apb1_frequency = 16000000;
|
||||
uint32_t rcc_apb2_frequency = 16000000;
|
||||
|
||||
uint32_t rcc_system_clock_source(void)
|
||||
{
|
||||
/* Return the clock source which is used as system clock. */
|
||||
return (RCC_CFGR >> RCC_CFGR_SWS_SHIFT) & RCC_CFGR_SWS_MASK;
|
||||
}
|
Loading…
Reference in New Issue