Data Structures 5 Data Structures 5.1 ComBuffer The ComBuffer data structure is a data buffer that decouples the hardware-dependent communication blocks from the hardware-independent blocks. Data buffers of type ComBuffer are never directly written or read by the user, but are merely used as intermediate storage for the communication blocks. TYPE ComBuffer STRUCT Buffer : ARRAY[0..300] OF BYTE; RdIdx : INT; WrIdx : INT; Count : INT; (* Number of characters in the ring buffer *) FreeByte : INT; (* Number of free spaces in the ring buffer *) Error : INT; (* Interface error code *) blocked :
BOOL; END_STRUCT END_TYPE 5.2 Data structures for the KL6xxx serial bus terminal in 3-byte mode For data exchange by way of the I/O bus, every serial bus terminal needs variables of type KL6inDataBC and KL6outDataBC. These variables are located at fixed addresses in the bus controller’s memory map, corresponding to the serial bus terminal’s mapping. KL6inDataBC TYPE KL6inDataBC STRUCT SerStatus : BYTE; D : ARRAY[0..2] OF BYTE; END_STRUCT END_TYPE KL6outDataBC TYPE KL6outDataBC STRUCT SerCtrl : BYTE; D :
ARRAY[0..2] OF BYTE; END_STRUCT END_TYPE 5.3 Data structures for the KL6xxx serial bus terminal in 5-byte mode For data exchange by way of the I/O bus, every serial bus terminal needs variables of type KL6inData5B and KL6outData5B. These variables are located at fixed addresses in the bus controller’s memory map, corresponding to the serial bus terminal’s mapping. KL6inData5B TYPE KL6inData5B STRUCT Status : BYTE; D : ARRAY[0..4] OF BYTE; END_STRUCT END_TYPE TX1200 12 Version: 1.1