unsigned int Select( unsigned char Socket, unsigned char Queue ) { unsigned char index; index = Socket << 4 | Queue; Out32( PPORT_BASE+0, index ); Out32( PPORT_BASE+2, 0x01 ); Out32( PPORT_BASE+2, 0x00 ); Sleep( SelectDelay ); return( SelectDelay ); }
void dispNum(int n) { unsigned char val = digits[n]; printf("value - %x\n", val); Out32(PPORT_BASE,val); printf("after Out32(addr,data)\n"); }
void TimePixDAQStatus::parPortSetBusyLineHigh() { pthread_mutex_lock( &_parportMutex); int controlRegister = _Inp32( parPortControlReg ); //int new_register = 0; controlRegister &= 0xFE; Out32(parPortControlReg, controlRegister); pthread_mutex_unlock( &_parportMutex); }
void ParallelPort::PinHigh(const int p) // set pin (2:9) high { if (!initSuccess) return; if ((p < 2) | (p > 9)) return; short x = Inp32(port); short b = 1 << (p - 2); if (!(x & b)) { x += b; Out32(port, x); } }
void ParallelPort::PinLow(const int p) // set pin p (2:9) low { if (!initSuccess) return; if ((p < 2) | (p > 9)) return; short x = Inp32(port); short b = 1 << (p - 2); if (x & b) { x -= b; Out32(port, x); } }
int main(int argc, char *argv[]) { printf("Starting up...\n"); Out32(PPORT_BASE,0); exit(0); int i; for(i=1; i<512; i <<= 1) { printf("Snooze after writing %d\n",i); Sleep(1000); } printf("All done.\n"); return 0; }
unsigned int Fire( void ) { unsigned char index; index = (unsigned char)Inp32( PPORT_BASE+0 ); // Get the previous address Out32( PPORT_BASE+0, index | 0x80 ); // Fire socket (set high-order bit) Out32( PPORT_BASE+2, 0x01 ); // Begin strobe of STROBE Out32( PPORT_BASE+2, 0x00 ); // Begin strobe of STROBE Sleep( FireDelay ); Out32( PPORT_BASE+0, index & ~0x80 ); // Fire socket Out32( PPORT_BASE+2, 0x01 ); // Begin strobe of STROBE Out32( PPORT_BASE+2, 0x00 ); // Begin strobe of STROBE return( FireDelay ); }
void pwECP (unsigned char data) { if (!baseport) return; Out32((unsigned short)(baseport+ecpoffset+0x2),data); }
void pwControl (unsigned char data) { if (!baseport) return; Out32((unsigned short)(baseport+2),data); }
void pwData (unsigned char data) { if (!baseport) return; Out32(baseport,data); }