User`s manual
BL160046 s System Development
RS-232 Software Support
int Dinit
_
z0 ( void *rbuf, void *tbuf,
int rsize, int tsize,
byte mode, byte baud,
byte modem, byte echo );
Initializes Z180 Port 0 for communication.
PARAMETERS: rbuf is a pointer to the receive buffer.
tbuf is a pointer to the transmit buffer.
rsize is the size of the receive buffer.
tsize is the size of the transmit buffer.
mode selects the operation mode as follows.
bit 0 0 1 stop bit
1 2 stop bits
bit 1 0 no parity
1 with parity
bit 2 0 7 data bits
1 8 data bits
bit 3 0 even parity
1 odd parity
bit 4 0 CTS, RTS disabled
1 CTS, RTS enabled
baud is the baud rate in multiples of 1200 (e.g., specify 8 for 9600 bps).
modem 1modem is supported; 0no modem.
echo 1every character is echoed; 0no echo.
If CTS/RTS handshaking is selected, transmission from the sender is
disabled (by raising RTS) when the receive buffer is 80% full. The
software lowers RTS (enabling the sender to transmit) when the receive
buffer falls below 20% of capacity. In a similar manner, a remote
system can prevent transmission of data by Z180 Port 0 by asserting its
RTS (connected to the Z180 Port 0 CTS).
int Dread
_
z01ch( char *ch )
Reads a character from the circular receive buffer into character ch.
RETURN VALUE: 0buffer empty; 1 byte has been successfully
extracted from buffer.