]> cloudbase.mooo.com Git - z180-stamp-cpm3.git/blob - cbios/ioctl.inc
d3a7b7b7b814cef6529f98860f5210f5927ee011
[z180-stamp-cpm3.git] / cbios / ioctl.inc
1
2 b2m macro name,nr
3 name equ nr
4 M_&name equ 1 shl nr
5 endm
6
7
8 TCINIT equ 00h ;CP/M 3 DEVINI function
9 TCGETA equ 01h ;Get the current serial port settings.
10 TCSETA equ 02h ;Set the current serial port settings.
11 TCSETAW equ 03h ;Allow the output buffer to drain
12 TCSETAF equ 04h ;Allow the output buffer to drain, discard pending input
13 TCSBRK equ 05h ;Sending a break (250ms .. 500ms)
14 TCSBRKP equ 06h ;arg is timeinterval in 0.1sec
15 TIOCSBRK equ 07h ;Turn break on
16 TIOCCBRK equ 08h ;Turn break off
17 TCXONC equ 09h ;Software flow control (TCOOFF, TCOON, TCIOFF, TCION)
18 TCFLSH equ 0Ah ;Flush input/output buffer (TCIFLUSH, TCOFLUSH, TCIOFLUSH)
19 FIONREAD equ 0Bh ;Get the number of bytes in the input buffer.
20 TIOCOUTQ equ 0Ch ;Get the number of bytes in the output buffer.
21 TIOCMGET equ 0Dh ;get the status of modem bits.
22 TIOCMBIS equ 0Eh ;set the indicated modem bits.
23 TIOCMBIC equ 0Fh ;clear the indicated modem bits.
24 TIOCMSET equ 10h ;set the status of modem bits.
25 TIOCGSOFTCAR equ 11h ;Get the status of the CLOCAL flag in the c_cflag field
26 TIOCSSOFTCAR equ 12h ;Set the CLOCAL flag when *argp is nonzero, and clear it otherwise.
27
28
29 ; iflag bits (0)
30 b2m IGNBRK, 0 ;Ignore BREAK condition on input.
31 b2m BRKINT, 1
32 b2m INPCK, 2 ;Enable input parity checking.
33 b2m IGNPAR, 3 ;Ignore framing errors and parity errors.
34 b2m PARMRK, 4 ;Prefix a character with a parity error or framing error with FFH 00H.
35 b2m ISTRIP, 5 ;Strip off eighth bit.
36 b2m PARODD, 6 ;If set, then parity for input and output is odd.
37 ; fflag bits (1)
38 b2m IXON, 0 ;Enable XON/XOFF flow control on output.
39 b2m IXANY, 1 ;Typing any character will restart stopped output.
40 b2m IXOFF, 2 ;Enable XON/XOFF flow control on input.
41 b2m CRTS_IFLOW, 3 ;RTS flow control of input.
42 b2m CCTS_OFLOW, 4 ;CTS flow control of output.
43 b2m CLOCAL, 5 ;Ignore modem control lines.
44 b2m CREAD, 6 ;Enable receiver.
45
46
47 ; control mode flags (2)
48 M_CBAUD equ 01Fh ;Baud speed mask
49 B0 equ 000h ;hang up
50 B50 equ 011h
51 B75 equ 012h
52 B110 equ 013h
53 B134 equ 014h
54 B150 equ 005h
55 B300 equ 006h
56 B600 equ 007h
57 B1200 equ 008h
58 B1800 equ 009h
59 B2400 equ 00Ah
60 B3600 equ 00Bh
61 B4800 equ 00Ch
62 B7200 equ 00Dh
63 B9600 equ 00Eh
64 B19200 equ 00Fh
65 B28800 equ 001h
66 B38400 equ 002h
67 B57600 equ 003h
68 B115200 equ 004h
69 B144000 equ 014h
70 B192000 equ 016h
71 B288000 equ 017h
72 M_CSIZE equ 020h ;Character size mask.
73 CS7 equ 000h ;
74 CS8 equ 020h ;
75 b2m CSTOPB, 6 ;Set two stop bits, rather than one.
76 b2m PARENB, 7 ;Enable parity generation on output and parity checking for input.
77
78
79 ; tcflag_t c_lflag; /* local mode flags */
80 ;ECHO equ 00000001B
81
82
83 ; Parameter for TCXONC
84 TCOOFF equ 0 ;suspends output.
85 TCOON equ 1 ;restarts suspended output.
86 TCIOFF equ 2 ;transmits a STOP character
87 TCION equ 3 ;transmits a START character
88
89 ; Parameter for TCFLSH
90 TCIFLUSH equ 0 ;flushes data received but not read.
91 TCOFLUSH equ 1 ;flushes data written but not transmitted.
92 TCIOFLUSH equ 2 ;flushes both.
93
94 ; modem lines
95
96 TIOCM_LE equ 001h ;DSR (data set ready/line enable)
97 TIOCM_DTR equ 002h ;DTR (data terminal ready)
98 TIOCM_RTS equ 004h ;RTS (request to send)
99 TIOCM_CTS equ 008h ;CTS (clear to send)
100 TIOCM_CD equ 010h ;DCD (data carrier detect)
101 TIOCM_RI equ 020h ;RNG (ring)
102 TIOCM_DSR equ 040h ;DSR (data set ready)
103 TIOCM_OUT1 equ 080h ;