Topic : The ATARI Compendium
Author : Scott Sanders / JAY Software
Version : 1.25 (20/6/2003)
Subject : Documentation
Nodes : 1117
Index Size : 32614
HCP-Version : 6
Compiled on : Atari
@charset : UTF-8
@lang : en
@default :
@help : %About
@options : +g -i -t4 +y +z
@width : 100
View Ref-FileBconmap()Rsconf() XBIOSSyntaxULONG Rsconf( speed, flow, ucr, rsr, tsr, scr )
WORD speed, flow, ucr, rsr, tsr, scr;
Function Rsconf() reads/modifies the configuration of the serial
device currently mapped to BIOS device #1 (GEMDOS 'aux:').
Opcode 15 (0x0F)
Availability All TOSversions.
Parameters speed sets the serial device speed as follows:
Name speed Baud Rate Name speed Baud Rate
BAUD_19200 0 19200 BAUD_600 8 600
BAUD_9600 1 9600 BAUD_300 9 300
BAUD_4800 2 4800 BAUD_200 10 200
BAUD_3600 3 3600 BAUD_150 11 150
BAUD_2400 4 2400 BAUD_134 12 134
BAUD_2000 5 2000 BAUD_110 13 110
BAUD_1800 6 1800 BAUD_75 14 75
BAUD_1200 7 1200 BAUD_50 15 50
If speed is set to BAUD_INQUIRE (-2), the last baud rate set will
be returned.
flow selects the flow control method as follows:
Name flow Meaning
FLOW_NONE 0 No flow control
FLOW_SOFT 1 XON/XOFF flow control (ctrl-s/ctrl-q)
FLOW_HARD 2 RTS/CTS flow control (hardware)
FLOW_BOTH 3 Both methods of flow control
ucr, rsr, and tsr are each status bit arrays governing the
serial devices. Each parameter uses only the lower eight bits
of the WORD. They are defined as follows:
Mask ucr rsr and tsr
0x01 Unused Receiver enable:
RS_RECVENABLE
0x02 Enable odd parity Sync strip
RS_ODDPARITY (0x02) RS_SYNCSTRIP
RS_EVENPARITY (0x00)
0x04 Parity enable Match busy
RS_PARITYENABLE RS_MATCHBUSY
0x08 Bits 3-4 of the ucr collectively define Break detect
the start and stop bit configuration as RS_BRKDETECT
follows:
00 = No Start or Stop bits
RS_NOSTOP (0x00)
01 = 1 Start bit, 1 Stop bit
RS_1STOP (0x08)
10 = 1 Start bit, 1.5 Stop bits
RS_15STOP (0x10)
11 = 1 Start bit, 2 Stop bits
RS_2STOP (0x18)
0x10 See above. Frame error
RS_FRAMEERR
0x20 Bits 5 and 6 together define the number Parity error
of bits per word as follows: RS_PARITYERR
00 = 8 bits
RS_8BITS (0x00)
01 = 7 bits
RS_7BITS (0x20)
10 = 6 bits
RS_6BITS (0x40)
11 = 5 bits
RS_5BITS (0x60)
0x40 See above. Overrun error
RS_OVERRUNERR
0x80 CLK/16 Buffer full
RS_CLK16 RS_BUFFULL
scr sets the synchronous character register in which the low
byte is used as the character to search for in an underrun
error condition. If a RS_INQUIRE (-1) is used for either ucr,
rsr, tsr, or scr, then that parameter is read and the register
is unmodified.
Binding move.w scr,-(sp)
move.w tsr,-(sp)
move.w rsr,-(sp)
move.w ucr,-(sp)
move.w flow,-(sp)
move.w speed,-(sp)
move.w #$0F,-(sp)
trap #14
lea 14(sp),sp
Return Value Rsconf() returns the last set baud rate if speed is set to
RS_LASTBAUD (2). Otherwise, it returns the old settings in
a packed LONG with ucr being in the high byte, down to scr
being in the low byte.
Comments Bits in the ucr, rsr, tsr, and scr should be set atomically. To
correctly change a value, read the old value, mask it as
appropriate and then write it back. Baud rates higher than
19,200 bps available with SCC-based serial devices may be set
by using the appropriate Fcntl() call under MiNT or by directly
programming the SCC chip.
Caveats The baud rate inquiry mode (speed = RS_LASTBAUD) does not work
at all on TOSversions less than 1.04. TOS version 1.04
requires the patch program TOS14FX2.PRG (available from Atari
Corp.) to allow this mode to function. All other TOSversions support the function normally.
See Also Bconmap()