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

📄 uart.c

📁 fft的工业级的EP9315的开发板的所有驱动程序
💻 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 + -