Specifications

27
/**************************************************************************/
/**************************************************************************/
char SetupDMA(unsigned char ioType,unsigned int count,unsigned short int *buffer)
{
DMAMCR1 = DMA_CONF;
INTR1 = DMA_INTR;
CCR1 = 0;
CSR1 = 0x7C; /*clear status register */
FCR1 = DMA_SPACE; /*set for DMA space */
BTC1 = count; /*set the number of bytes */
switch (ioType)
{
case READ: /*READ from Memory */
CCR1 = DMA_READ;
SAR1 = (unsigned int)buffer;
break;
case WRITE: /*WRITE to Memory */
CCR1 = DMA_WRITE;
DAR1 = (unsigned int)buffer;
break;
default: /*This should never happen*/
puts("ERROR!! Incorrect I/O type for DMA");
return ERROR;
}
return FALSE;
}
/**************************************************************************/
/**************************************************************************/
/* Module : Compare() */
/* Parameters : unsigned short int*,unsigned short int* */
/* Return Type : char */
/* Created On : 05/04/95 */
/* Modified On : 05/15/95 */
/* Description : Compares the two arrays and displays an error message */
/* if mismatch occurs */
/* Reference : MC68340 & TNT4882 Application Notes */
/**************************************************************************/
/**************************************************************************/
char Compare(unsigned short int *s,unsigned short int *r)
{
char result;
int i;
result = FALSE;
for (i=0;i<16;++i)
if(s[i] != r[i]) /*if different then show */
{ /* error message. */
DisplayErrorMessage(r[i],s[i]);
result = ERROR;
}
return result;
}
/**************************************************************************/
/**************************************************************************/
/* Module : Select() */
/* Parameters : NONE */
/* Return Type : char */