Specifications

26
formed.\n\n");
return ERROR;
}
else
{
Failure = FALSE;
EnableMC68340Interrupts;
IMR3 = E_NFF; /*write to fifo */
while (IMR3 & E_NFF);
EnableMC68340Interrupts;
IMR3 = E_NEF; /*read from fifo */
while (IMR3 & E_NEF);
}
return Failure;
}
/**************************************************************************/
/**************************************************************************/
/* Module : DMA_IO_Test() */
/* Parameters : NONE */
/* Return Type : char */
/* Created On : 05/04/95 */
/* Modified On : 05/17/95 */
/* Description : Performs DMA I/O tests */
/* Reference : MC68340 & TNT4882 Application Notes */
/**************************************************************************/
/**************************************************************************/
char DMA_IO_Test()
{
unsigned short int StoreBuf[] =
{'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p'};
unsigned short int ReceiveBuf[16];
puts("\nPerforming DMA I/O Test.\n");
HSSEL = E_ONEC; /*one-chip mode */
CMDR = RstFIFO; /*reset the FIFOs */
CFG = 0x11; /*GPIB Write */
puts(" Performing WRITE to FIFOs using DMA");
if (SetupDMA(READ,16,StoreBuf) == ERROR) return ERROR;
StartDMA;
while (BTC1);
CFG = 0x01; /*GPIB Read */
puts(" Performing READ from FIFOs using DMA");
if (SetupDMA(WRITE,16,ReceiveBuf) == ERROR) return ERROR;
StartDMA;
while (BTC1);
return Compare(StoreBuf,ReceiveBuf);
}
/**************************************************************************/
/**************************************************************************/
/* Module : SetupDMA() */
/* Parameters : unsigned char,unsigned int,unsigned short int* */
/* Return Type : char */
/* Created On : 05/15/95 */
/* Modified On : 05/17/95 */
/* Description : Sets and configures the DMA channels for READ or WRITE */
/* For a different configuration, change the values in the */
/* HARDWARE.H file. */
/* */
/* Reference : MC68340 & TNT4882 Application Notes */