#include "s3c6410.h"
#define UTXH0 (*(volatile unsigned char*)UTXH0_REG)
#define UTRSTAT0 (*(volatile unsigned char*)UTRSTAT0_REG)
void uart_putc(char c)
{
while(!(UTRSTAT0 & UTRSTAT_TX_EMPTY));
UTXH0 = c;
}
void uart_print(const char* str)
{
while(*str)
{
uart_putc(*str);
str ++;
}
}
void delay(int msec)
{
int i, j;
for(i=1000; i>0; i--)
{
for(j=msec*10; j>0; j--)
/*do nothing;*/;
}
}
int xmain()
{
while (1)
{
delay(1000);
uart_print("Uart Hello World\r\n");
}
return 0;
}
- 1
- 2
前往页