12-59
DMA CONTROLLER
.
SetDMATargMemAddr(DMA_Channel1, lpsz); //Set target memory address
//Set transfer count
SetDMAXferCount(DMA_Channel1, strlen(lpsz) );
EnableDMAHWRequests(DMA_Channel1); //Begin transfer at SIO request
Real/Protected Mode:
No changes required
*****************************************************************************/
void InitDMA1ForSerialXmitter(void)
{
BYTE regDMACfg;
BYTE regDMAIE;
BYTE regDMAOvfE;
DisableDMAHWRequests(DMA_Channel1); /*Disable channel 1 Hardware requests*/
regDMACfg = (_GetEXRegByte(DMACFG) & 0x0F) | 0xA0;
_SetEXRegByte(DMACFG, regDMACfg); /*DMACFG[7]=1: mask DMA Acknowledge for*/
/* channel 1*/
/*DMACFG[6:4]=3: set channel request to*/
/* SIO’s channel 0’s transmit buffer*/
/* empty signal*/
/*DMAMSK[3:0]=unmodified: channel 0*/
/* settings*/
_SetEXRegByte(DMAMOD1, 0x9); /*DMAMOD1[7:6]=0: set to demand data-xfer*/
/* mode*/
/*DMAMOD1[5]=0: increment target*/
/*DMAMOD1[4]=0: disable autoinitialize*/
/* buffer-xfer mode*/
/*DMAMOD1[3:2]=2: data is xfer’d from targ.*/
/* to req.*/
/*DMAMOD1[1]=0: reserved*/
/*DMAMOD1[0]=1: selections for bits 7-2*/
/* affect channel 1*/
_SetEXRegByte(DMAMOD2, 0xD1); /*DMAMOD2[7]=1: Select 2-cycle data xfer*/
/*DMAMOD2[6]=1: Requester is in I/O space*/
/*DMAMOD2[5]=0: Target is in memory space*/
/*DMAMOD2[4]=1: Requester is held constant*/
/* thru xfer*/
/*DMAMOD2[3]=x: Req. Inc/Dec...see*/
/* DMAMOD2[4]*/
/*DMAMOD2[2]=0: Target address is*/
/* modified...see DMAMOD1[5]*/
/*DMAMOD2[1]=0: reserved*/
/*DMAMOD2[0]=1: selections for bits 7-2*/
/* affect channel 1*/