創(chuàng)建并移植K10 BSP包的具體步驟和方法(二)
SIM_SOPT2 = (uint32_t)~(uint32_t)(SIM_SOPT2_MCGCLKSEL_MASK);
MCG_C2 = (MCG_C2_RANGE(0x02) | MCG_C2_EREFS_MASK);
MCG_C1 = (MCG_C1_CLKS(0x02) | MCG_C1_FRDIV(0x05) | MCG_C1_IRCLKEN_MASK);
MCG_C4 = (uint8_t)~(uint8_t)((MCG_C4_DMX32_MASK | MCG_C4_DRST_DRS(0x03)));
MCG_C5 = MCG_C5_PRDIV(0x07);
MCG_C6 = MCG_C6_VDIV(0x08);
while((MCG_S MCG_S_OSCINIT_MASK) == 0x00U) { /*判斷晶振是否運(yùn)行?*/
}
評(píng)論