Parallel Port C Reference Code
A-14
printf (”MySleep (0) consumes %d ticks\n”, overhead);
printf (”One Performance Counter tick = %g seconds\n”, Frequency);
printf (”To wait ten usec, wait for %g ticks\n”, (TEN_USEC/Frequency));
#endif
overhead = total/CALIBRATE_LOOPS;
*tb = time_base;
*ovrhd = overhead;
return_priority=SetPriorityClass(GetCurrentProcess(),NORMAL_PRIOR-
ITY_CLASS);
return(time_base);
}
// This routine can be used to insert a certain amount of delay in micro-
seconds
void MySleep(unsigned int sleep_time)
{
LARGE_INTEGER PerfCount1, PerfCount2, goal;
int return_priority;
QueryPerformanceCounter(&PerfCount1);
goal.QuadPart = PerfCount1.Qu sleep_time;
do
{
QueryPerformanceCounter(&PerfCount2);
} while (PerfCount2.QuadPart < goal.QuadPart);
return_priority=SetPriorityClass(GetCurrentProcess(),NORMAL_PRIOR-
ITY_CLASS);
}
// RESET the device
void DeviceReset() {
int control;
control=_inp(2);
_outp(2,control & 0xFB);
Sleep(10);
control=_inp(2);
_outp(2,control | 0x04);
control=_inp(2);
}
// Set the parallel port in the ECP mode
void setECP() {
_outp(0x402,0x20);
}
Summary of Contents for MSP53C691
Page 1: ...MSP53C691 Speech Synthesizer December 2000 MSDS Speech User s Guide SPSU020 ...
Page 22: ...2 10 ...
Page 96: ...C 6 ...