Skip to content. | Skip to navigation

Personal tools

io.h

io.h

io.h

/////////////////////////////////////////////////////////////////////////////
// IO.H
//
//  Last updated: 3/17/1999
//
//  Part of the source code for the Vane End Actuator Control System
//
//  This file contains several low level I/O routines.
//
/////////////////////////////////////////////////////////////////////////////

// Serial communication constants (To Host)
char Address;  // Address of this computer (should be G)
char Prompt;   // Prompt character (should be :)
char Response; // Response to host computer character (should be ~)
int Host = 0;  // Host = COM1: = Port 0
int Guest = 1; // Downstream systems = COM2: = Port 1

/////////////////////////////////////////////////////////////////////////////
// Watchdog: Watchdog update function
void Watchdog();
// Watchdog() must be executed about once a second to keep the watchdog happy,
// or else the emergency stop card triggers.
//
// The watchdog is at address 0x247.  You can send any byte to it to keep
// it happy.

/////////////////////////////////////////////////////////////////////////////
// SafeDelay: Watchdog-safe Delay function
void SafeDelay(int DelayTime);
// This routine uses the Clock unit's Delay routine, but calls
// Watchdog() every 100 milliseconds.

/////////////////////////////////////////////////////////////////////////////
// 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();

/////////////////////////////////////////////////////////////////////////////
// RespondToHost: Transmit a string to the upstream host computer on COM1:
void RespondToHost(char *message);
// Send a message to the Host computer (upstream).
// 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.
//  ":HdataCC\r" where data is the body of the message, and CC is the
//  checksum.

/////////////////////////////////////////////////////////////////////////////
// RespondToHostWithChecksum: Add a hex checksum + CR to string and send
void RespondToHostWithChecksum(char* s);
// Calculates the Shec-checksum for a string, and sends the
// string to the host computer (TCS)

Generated by GNU Enscript 1.6.5.2.
Document Actions