uart.c

来自「该压缩包为ARM S3C44B0的源代码」· C语言 代码 · 共 52 行

C
52
字号
/*#include "option.h"
#include "def.h"
#include "44b.h"
#include "44blib.h"*/
#include "option.h"
#include "def.h"
#include "44b.h"
#include "44blib.h"


void Main(void)
{
char  aa;  
rSYSCFG=CACHECFG;   // Using 8KB Cache

Port_Init();
    
Led_Display(0x0);

Uart_Init(0,57600);
Delay(10);
Uart_Select(0); //Select UART0

Uart_Printf("\nFS44B0X串口测试");
Uart_Printf("\nPlease Press 'a'or'b'or'c'");
while(1){
aa= Uart_Getch();
switch(aa)
{
case 'a':
Uart_Printf("\nYou Pressed 'a'");
Led_Display(0x1);
break;
case 'b':
Uart_Printf("\nYou Pressed 'b'");
Led_Display(0x2);
break;
case 'c':
Uart_Printf("\nYou Pressed 'c'");
Led_Display(0x4);
break;
case 0x1b:
Led_Display(0x0);
break;
default :
break;
}
}
}


⌨️ 快捷键说明

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