void InitUart(void) { GPIO_InitTypeDef GPIO_InitStructure; #if 1// (USART_USED == USART1) RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOA , ENABLE); RCC_APB2PeriphClockCmd(RCC_APB2Periph_USART1,ENA
void SYSCLK_Config_HSI_64Mhz(void) { __IO uint32_t StartUpCounter = 0, HSIStatus = 0; /* SYSCLK, HCLK, PCLK2 and PCLK1 configuration ---------------------------*/ /* Enable HSI */ RCC->CR
voiddelay_us(u16n){SysTick->LOAD=48*n;//裝載計(jì)數(shù)器因?yàn)闀r(shí)鐘為48Mhz,48次1usSysTick->CTRL=0x00000005;//時(shí)鐘來源設(shè)為為HCLK(48Mhz),打開定時(shí)器while(!(SysTick->CTRL&0x00010000));//等待計(jì)數(shù)到0SysTick->CTRL=0