This software offers an RS-485 link and uLan protocol driver for Linux and Windows.
The use of 9-bit character simplifies the transfer of binary data and lowers the CPU load for intelligent controllers. This is because the CPU does not need to care about data characters sent to other nodes. Most microcontrollers for embedded applications have implemented 9-bit extension in UARTs of most of today's MCUs. The following is a list of some of them: all Intel 8051 and 8096 based MCUs with UART; members of Motorola 683xx family ( 68332, 68376, ... ); Hitachi H8 microcontrollers.
The driver is implemented as relatively independent layers and subsystems. Messages are prepared and received in the driver's dedicated memory, which is divided into blocks with uniform size with atomic allocation routines. When a message is stored into blocks, the head of the message with a couple of data bytes is stored in the first allocated memory block. If all data cannot be stored in the first block, next blocks are allocated and linked together.
The message heads are linked in bidirectional linked lists of messages that are prepared for sending, processed messages, and messages prepared for client notification. These lists or queues are the main mechanism for transferring messages between subsystems. The link protocol is programmed as a finite state automata with a state stack. The state routines are executed by an interrupt handler. The state routine can return positive integer information, negative error notification, or zero, which leads to waiting for the next interrupt.
When the state routine wants to initiate transfer to another state routine, it changes the pointer to the actual state routine. If the previous state routine returns a nonzero value, the new routine is called immediately, otherwise, the next interrupt invokes the new state routine. There is a stack of callers of actual state routines, which enables the construction of automata subsystems that can be used in more places in the main automata loop.
The main purpose of this automata is to send or process messages coming in a list of messages prepared for sending, and if specified, move these messages onto the list of messages prepared for client notification. Received messages are put onto this list too. The subsystem is supervised by a timeout handler, which can revitalize communication in case of die of the other node. The interrupt and timeout handlers are fully SMP reentrant.
The automata subsystem uses pointers to chip driver routines for hardware port manipulation. This is only a part dependent on the used chip, today 82510, 16450, and OX16C950PCI. These routines can send and receive 9 bit character, connect to RS-485 line by the arbitration sequence, wait for a specified time for character and initialize and close port.
The file operation subsystem makes interface between OS kernel VFS and client message queues, enabling the preparation of single or multi-frame messages and storing notifications of received or processed messages in clients' private state structures. This part is heavily operating system-dependent.
Version 0.7.4: N/A