void Usart1(u8 Fck,u32 Bot)
{
u32 man;
man=Fck*1000000/Bot;
RCC->APB2ENR|=0x4004;
GPIOA->CRH&=0xfffff00f;
GPIOA->CRH|=0x000008b0;
RCC->APB2RSTR|=0x4000;
RCC->APB2RSTR&=~0x4000;
USART1->BRR=man;
USART1->CR1=0x212C;
USART1->CR1|=0x1000; //data is 9 bits
USART2->CR1&=~0x20;
NVIC->ISER[1]|=1<<(38-32);
NVIC->IP[38]=(u8)0XF0;
} |