Browse Source

stm32f7: rcc: intial stubs support

Reviewed-by: Karl Palsson <karlp@tweak.net.au>
(Added defines and used them)
pull/758/head
Sync 9 years ago
committed by Karl Palsson
parent
commit
3fc0c9d001
  1. 1
      include/libopencm3/stm32/f7/rcc.h
  2. 4
      lib/stm32/f7/Makefile
  3. 11
      lib/stm32/f7/rcc.c

1
include/libopencm3/stm32/f7/rcc.h

@ -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

4
lib/stm32/f7/Makefile

@ -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

11
lib/stm32/f7/rcc.c

@ -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…
Cancel
Save