func (t *TTYIO) Serial(baud int) (*Termios, error) {
	restorer, err := t.Get()
	if err != nil {
		return nil, err
	}
	serial := MakeSerialDefault(restorer)
	if baud != 0 {
		if err := t.Set(serial); err != nil {
			return nil, err
		}
		serial, err = MakeSerialBaud(serial, baud)
		if err != nil {
			return restorer, err
		}
	}
	err = t.Set(serial)
	return restorer, err
}
Serial configure the serial TTY at given baudrate with ECHO and character conversion (CRNL, ERASE, KILL)
package termios
type (
	TTY struct {
		Ispeed int
		Ospeed int
		Row    int
		Col    int
		CC map[string]uint8
		Opts map[string]bool
	}
)
func (t *TTYIO) Raw() (*Termios, error) {
	restorer, err := t.Get()
	if err != nil {
		return nil, err
	}
	raw := MakeRaw(restorer)
	if err := t.Set(raw); err != nil {
		return nil, err
	}
	return restorer, nil
}