Intel 386 Computer Hardware User Manual


 
Intel386™ EX EMBEDDED MICROPROCESSOR USER’S MANUAL
12-54
Description:
Sets the requester to an I/O port address, wIO, for the DMA
channel specified by nChannel.
Parameters:
nChannel --channel for which to set Requester I/O port address
wIO --I/O address
Returns:
None
Assumptions:
None
Syntax:
SetDMAReqIOAddr(DMA_Channel1, TBR0); //Sets Req. to Serial Receiver
Real/Protected Mode:
No changes required
*****************************************************************************/
int SetDMAReqIOAddr(int nChannel, WORD wIO)
{
WORD addrDMAReq0_1;
WORD addrDMAReq2_3;
/*Check input*/
if ( (nChannel != DMA_Channel0) && (nChannel != DMA_Channel1) )
return ERR_BADINPUT;
/*Set registers to correct channel*/
addrDMAReq0_1 = ( nChannel == DMA_Channel0 ? DMA0REQ0_1 : DMA1REQ0_1);
addrDMAReq2_3 = ( nChannel == DMA_Channel0 ? DMA0REQ2_3 : DMA1REQ2_3);
_SetEXRegByte(DMACLRBP, 0x0); /* Clear the byte pointer flip-flop */
/* Write requester I/O address, bits 0-7 */
_SetEXRegByte(addrDMAReq0_1, (BYTE) (wIO & 0xFF));
/* Write requester I/O address, bits 8-15 */
_SetEXRegByte(addrDMAReq0_1, (BYTE) ((wIO >> 8) & 0xFF));
_SetEXRegByte(addrDMAReq2_3, 0x00); /* Zero requester address bits 16-23 */
_SetEXRegByte(addrDMAReq2_3, 0x00); /* Zero requester address bits 24-25 */
return ERR_NONE;
}
/*****************************************************************************
SetDMATargMemAddr: