Skip to content. | Skip to navigation

Personal tools

remote/io.h

remote/io.h

remote/io.h

/////////////////////////////////////////////////////////////////////////////
// IO.H
//
//  Last updated: 6/22/2005
//
//  Part of the source code for the remote M3 Program
//
//  This file contains several low level I/O routines.
/////////////////////////////////////////////////////////////////////////////

// Serial communication constants (to Guest)
char Address;  	// Address of this computer (should be J)
char Prompt;   	// Prompt character (should be :)
char Response; 	// Response to host computer character (should be ~)
int Slave = 0;  // Slave = COM1: = Port 0
int Host = 1; // Upstream computer (TCS)

// Current analog data
double AnalogData[4];

/////////////////////////////////////////////////////////////////////////////
// SystemReset - Software based system reset function
void SystemReset();
// Perform a hardware reset on the system.

/////////////////////////////////////////////////////////////////////////////
// InitPorts - Function to configure the serial port parameters and install
// the serial interrupt driver
void InitPorts();

/////////////////////////////////////////////////////////////////////////////
// SendToSlave - Transmit a string to the downstream guest computer on COM1:
void SendToSlave(char *message);
// Send a message to the Guest computer (downstream).
// The string "message" is transmitted.
// This routine automatically adds the correct Response and
// Address characters to the beginning of the string.

/////////////////////////////////////////////////////////////////////////////
// VerifyChecksum: Verifies that the checksum in a string is correct
int VerifyChecksum(char* s);
// Returns a zero if the string's checksum is OK, and a 1 if not.
// Note that this routine expects a full message, i.e.
//  ":JdataCC\r" where data is the body of the message, and CC is the
//  checksum.

// Modified for the moment while we use the "video" feature of SBC1190
/////////////////////////////////////////////////////////////////////////////
// SendToSlaveWithChecksum: Add a hex checksum + CR to string and send
char *SendToSlaveWithChecksum(char* s,char *line);
// Calculates the Shec-checksum for a string, and sends the
// string to the guest computer (TCS)

/////////////////////////////////////////////////////////////////////////////
// COMTerminal - opens a simple terminal with a com port
void COMTerminal(int Port);
// This routine acts as a simple terminal to a com port.
// It displays received characters, and transmits typed characters.
// Hitting ESC ends the terminal session.

Generated by GNU Enscript 1.6.5.2.
Document Actions