Specifications

23
HARDWARE.C
/**************************************************************************/
/* File Name : HARDWARE.C */
/* File Type : C source file */
/* Created On : 05/04/95 */
/* Modified On: 05/24/95 */
/* Created By : Faisal Habib */
/* Description: This program will test the hardware interface for the */
/* TNT and MC68340. In particular it will test the three */
/* different types of I/O: Programmed, Interrupts, and DMA. */
/**************************************************************************/
/**************************************************************************/
/* WARNING : DO NOT USE THIS PROGRAM IF YOU USE AN INTERRUPT LEVEL OTHER */
/* THAN IRQ3 OF THE MC68340 AND A BASE ADDRESS OTHER THAN */
/* $FFFFE800. YOU CAN CHANGE THE BASE ADDRESS AND INTERRUPT */
/* LEVEL IN THE HEADER FILE AND RE-COMPILE THE SOURCE CODE. */
/* */
/* 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" /*340bug routines */
#include "MC68340.H" /*MC68340 register def. */
#include "TEST4882.H" /*TNT config. functions */
#include "HARDWARE.H" /*Hardware test header */
/**************************************************************************/
/* The main routine conducts three different types of tests and prints */
/* the final results. The three tests are: */
/* */
/* 1. Programmed I/O */
/* 2. Interrupt Driven I/O */
/* 3. DMA I/O */
/* */
/* To run the above tests, MC68340 and TNT4882 need to be configured. */
/**************************************************************************/
/**************************************************************************/
main()
{
char fail; /*var. for storing results*/
unsigned int counter;
fail = FALSE;
ConfigureMC(); /*configure MC68340 */
puts("\nMC68340 has been initialized.\n");
InitializeTNT(); /*initialize the TNT4882 */
puts("\nTNT4882 has been initialized.\n\n");
while (1)
{
switch (Select())
{
case 0: /*Test Interface once */
fail |= Programmed_IO_Test();
fail |= Interrupt_IO_Test();
/*fail |= DMA_IO_Test();*/
break;
case 1: /*Loop Test (500 times) */
for (counter=0;counter<500;++counter)










