home *** CD-ROM | disk | FTP | other *** search
- /*
- Copyright 1990 by John Wiley & Sons, Inc.
- All Rights Reserved.
- */
- /*********************************************************/
- /*** Listing P2Ch3L2 ***/
- /*** Video Digitizer Test Program One ***/
- /*** written in Turbo C ***/
- /*** by ***/
- /*** Craig A. Lindley ***/
- /*** ***/
- /*** Ver: 1.0 Last Update: 08/04/89 ***/
- /*********************************************************/
-
- #include <stdio.h>
- #include <conio.h>
-
- #include "digitizer.h"
-
- #define MaxBitNum 9 /* 10 bit counter 0 .. 9 */
-
- /*
- This program is used to test the pixel count latches on the digitizer.
- It will set each of the 10 bits high sequentially, so they can be
- checked with a meter.
- */
-
-
- void main( void )
- {
- struct ImageReq Req; /* ImageReq structure */
- unsigned BitShift, BitPattern;
-
- /*
- Build a structure that defines what the digitizer should acquire.
- This will be passed to the digitizer by a call to InitializeDigitizer
- function. This also tells the low level code where the digitizer
- is attached.
- */
-
- Req.ComputerType = PS220;
- Req.PrtBase = 0x3BC;
- Req.HMode = LowRes;
- Req.VMode = NonInterlace;
- Req.NumberOfPasses = 1;
- Req.Flags = 0L;
- Req.FirstLine = 0;
- Req.FirstPixel = 0;
- Req.LastLine = 200;
- Req.LastPixel = 320;
-
- InitializeDigitizer(&Req); /* initialize the digitizer */
-
- clrscr();
- printf("Digitizer Test Program One - Pixel Counter Latch Test\n\n");
- printf("Each bit from LSB to MSB will be set to a high level\n");
- printf("with all other bits set low.\n");
- printf("The output of the pixel latches should be checked with\n");
- printf("with a meter at the following locations on the digitizer\n\n");
- printf("Bit Number - 9 8 7 6 5 4 3 2 1 0\n");
- printf("Device Pin # 1 15 9 10 1 15 9 10 1 15\n");
- printf("Device # |IC12| |--- IC11 --| |--- IC10 --|\n\n");
- printf("A low is < .8 VDC and a high is > 2.5 VDC\n\n");
-
- SetPixelCount( 0 ); /* set all bits to zero */
- printf("All bits of the pixel counter latch should now be low\n");
-
- for (BitShift=0; BitShift <= MaxBitNum; BitShift++)
- {
- printf("Press any key to continue\n\n");
- getch();
- BitPattern = 1 << BitShift;
- SetPixelCount( BitPattern );
- printf("Test bit pattern is: %x\n",BitPattern);
- }
- printf("Test Completed\n");
- }
-