Model Railroad System
2.2.2
|
CMR/I Tcl Serial Port Interface. More...
Classes | |
class | CMri |
Main C/MRI interface class. More... | |
Typedefs | |
typedef int | uatype |
Board address type. More... | |
typedef int | ubyte |
Unsigned byte. More... | |
typedef listtype | ByteList |
List of bytes. More... | |
Enumerations | |
enum | CardType { USIC , SUSIC , SMINI } |
Card type codes. More... | |
CMR/I Tcl Serial Port Interface.
This is a cross-platform implementation of Bruce Chubb's C/MRI QBASIC serial port code ported to Tcl. This code has been tested with Tcl 8.4.
Basically, the way this code works is to use a SNIT class (described on in CMri) to interface to the serial port, which may have one or more serial port cards (a mix of USICs, SUSICs, and SMINIs). A given class instance interfaces to all of the cards on attached to a given serial port. There are three public member functions, one to initialize a given board (described in CMri::InitBoard), one to set the output ports (described in CMri::Outputs), and one to poll the state of the input ports (described in CMri::Inputs).
I was inspired to write this code after reading the four part series in Model Railroader and reading the download package for the SMINI card. I already have a copy of Bruce Chubb's Build Your Own Universal Computer Interface, but the SMINI looks like a great option for small `‘remote’' locations of a layout where there are a few turnouts and a some signals, such as a small junction, interchange yard, or isolated industrial spur.
Cmri 2.0.0
list< cmri::ubyte > cmri::ByteList |
List of bytes.
Contains a list of unsigned bytes.
int cmri::uatype |
Board address type.
An integer in the range from 0 to 127, inclusive.
unsigned char cmri::ubyte |
Unsigned byte.
8-bit unsigned byte.
enum cmri::CardType |