📄 uart.c
字号:
/****************************************Copyright (c)**************************************************
** 研 发 部
** http://www.FFTChina.com
**-----------------------------------------文件信息-----------------------------------------------------
**文 件 名: cantest.c
**创 建 人:
**最后修改日期: 2005年6月30日
**描 述:
**------------------------------------------------------------------------------------------------------
********************************************************************************************************/
#include "stdio.h"
#include "stdlib.h"
#include "sys/types.h"
#include "sys/stat.h"
#include "fcntl.h"
static const char wrbuf[]="Welcome to use FFT-9315 developement board!\nThis is the uart0 test application program in linux!\n";
int main(void)
{
int fd1,i;
fd1=open("/dev/ttyS0", O_RDWR);
if(fd1==-1) {
perror("open");
exit(EXIT_FAILURE);
}
write(fd1,wrbuf,sizeof(wrbuf));
if(close(fd1)<0) {
perror("close");
exit(EXIT_FAILURE);
}
exit(EXIT_SUCCESS);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -