⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 uart0.c

📁 s3c2410/s3c2440的bootloader演示程序
💻 C
字号:
#include "option.h"
#include "2410addr.h"
#include "uart0.h"


//***************************[ UART ]******************************
void Uart0_Init(void)
{
    int i;

	rUFCON0 = 0x0;      // FIFO disable
	rUMCON0 = 0x0;      // AFC disable

	rULCON0 = 0x3;      // Normal,No parity,1 stop,8 bits
	rUCON0  = 0x245;   

	rUBRDIV0=( (int)(PCLK/16./BAUD_RATE) -1 );

	for(i=0;i<100;i++);    
}

//=================================================================
void Uart0_SendByte(int data)
{
	int i;
	if(data=='\n')
	{
		while(!(UART_STATUS & 0x2));
			for(i=0;i<1000;i++);
		WRITE_UART('\r');
	}

	while(!(UART_STATUS & 0x2));   //Wait until THR is empty.
		for(i=0;i<1000;i++);
	WRITE_UART(data);
}

//=================================================================
void Uart0_SendString(char *pt)
{
	while(*pt)
		Uart0_SendByte(*pt++);
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -