13#ifndef ZEPHYR_INCLUDE_DRIVERS_CLOCK_CONTROL_BFLB_COMMON_H_
14#define ZEPHYR_INCLUDE_DRIVERS_CLOCK_CONTROL_BFLB_COMMON_H_
25#define BFLB_MAIN_CLOCK_RC32M 0
27#define BFLB_MAIN_CLOCK_XTAL 1
29#define BFLB_MAIN_CLOCK_PLL_RC32M 2
31#define BFLB_MAIN_CLOCK_PLL_XTAL 3
37 __asm__
volatile (
".rept 20 ; nop ; .endr");
55 tmp = (tmp & HBN_ROOT_CLK_SEL_UMSK) | (clock << HBN_ROOT_CLK_SEL_POS);
71 return ((tmp & HBN_ROOT_CLK_SEL_MSK) >> HBN_ROOT_CLK_SEL_POS);
78#define BFLB_MUL_CLK(_value, _top, _base) \
79 (((uint64_t)(_value) * (uint64_t)(_top)) / (uint64_t)(_base))
static uint32_t clock_bflb_get_root_clock(void)
Get the currently selected root (main) clock source.
Definition clock_control_bflb_common.h:66
static void clock_bflb_settle(void)
Busy-wait for a few CPU cycles to let a clock change settle.
Definition clock_control_bflb_common.h:35
#define BFLB_MAIN_CLOCK_RC32M
XCLK is RC32M, main clock is XCLK.
Definition clock_control_bflb_common.h:25
#define BFLB_MAIN_CLOCK_PLL_XTAL
XCLK is the crystal, main clock is the PLL.
Definition clock_control_bflb_common.h:31
static void clock_bflb_set_root_clock(uint32_t clock)
Select the root (main) clock source.
Definition clock_control_bflb_common.h:46
static uint32_t sys_read32(mm_reg_t addr)
Read 32 bits from a memory mapped register.
static void sys_write32(uint32_t data, mm_reg_t addr)
Write 32 bits to a memory mapped register.
__UINT32_TYPE__ uint32_t
Definition stdint.h:90