S3C2440之UART(二)

https://blog.csdn.net/pxy198831/article/details/86346027

S3C2440之UART(一)

介绍了S3C2440的UART驱动,下面看应用

主函数通过调用

	Uart_Select(0);			             //选择串口0
	UART_INT_initialize ();

一个选择串口,一个配置中断,库函数都在https://blog.csdn.net/pxy198831/article/details/86346027

/*************************************************************************************
***函数名:Uart_Select()
***功能:串口选择。函数里面的whichUart在后面的函数中有引用,决定用哪个UART。
***参数:ch	串口通道号
***返回:无
*************************************************************************************/
void Uart_Select(int ch)
{
    whichUart = ch;
}
/*****************************************************************************
***函数名:UART_INT_initialize
***功能:串口中断初始化
***参数:无
***返回:无
*****************************************************************************/
void UART_INT_initialize (void)
{
              
	//第三步 清子中断标志,开子屏蔽
	ClearSubPending (BIT_SUB_RXD0);
	EnableSubIrq(BIT_SUB_RXD0);

	//第四步 清总中断
	ClearPending(BIT_UART0);              //清除INTPND,SRCPND中断标示

	//第五步:设置中断服务函数入口
	pISR_UART0 = (unsigned)UART_INT ;

	//开总中断
	EnableIrq(BIT_UART0);
}

猜你喜欢

转载自blog.csdn.net/pxy198831/article/details/86346194