void rcu_system_clk_config_120M(void){ uint32_t timeout = 0U; uint32_t stab_flag = 0U; /* 使能外部8M晶振 */ RCU_CTL |= RCU_CTL_HXTALEN; /* 等待外部晶振ready,或者外部晶振未ready情况下超时退出 */ do{ timeout++; stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); }while((0U =...
void rcu_system_clk_config_120M(void) { uint32_ttimeout = 0U; uint32_t stab_flag = 0U; /* 使能外部8M晶振 */ RCU_CTL |= RCU_CTL_HXTALEN; /* 等待外部晶振ready,或者外部晶振未ready情况下超时退出 */ do{ timeout++; stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); ...
if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ while(1){ } } RCU_APB1EN |= RCU_APB1EN_PMUEN; PMU_CTL |= PMU_CTL_LDOVS; /* AHB一分频,系统时钟等于AHB时钟 */ RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; /* APB2一分频,APB2高速外设时钟等于AHB时钟 */ RCU_CFG0 |= RCU_APB2_CKAHB_DI...
/* HXTAL is stable */ /* AHB = SYSCLK */ RCU_CFG0 |= RCU_AHB_CKSYS_DIV1;/* APB2 ...
RCU_CTL|=RCU_CTL_HXTALEN; /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ do{ timeout++; stab_flag=(RCU_CTL&RCU_CTL_HXTALSTB); }while((0U==stab_flag)&&(HXTAL_STARTUP_TIMEOUT!=timeout)); ...
}while((0U== stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout));/* if fail */if(0U== (RCU_CTL & RCU_CTL_HXTALSTB)) {while(1) { } }/* HXTAL is stable *//* AHB = SYSCLK */RCU_CFG0 |= RCU_AHB_CKSYS_DIV1;/* APB2 = AHB/1 */RCU_CFG0 |= RCU_APB2_CKAHB_...
RCU_CTL |= RCU_CTL_HXTALEN; /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ do{ timeout++; stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); ...
void) // deepsleep 唤醒后系统时钟从内部时钟切换到 PLL 时钟{ RCU_CTL |= RCU_CTL_PLLEN; //使能 PLL while(0U == (uint32_t)(RCU_CTL & RCU_CTL_PLLSTB)) //等待 PLL 稳定{ } RCU_CFG0 &= ~RCU_CFG0_SCS; RCU_CFG0 |= RCU_CKSYSSRC_PLL; while(0U == (RCU_CFG0 & RCU_SCSS...
RCU_CTL |= RCU_CTL_HXTALEN; /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ do{ timeout++; stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); ...
uint32_t stab_flag=0U;/*enable HXTAL*/RCU_CTL|=RCU_CTL_HXTALEN;/*wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT*/do{ timeout++; stab_flag= (RCU_CTL &RCU_CTL_HXTALSTB); }while((0U== stab_flag) && (HXTAL_STARTUP_TIMEOUT !=timeout)...