VersatecHeadSunImpl.mesa
Copyright Ó 1989, 1991 by Xerox Corporation. All rights reserved.
Dave Rumph, May 1, 1989 7:05:19 pm PDT
Sun implementation of VersatecFace, the PCedar2.0 Face for the Versatec "green sheet" interface. See also VersatecHeadSoftcardImpl.mesa, for the Softcard implementation.
~
BEGIN
OPEN VersatecFace;
Initialize:
PUBLIC
PROC
RETURNS [ok:
BOOL] ~ {
Do whatever setup is required before the Versatec port can be accessed.
DoIt:
PROC
RETURNS [ok:
BOOL] ~
TRUSTED
MACHINE
CODE {
"SVInitialize"
};
RETURN[DoIt[]];
};
Finalize:
PUBLIC
PROC ~ {
Do whatever shutdown is required after the Versatec port access is done.
DoIt:
PROC ~
TRUSTED
MACHINE
CODE {
"SVFinalize"
};
DoIt[];
};
OnLine:
PUBLIC PROC
RETURNS [onLine:
BOOL] ~ {
DoIt: PROC RETURNS [onLine: BOOL] ~ TRUSTED MACHINE CODE {"SVOnLine"};
RETURN[DoIt[]];
};
Ready:
PUBLIC PROC
RETURNS [ready:
BOOL] ~ {
DoIt: PROC RETURNS [ready: BOOL] ~ TRUSTED MACHINE CODE {"SVReady"};
RETURN[DoIt[]];
};
Reset:
PUBLIC
PROC ~ {
Reset the Versatec printer.
DoIt:
PROC ~
TRUSTED
MACHINE
CODE {
"SVReset"
};
DoIt[];
};
SetMode:
PUBLIC
PROC [mode: Mode] ~ {
Set the mode.
DoIt:
PROC [mode: Mode] ~
TRUSTED
MACHINE
CODE {
"SVSetMode"
};
DoIt[mode];
};
SendRCommand:
PUBLIC
PROC [cmd: RCommand]
RETURNS [ok:
BOOL] ~ {
A call to this procedure send a pulse on one of the remote command lines (the pulse length complies with the specs)
This procedure is waiting for the command to terminate or the printer go OFF Line before returning (OK is FALSE if the printer went OFF Line)
DoIt:
PROC [cmd: RCommand]
RETURNS [ok:
BOOL] ~
TRUSTED
MACHINE
CODE {
"SVSendRCommand"
};
RETURN[DoIt[cmd]];
};
SendOneByte:
PUBLIC
PROC [data:
BYTE]
RETURNS [ok:
BOOL] ~ {
Sends one byte to the interface, without waiting for completion. Return value of FALSE indicates the Versatec is offline.
DoIt:
PROC [data:
BYTE]
RETURNS [ok:
BOOL] ~
TRUSTED
MACHINE
CODE {
"SVSendOneByte"
};
RETURN[DoIt[data]];
};
SendBuffer:
PUBLIC
PROC [addr: BufferAddress, bytes:
CARD, dmaPerTransferCount:
CARD ¬ 0]
RETURNS [ok:
BOOL] ~ {
Send count bytes of data starting at addr. On the softcard, it doesn't wait 'til the transfer is finished before returning, but does wait for a first transfer to finish before starting a second one. A value other than 0 for dmaPerTransferCount causes the dma transfers to occur in units of dmaPerTransferCount bytes. This is here to optimize smoothness of printing. Suggested use: either the scanline length or the page length (but the Sun hardware and kernel limit it to 63K!)
DoIt:
PROC [addr: BufferAddress, bytes, dmaPerTransferCount:
CARD]
RETURNS [ok:
BOOL] ~
TRUSTED
MACHINE
CODE {
"SVSendBuffer"
};
RETURN[DoIt[addr, bytes, dmaPerTransferCount]];
};
Abort:
PUBLIC
PROC ~ {
Try to abort the transfer of data to the Versatec.
DoIt:
PROC ~
TRUSTED
MACHINE
CODE {
"SVAbort"
};
DoIt[];
};
Init:
PROC ~
TRUSTED
MACHINE
CODE {
Start up the Slave IOP down in the underlying C code.
"SVStartUp"
};