Anatomy of a Serial Port
A serial port is composed of actual hardware which controls serial port lines, and of buffers that store incoming data (which is to be processed by your application) and outgoing data (which has not yet left the port).
The serial port object contains properties, methods and events which relate both to the buffers and the UART itself (see Serial Settings).
The buffers available are:
- The TX buffer, which contains data due to be sent out of the port (i.e, it's the transmit of your device!). Your Tibbo BASIC/C application puts the data into the TX buffer.
- The RX buffer, which contains incoming data received by the port. This data is to be processed by your application.
The logical lines available are:
- The TX/W1out/dout output line.
- The RX/W1in/din input line.
- The RTS/W0out/cout output line.
- The CTS/W0&1in/cin input line.
TX/W1out/dout and RX/W1in/din lines always have fixed "position" in the device i.e. they cannot be re-mapped to a different I/O pin. RTS/W0out/cout and CTS/W0&1in/cin lines can be re-mapped on select devices. Also, depending on the device and the serial port mode you may or may not require to explicitly configure the lines of the serial port as inputs or outputs. Sometimes it will happen automatically, and sometimes you need to take care of this in your application through the io object. You will find this information in the "Platform-related Programming Information" topic inside your platform specifications section.
Details of I/O line usage in each of the three operating modes of the port can be found here.