Intel 386 User Manual

Page 388

Advertising
background image

12-53

DMA CONTROLLER

/* given channel*/

}

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

DisableDMAHWRequests:

Description:

Disables channel hardware requests for the given DMA channel.

The channel, however, can still receive software requests.

Parameters:

nChannel

--channel to mask hardware requests

Returns:

Error Code

Assumptions:

None

Syntax:

int error_code;

error_code = DisableDMAHWRequests(DMA_Channel0);

Real/Protected Mode:

No changes required

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

int DisableDMAHWRequests(int nChannel)

{

WORD regDMAMSK = 0;

//Check input

if ( (nChannel != DMA_Channel0) && (nChannel != DMA_Channel1) )

return ERR_BADINPUT;

regDMAMSK = nChannel;

//Set regDMAMSK[CS] to channel

regDMAMSK &= 0x04;

//Set regDMAMSK[HRM]

_SetEXRegByte(DMAMSK, regDMAMSK);

//Set hw request mask for given

//channel

return ERR_NONE;

}

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

SetDMAReqIOAddr:

Advertising