serial.h

来自「采用MINIGUI开发的一套GUI界面」· C头文件 代码 · 共 26 行

H
26
字号
//#define DEBUG

 typedef struct{
    unsigned char    prompt;        /*prompt after reciving data*/
    int     baudrate;        /*baudrate*/
    unsigned char    databit;        /*data bits, 5, 6, 7, 8*/
    unsigned char     debug;            /*debug mode, 0: none, 1: debug*/
    unsigned char     echo;            /*echo mode, 0: none, 1: echo*/
    unsigned char    fctl;            /*flow control, 0: none, 1: hardware, 2: software*/
    unsigned char     tty;            /*tty: 0, 1, 2, 3, 4, 5, 6, 7*/
    unsigned char    parity;        /*parity 0: none, 1: odd, 2: even*/
    unsigned char    stopbit;        /*stop bits, 1, 2*/
    const int reserved;        /*reserved, must be zero*/
}portinfo_t;

typedef portinfo_t *pportinfo_t;

/*在METER.C中要用到的函数*/
int PortOpen(pportinfo_t pportinfo);
int PortRecv(int fdcom, unsigned char *data, int datalen, int baudrate) ;
int convbaud(unsigned long int baudrate) ;
 int  SetBourate(int baudrate );
int PortSend(int fdcom, unsigned char *data, int datalen) ;
void signal_handler_IO (int status) ;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?