uart.h.bak
来自「在基于ARM处理器的Liunx系统下的开放板上实现摄像头图像采集」· BAK 代码 · 共 34 行
BAK
34 行
#ifndef __uart_h__
#define __uart_h__
#include <stdio.h> // printf
#include <fcntl.h> // open
#include <string.h> // bzero
#include <stdlib.h> // exit
#include <sys/times.h> // times
#include <sys/types.h> // pid_t
#include <termios.h> //termios, tcgetattr(), tcsetattr()
#include <unistd.h>
#include <sys/ioctl.h> // ioctl
typedef struct{
char prompt; //prompt after reciving data
int baudrate; //baudrate
char databit; //data bits, 5, 6, 7, 8
char debug; //debug mode, 0: none, 1: debug
char echo; //echo mode, 0: none, 1: echo
char fctl; //flow control, 0: none, 1: hardware, 2: software
char tty; //tty: 0, 1, 2, 3, 4, 5, 6, 7
char parity; //parity 0: none, 1: odd, 2: even
char stopbit; //stop bits, 1, 2
const int reserved; //reserved, must be zero
}portinfo_t;
char *get_ptty(pportinfo_t pportinfo);
int convbaud(unsigned long int baudrate);
int PortSet(int fdcom, const pportinfo_t pportinfo);
int PortOpen(pportinfo_t pportinfo);
void PortClose(int fdcom);
int PortSend(int fdcom, char *data, int datalen);
int PortRecv(int fdcom, char *data, int datalen, int baudrate)
#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?