Specifications

30
TEST4882.C
/**************************************************************************/
/* File Name : TEST4882.C */
/* File Type : C source file */
/* Created On : 05/04/95 */
/* Modified On: 05/24/95 */
/* Created By : Faisal Habib */
/* Description: This file contains routines that are used by the hardware */
/* test program to test the MC68340 & TNT4882 Interface. */
/**************************************************************************/
/**************************************************************************/
/* WARNING : THIS PROGRAM USES THE MC340BUG LIBRARY. THEREFORE TRAP #15 */
/* IS NOT AVAILABLE FOR USER PROGRAMS. PLEASE REFRAIN FROM */
/* USING TRAP #15 CALLS. */
/**************************************************************************/
#include "REGISTER.H" /*TNT Register Definitions */
#include "MC340BUG.H" /*340 BUG Monitor routines */
#include "TEST4882.H" /*Header file for TEST4882.C */
/**************************************************************************/
/* Global arrays containing test patterns for 16 bit tests. These arrays*/
/* are used in the following routines: */
/* */
/* Test16BitRegister() */
/* Test8Write16Read() */
/* Test16Write8Read() */
/**************************************************************************/
unsigned char TestBit8[14] =
{0x00,0xFF,0xAA,0xCC,0xF0,0xFF,0x00,0xFF,0xAA,0xCC,0xF0,0x00};
unsigned short int TestBit16[7] = {0x0000,0xFFFF,0xAAAA,0xCCCC,0xF0F0,0xFF00};
/**************************************************************************/
/* Module : handler() */
/* Parameters : NONE */
/* Return Type : void */
/* Created On : 05/04/95 */
/* Modified On : 05/10/95 */
/* Description : Handler for GPIB I/O. This routine is entered when the */
/* TNT chip asserts its interrupt signal. The interrupts*/
/* should be enabled for interrupts to occur. */
/* */
/* The handler handles two cases of interrupts. These cases*/
/* are INPUT,and OUTPUT. The handler can be easily */
/* expanded by providing other cases in the IF-ELSE. */
/**************************************************************************/
/**************************************************************************/
interrupt void handler()
{
if (ISR3 & IMR3 & E_NFF) /*FIFO is not full */
{
IMR3 &= ~E_NFF; /*clear the source of interrupt */
Failure |= InterruptWriteTest(); /*perform the write test */
}
else if (ISR3 & IMR3 & E_NEF) /*FIFO is empty */
{
IMR3 &= ~E_NEF; /*clear the source of interrupt */
Failure |= InterruptReadTest(); /*perform the read test */
}
else puts("ERROR !! False Interrupt Occurred.");