diff options
author | Manuel Reimer <manuel.reimer@gmx.de> | 2018-02-03 17:18:53 +0100 |
---|---|---|
committer | Manuel Reimer <manuel.reimer@gmx.de> | 2018-02-03 17:18:53 +0100 |
commit | 057856bd2bc642ca855b8be2f7e7a3802a5bd05d (patch) | |
tree | 06df8647560b3731a2dfd40a3c8cd3382deaaae3 /glcddrivers/port.h | |
parent | 3bbe763488aa84fdf29047b6b38acd11f8274862 (diff) | |
download | graphlcd-base-057856bd2bc642ca855b8be2f7e7a3802a5bd05d.tar.gz graphlcd-base-057856bd2bc642ca855b8be2f7e7a3802a5bd05d.tar.bz2 |
Add variable baud rate for serial speed optimization
Diffstat (limited to 'glcddrivers/port.h')
-rw-r--r-- | glcddrivers/port.h | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/glcddrivers/port.h b/glcddrivers/port.h index ee851c8..fc97293 100644 --- a/glcddrivers/port.h +++ b/glcddrivers/port.h @@ -15,6 +15,24 @@ #include <string> #include <termios.h> +// The following block is copied from "asm/termbits.h" +// Has to be copied as the kernel header file conflicts with glibc termios.h +#define NCCS2 19 +struct termios2 { + tcflag_t c_iflag; /* input mode flags */ + tcflag_t c_oflag; /* output mode flags */ + tcflag_t c_cflag; /* control mode flags */ + tcflag_t c_lflag; /* local mode flags */ + cc_t c_line; /* line discipline */ + cc_t c_cc[NCCS2]; /* control characters */ + speed_t c_ispeed; /* input speed */ + speed_t c_ospeed; /* output speed */ +}; +#define TCGETS2 _IOR('T', 0x2A, struct termios2) +#define TCSETS2 _IOW('T', 0x2B, struct termios2) +#define BOTHER 0010000 + + namespace GLCD { @@ -72,7 +90,7 @@ public: int Open(const char * device); int Close(); - void SetBaudRate(speed_t speed); + void SetBaudRate(int speed); int ReadData(unsigned char * data); void WriteData(unsigned char data); |