2
This file is part of the Free Pascal run time library.
4
A file in Amiga system run time library.
5
Copyright (c) 1998 by Nils Sjoholm
6
member of the Amiga RTL development team.
8
See the file COPYING.FPC, included in this distribution,
9
for details about the copyright.
11
This program is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15
**********************************************************************}
26
{ array of termination char's }
27
{ to use,see serial.doc setparams }
29
pIOTArray = ^tIOTArray;
37
SER_DEFAULT_CTLCHAR = $11130000; { default chars for xON,xOFF }
39
{ You may change these via SETPARAMS. At this time, parity is not
40
calculated for xON/xOFF characters. You must supply them with the
43
{****************************************************************}
44
{ CAUTION !! IF YOU ACCESS the serial.device, you MUST (!!!!) use an
45
IOExtSer-sized structure or you may overlay innocent memory !! }
46
{****************************************************************}
50
pIOExtSer = ^tIOExtSer;
76
io_CtlChar : ULONG; { control char's (order = xON,xOFF,INQ,ACK) }
77
io_RBufLen : ULONG; { length in bytes of serial port's read buffer }
78
io_ExtFlags : ULONG; { additional serial flags (see bitdefs below) }
79
io_Baud : ULONG; { baud rate requested (true baud) }
80
io_BrkTime : ULONG; { duration of break signal in MICROseconds }
81
io_TermArray : tIOTArray; { termination character array }
82
io_ReadLen : Byte; { bits per read character (# of bits) }
83
io_WriteLen : Byte; { bits per write character (# of bits) }
84
io_StopBits : Byte; { stopbits for read (# of bits) }
85
io_SerFlags : Byte; { see SerFlags bit definitions below }
89
{ status of serial port, as follows:
93
* 2 high Connected to parallel "select" on the A1000.
94
* Connected to both the parallel "select" and
95
* serial "ring indicator" pins on the A500 &
96
* A2000. Take care when making cables.
97
* 3 low Data Set Ready
99
* 5 low Carrier Detect
100
* 6 low Ready To Send
101
* 7 low Data Terminal Ready
102
* 8 high read overrun
104
* 10 high break received
105
* 11 high transmit x-OFFed
106
* 12 high receive x-OFFed
112
SDCMD_QUERY = CMD_NONSTD;
113
SDCMD_BREAK = CMD_NONSTD + 1;
114
SDCMD_SETPARAMS = CMD_NONSTD + 2;
117
SERB_XDISABLED = 7; { io_SerFlags xOn-xOff feature disabled bit }
118
SERF_XDISABLED = 128; { " xOn-xOff feature disabled mask }
119
SERB_EOFMODE = 6; { " EOF mode enabled bit }
120
SERF_EOFMODE = 64; { " EOF mode enabled mask }
121
SERB_SHARED = 5; { " non-exclusive access bit }
122
SERF_SHARED = 32; { " non-exclusive access mask }
123
SERB_RAD_BOOGIE = 4; { " high-speed mode active bit }
124
SERF_RAD_BOOGIE = 16; { " high-speed mode active mask }
125
SERB_QUEUEDBRK = 3; { " queue this Break ioRqst }
126
SERF_QUEUEDBRK = 8; { " queue this Break ioRqst }
127
SERB_7WIRE = 2; { " RS232 7-wire protocol }
128
SERF_7WIRE = 4; { " RS232 7-wire protocol }
129
SERB_PARTY_ODD = 1; { " parity feature enabled bit }
130
SERF_PARTY_ODD = 2; { " parity feature enabled mask }
131
SERB_PARTY_ON = 0; { " parity-enabled bit }
132
SERF_PARTY_ON = 1; { " parity-enabled mask }
134
{ These now refect the actual bit positions in the io_Status UWORD }
136
IO_STATB_XOFFREAD = 12; { io_Status receive currently xOFF'ed bit }
137
IO_STATF_XOFFREAD = $1000; { " receive currently xOFF'ed mask }
138
IO_STATB_XOFFWRITE = 11; { " transmit currently xOFF'ed bit }
139
IO_STATF_XOFFWRITE = $0800; { " transmit currently xOFF'ed mask }
140
IO_STATB_READBREAK = 10; { " break was latest input bit }
141
IO_STATF_READBREAK = $0400; { " break was latest input mask }
142
IO_STATB_WROTEBREAK = 9; { " break was latest output bit }
143
IO_STATF_WROTEBREAK = $0200; { " break was latest output mask }
144
IO_STATB_OVERRUN = 8; { " status word RBF overrun bit }
145
IO_STATF_OVERRUN = $0100; { " status word RBF overrun mask }
148
SEXTB_MSPON = 1; { io_ExtFlags. Use mark-space parity, }
149
{ instead of odd-even. }
150
SEXTF_MSPON = 2; { " mark-space parity mask }
151
SEXTB_MARK = 0; { " if mark-space, use mark }
152
SEXTF_MARK = 1; { " if mark-space, use mark mask }
156
SerErr_BaudMismatch = 2; { baud rate not supported by hardware }
157
SerErr_BufErr = 4; { Failed to allocate new read buffer }
160
SerErr_ParityErr = 9;
161
SerErr_TimerErr = 11; {(See the serial/OpenDevice autodoc)}
162
SerErr_BufOverflow = 12;
164
SerErr_DetectedBreak = 15;
167
{ These defines refer to the HIGH ORDER byte of io_Status. They have
168
been replaced by the new, corrected ones above }
169
IOSTB_XOFFREAD = 4; { iost_hob receive currently xOFF'ed bit }
170
IOSTF_XOFFREAD = 16; { " receive currently xOFF'ed mask }
171
IOSTB_XOFFWRITE = 3; { " transmit currently xOFF'ed bit }
172
IOSTF_XOFFWRITE = 8; { " transmit currently xOFF'ed mask }
173
IOSTB_READBREAK = 2; { " break was latest input bit }
174
IOSTF_READBREAK = 4; { " break was latest input mask }
175
IOSTB_WROTEBREAK= 1; { " break was latest output bit }
176
IOSTF_WROTEBREAK= 2; { " break was latest output mask }
177
IOSTB_OVERRUN = 0; { " status word RBF overrun bit }
178
IOSTF_OVERRUN = 1; { " status word RBF overrun mask }
180
IOSERB_BUFRREAD = 7 ; { io_Flags from read buffer bit }
181
IOSERF_BUFRREAD = 128; { " from read buffer mask }
182
IOSERB_QUEUED = 6 ; { " rqst-queued bit }
183
IOSERF_QUEUED = 64 ; { " rqst-queued mask }
184
IOSERB_ABORT = 5 ; { " rqst-aborted bit }
185
IOSERF_ABORT = 32 ; { " rqst-aborted mask }
186
IOSERB_ACTIVE = 4 ; { " rqst-qued-OR-current bit }
187
IOSERF_ACTIVE = 16 ; { " rqst-qued-OR-current mask }
191
SERIALNAME : PChar = 'serial.device';