You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
942 B
C

#ifndef __SERIAL_H__
#define __SERIAL_H__
typedef struct
{
char tty[20]; //tty: 0, 1, 2, 3, 4, 5, 6, 7
unsigned int baudrate; //baudrate
unsigned char prompt; //prompt after reciving data
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 parity; //parity 0: none, 1: odd, 2: even
unsigned char stopbit; //stop bits, 1, 2
unsigned char reserved;
} serial_attr_t;
extern int serial_open(const char * devname, int baudrate);
extern int serial_read(int fd, unsigned char * data, int len);
extern int serial_write(int fd, unsigned char * data, int len);
extern void serial_close(int fd);
#endif