/* Acquisition And Control Of Linear CCDSensors Using EPP Protocol Radovan Stojanovic Applied Electronics Lab, Department of ECE University of Patras, Greece */ #include #include #define PIXELS 2088 #define INTR 7 /* IRQ7 */ int l[2500]; /*data vector*/ int port; /*port address */ void interrupt( *oldhandler ) ( void ); void far interrupt scan( void ) /*acquisition routine */ { int i; disable( ); outportb( port+4, 255 ); /*generate SL*/ for( I = 0; I <= 2100; i++) /*acquire pixels*/ l[i] = inportb( port+4 ); enable( ); outp( 0x20, 0x20 ); } main( ) { int i, j, oldmask, a; port = peek( 0x40, 8 ); /* set-up interrupt */ oldhandler = getvect( INTR | 0x08 ); oldmask = inp( 0x21 ); a = inp( port+2 ); a = a | 0x10; outp( port+2, a ); setvect( INTR | 0x08, scan ); outp( 0x21, oldmask & ( 0x0ff ^ ( 0x01 << INTR ))); outp( 0x20, 0x20 ); for( ; ; ) { /*processing routines*/ } }