/* **CMS**=C_INC ============================================================================= Abs: PC <--> Knobs box message structures & definitions. Copied from pkpkmsgs.h and pknmsg_p.h Name: drvKnobScpBox.h Prev: slc_macr.hc For charu pkparams.hc LEGEND_SIZE Auth: 19-Oct-1995, Robert C. Sass (RCS) Rev: 07-Dec-1995, Ron Chestnut (RON) ----------------------------------------------------------------------------- Mod: 19-Dec-1995, Robert C. Sass (RCS) MAX_SERIAL_RETRIES = 10000 to allow for faster CPUs ============================================================================= */ /* ** Message id definitions. */ #ifndef DRV_KNOB_SCP_BOX_H /* guard macro */ #define DRV_KNOB_SCP_BOX_H /* guard macro */ #ifdef __cplusplus extern "C" { #endif #define TKRQST_COUNT 0x81 /* To knob, request count */ #define FKREPLY_COUNT 0x82 /* From knob count reply */ #define TKLEGEND_UPDATE 0x83 /* To knob legend update */ #define TKRQST_RESET 0x84 /* To knob request status reset */ #define TKSET_COUNT 0x85 /* To knob set counter */ #define TKRQST_STATUS 0x86 /* To knob request status */ #define FKREPLY_STATUS 0x87 /* From knob status reply */ /* ** The base extra COM port for bios_serialcom, COM3 thru COMn ** are not defined in bios.h. Zero based port for COM3. */ #define COMBASE 2 /* ** Base I/O address of first RS485 line and increment for each ** subsequent line. Need only at initialization. */ #define IOBASE 0x280 #define IOBASE_INCREMENT 0x8 /* ** Max # times we retry a serial operation. Make it large ** to allow for faster CPUs. */ #define MAX_SERIAL_RETRIES 10000 // Max times to retry a serial operation /* ** Some standard ASCII chars */ #define CR 0xD #define CTRL_B 2 /* ** **************************************************************** ** 82510 UART register defines. These are offsets in relation to the ** base address and are the same as those found in the INTEL 82510 ** data sheet. We only define the ones we need. ** **************************************************************** */ /* ** bank 0 registers */ #define BAL 0 #define BAH 1 #define GIR 2 #define LCR 3 /* ** bank 2 registers */ #define TMD 3 /* ** ******************************************************** ** Message structures exchanged twixt PC and the knobs box. ** ******************************************************** */ typedef struct /* header common to all PC-knobs messages */ { charu ctrl_b; /* control-b ascii code */ charu knobcpu; /* knob which is miranova cpu address */ charu func; /* function code */ }pkhead_ts; typedef struct /* tail common to all PC-knobs messages */ { charu checksum; /* msg checksum */ charu cr; /* ascii carriage return code */ }pktail_ts; /* ** Struct for the 3 request messages differentiated only by ** function code. */ typedef struct /* TKRQST_COUNT, TKRQST_RESET */ { /* & TKRQST_STATUS msg struct */ pkhead_ts pkhead; /* PC-knob message header */ pktail_ts tail; /* PC-knob message tail */ }tkrqst_ts; /* ** Struct for the legend update message. */ typedef struct /* TKLEGEND_UPDATE msg struct */ { /* Variable length structure */ pkhead_ts pkhead; /* PC-knob message header */ char ledset; /* LED set (0-3) in box */ char ledindex;/* LED index (0-15) for text start */ char legend[LEGEND_SIZE]; /* max chars to write to LEDs */ pktail_ts tail; /* Message tail */ }tklegend_update_ts; /* ** Struct to set counter */ typedef struct /* TKSET_COUNT msg struct */ { pkhead_ts pkhead; /* PC-knob message header */ charu low; /* Low byte of count */ charu hi; /* Hi byte of count */ pktail_ts tail; /* Message tail */ }tkset_count_ts; /* ** Count reply message from knob. */ typedef struct /* FKREPLY_COUNT msg struct */ { pkhead_ts pkhead; /* PC-knob message header */ charu low; /* Low byte of count */ charu hi; /* Hi byte of count */ charu status; /* Knob box/comm status */ pktail_ts tail; /* Message tail */ }fkreply_count_ts; /* ** Status reply message from knob */ typedef struct /* FKREPLY_STATUS msg struct */ { pkhead_ts pkhead; /* PC-knob message header */ charu status; /* Knob box/comm status */ pktail_ts tail; /* Message tail */ }fkreply_status_ts; int PKNmsg_Init_Box (const char *node, int box, int *socknum_p, struct sockaddr_in *sockaddr_ps, struct sockaddr_in *boxsockaddr_ps, char *connected); vmsstat_t PKNmsg_Clear_Count (const char *node, charu knobcpu, unsigned *osstatus_p, box_ts *box_ps); vmsstat_t PKNmsg_Rqst_Count (const char *node, charu knobcpu, unsigned *osstatus_p, box_ts *box_ps, int16_t *ocount_p); vmsstat_t PKNmsg_Reply_Count (const char *node, charu knobcpu, int16_t *ocount_p, unsigned *osstatus_p, box_ts *box_ps); vmsstat_t PKNmsg_Legend_Update (const char *node, charu firstcpu, char ledset, char ledindex, char *ibuf_p, unsigned *osstatus_p, box_ts *box_ps); vmsstat_t PKNmsg_Rqst_Reset (const char *node, charu knobcpu, unsigned *osstatus_p, box_ts *box_ps); #ifdef __cplusplus }; #endif #endif /* DRV_KNOB_SCP_BOX_H guard macro */