天嵌 ARM开发社区

 找回密码
 注册
查看: 2816|回复: 1

串口拓展模块

[复制链接]
2933080003 发表于 2015-3-19 13:26:01 | 显示全部楼层 |阅读模式
我在项目了要用两个串口,然后就买了天嵌的串口模块,但是程序如果这样写int main(void)
{
    int fd;
    int num = 0;
    /*打开设备*/
    fd = open("/dev/ttySAC0",O_RDWR);
    if(fd < 0)
      {
          printf("open devices fail!\n\r");
      }
   //  printf("%d\n\r",fd);
  /*读取设备*/
   num = write(fd,buf1,6);
    printf("%d\n\r",num);
   /*关闭设备*/
   close(fd);
   
   return 0;
}
就可以成功使用ttySAC0(也是我启动内核的控制台),可是我把程序改成fd = open("/dev/ttySAC1",O_RDWR);就没有使用串口1,这是怎么回事??
奋斗的小鱼 发表于 2015-11-10 16:19:25 | 显示全部楼层
刚刚入手E9也正在为这个烦恼
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

i.MX8系列ARM cortex A53 M4 工控板上一条 /1 下一条

Archiver|手机版|小黑屋|天嵌 嵌入式开发社区 ( 粤ICP备11094220号 )

GMT+8, 2024-4-25 12:14 , Processed in 1.031237 second(s), 21 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表