The 512 driver interface, 1 x12param structure – Sensoray 512 DOS User Manual

Page 14

Advertising
background image

14

6. The 512 Driver Interface


All the functions of the 512 DOS device driver are called via the x86 software interrupt mechanism. The
interrupt number used for all the SDK functions is X12_INT. To use the functions, the file SX12.H must be
included in the application source files.

Example:

#include “sx12.h” //Included for 512 dos driver support
#include “dos.h” //Included for software interrupt support
.
.
.
X12PARAM _far *Param; //Declare a pointer to an X12PARAM object
union REGS regs; //
.
.
.
regs.x.si = X12_GETCMDPARAPTR + CARD0; //Select the driver function
int86(X12INT,&regs,&regs); //Call the driver
Param = (X12PARAM _far *) MK_FP(regs.x.dx, regs.x.ax); //Make a pointer from the returned register values


The 512 driver has two function calls. The first, X12_GETCMDPARAPTR, gets a pointer to a parameter
structure and the second, X12_SENDCOMMAND, sends a command to the 512 driver and board.

6.1 X12PARAM structure


typedef struct
{
unsigned short Mode;
short Reserved1;
unsigned long VQSize;
short Input;
short InputType;
short Reserved4;
unsigned short DI0;
unsigned short DI1;
unsigned short DI2;
unsigned short DO0;
unsigned short DO1;
unsigned short DO2;
unsigned short DDIR0;
unsigned short DDIR1;
unsigned short DDIR2;
short Reserved5;
short Reserved6;
unsigned short DroppedFrames;
long Length;
unsigned long FrameCount;
short Status;
void _far *Buffer;
} X12PARAM;

Advertising