?? uart.c
字號:
/* * Description: * example for set serial interface: RS-485. * */ #include <stdio.h>#include <sys/types.h>#include <sys/stat.h>#include <fcntl.h>int main(void){ int type, dip_sw, i; int fd = open("/dev/ttyS4",O_RDWR); /*get serial interface*/ if(ioctl(fd, 0xe001, &type) == 0) printf("UART Type:%d\n",type); /*set serial interface to RS-485*/ type = 485; if(ioctl(fd, 0xe002, &type) == 0) printf("set UART type:%d\n", type); close(fd); return 0;}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -