void Uart_init(unsigned long baud){
__SYSTEM_UART3_CLK_ENABLE();
GPIO_InitTypeDef GPIO_Handle;
/* Uart3 IO init */
GPIO_Handle.Pin = GPIO_PIN_4|GPIO_PIN_5;
GPIO_Handle.Mode = GPIO_MODE_AF_PP;
GPIO_Handle.Pull = GPIO_PULLUP;
GPIO_Handle.Alternate = GPIO_FUNCTION_1;
gpio_init(GPIOB, &GPIO_Handle);
//__SYSTEM_UART_CLK_SELECT_COREH();
Uart3_handle.UARTx = UART3;
Uart3_handle.Init.BaudRate = baud;
Uart3_handle.Init.DataLength = UART_DATA_LENGTH_8BIT;
Uart3_handle.Init.StopBits = UART_STOPBITS_1;
Uart3_handle.Init.Parity = UART_PARITY_NONE;
Uart3_handle.Init.FIFO_Mode = UART_FIFO_ENABLE;
uart_init(&Uart3_handle);
NVIC_ClearPendingIRQ(UART3_IRQn);
NVIC_EnableIRQ(UART3_IRQn);
//NVIC_SetPriority(UART3_IRQn, 0);
}
void uart3_irq(void)
{
uart_IRQHandler(&Uart3_handle);
}
麻烦那位看一下uart3的串口接收中断该如何配置?