2.5 Demo Program
A common demo program is used for all P1602.dll examples. The demo program
will accept
wDaFreq
and
wAdClk
and call the different driver functions for
demonstration purposes.
#include <windows.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>
#include "P1602.H"
/********************************************************************/
/* DEMO1 program for one P1602 cards in the PC system.
*/
/* Please set the resolution of your monitor to at least 1024*768 */
/********************************************************************/
/* First Card: some P1602 function call demo.
*/
/* For the proper operation the P1602, the following functions */
/* must be used. */
/* P1602_DriverInit(); <-- initial the driver
*/
/* P1602_DriverClose(); <-- close the driver
*/
/********************************************************************/
short
nDMA=-1, nIRQ=-1; // not used
WORD wBase=0x220,wAdBuf[510],wFlag=0,wAddrCtrl;
int iLine;
DWORD dwDaNum=90,dwAdClk=24;
WORD wTotalBoard,wInitialCode;
void READ_CMD(char
*);
short ASCII_TO_HEX(char);
void
TEST_CMD(HWND, int, int, int, int);
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
void SHOW_WAVE(HWND hwnd);
/* ---------------------------------------------------------------- */
int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
PSTR szCmdLine, int iCmdShow)
{
static char szAppName[] = "P1602 Demo1";
HWND
hwnd ;
MSG
msg ;
WNDCLASSEX wndclass ;
wndclass.cbSize
= sizeof(wndclass);
wndclass.style = CS_HREDRAW|CS_VREDRAW;
wndclass.lpfnWndProc = WndProc;
wndclass.cbClsExtra = 0;
wndclass.cbWndExtra = 0;
wndclass.hInstance = hInstance;
wndclass.hIcon = LoadIcon(NULL, IDI_APPLICATION);
wndclass.hCursor
= LoadCursor(NULL, IDC_ARROW);
wndclass.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
wndclass.lpszMenuName = NULL;
wndclass.lpszClassName = szAppName;
wndclass.hIconSm
= LoadIcon(NULL, IDI_APPLICATION);
24
Содержание OME-PCI-1602
Страница 37: ... Demo Program DEMO9 C 37 ...