Allow custom baud rates for FTDI serial ports

- Termios: cf{get,set}{i,o}speed can handle arbitrary speed values.
- The value is stored in the appropriate fields of the termios structure
  in this case. The old constants (stored in the flags) are preserved
  for BeOS binary compatibility.
- Adjust the FTDI FT232* driver to accept custom rates, by replacing the
  hardcoded regster values with a function that will compute it
  according to FTDI documentation (confirmed giving the same values for
  the existing baudrates).
This commit is contained in:
Adrien Destugues
2016-02-27 19:08:53 +01:00
parent 44547a899c
commit 93ea83e53d
5 changed files with 54 additions and 48 deletions
+2 -2
View File
@@ -21,8 +21,8 @@ struct termios {
tcflag_t c_cflag; /* control modes */
tcflag_t c_lflag; /* local modes */
char c_line; /* line discipline */
speed_t c_ispeed; /* (unused) */
speed_t c_ospeed; /* (unused) */
speed_t c_ispeed; /* custom input baudrate */
speed_t c_ospeed; /* custom output baudrate */
cc_t c_cc[NCCS]; /* control characters */
};