void USART3_Init(u32 baudrate)
{
NVIC_InitTypeDef NVIC_InitStructure;
GPIO_InitTypeDef GPIO_InitStructure; //定义GPIO初始化结构体
USART_InitTypeDef USART_InitStructure; //定义USART初始化结构体
/*配置USART3相应的时钟*/
RCC_AHB1PeriphclockCmd(RCC_AHB1Periph_GPIOD,ENABLE); //使能GPIOd的AHB1时钟
RCC_APB1PeriphClockCmd(RCC_APB1Periph_USART3, ENABLE); //使能USART3的APB1时钟
GPIO_PinAFConfig(GPIOD,GPIO_PinSource8,GPIO_AF_USART3); //配置Pd8复用连接到USART3
GPIO_PinAFConfig(GPIOD,GPIO_PinSource9,GPIO_AF_USART3); //配置Pd9复用连接到USART3
GPIO_InitStructure.GPIO_Pin=GPIO_Pin_8|GPIO_Pin_9;
GPIO_InitStructure.GPIO_Mode=GPIO_Mode_AF; //设置GPI