beautypg.com

Intel 386 User Manual

Page 393

background image

Intel386™ EX EMBEDDED MICROPROCESSOR USER’S MANUAL

12-58

Syntax:

InitDMA(); //Initialize DMA peripheral

Real/Protected Mode:

No changes required

*****************************************************************************/

void InitDMA(void)

{

_SetEXRegByte(DMACLR, 0x0); /*Resets DMA peripheral*/

_SetEXRegByte(DMACMD1, 0x0); /*DMACMD1[7:5]=0: reserved*/

/*DMACMD1[4]=0: disable priority rotation*/

/* enable*/

/*DMACMD1[2]=0: enable channel’s 0 and 1*/

/*DMACMD1[1:0]=0: reserved*/

_SetEXRegByte(DMACMD2, 0x8); /*DMACMD2[7:4]=0: reserved*/

/*DMACMD2[3:2]=2: assign HOLD to the lowest*/

/* priority level*/

/*DMACMD2[1]=0: EOP# samples input async.*/

/*DMACMD2[0]=0: DRQn samples input async.*/

}

/*****************************************************************************

InitDMA1ForSSIXmitterToMem:

Description:

This function prepares DMA channel 1 for transfers between the async.

serial port transmitter (channel 0) and memory. After calling this

function, a DMA transfer can be initiated by setting the Target address,

setting the transfer count, and clearing the hardware request mask

for this DMA channel.

Parameters:

None

Returns:

None

Assumptions:

InitDMA() has been called to enable the peripheral.

Syntax:

static char lpsz[]=”Hello World”;

InitDMA(); //Initialize DMA peripheral

InitDMA1ForSerialXmitter(); //Initialize DMA channel 1

.

.