WinSystems EBC-LP Operation Manual page 79

Small, high-performance, embeddable computer system on a single board
Table of Contents

Advertisement

/*==========================================================================
*
*
*
*
This function takes a single argument :
*
*
bit_number : This argument specifies the bit interrupt to clear. Range
*
is 1 to 24.
*
*
*
This function is use to clear a bit interrupt once it has been recognized.
*
The interrupt left enabled.
*
*===========================================================================*/
void clr_int(int bit_number)
{
unsigned port;
unsigned temp;
unsigned mask;
/* Adjust for 0 based numbering */
--bit_number;
/* Calculate the correct I/O address for our enable register */
port = (bit_number / 8) + base_port + 8;
/* Calculate a bit mask for this bit number */
mask = (1 << (bit_number % 8));
/* Set access to page 2 for the enable register */
outportb(base_port+7,0x80);
/* Get current state of the enable register */
temp = inportb(port);
/* Temporarily clear only OUR enable. This clears the interrupt */
temp = temp & ~mask;
/* Write out the temporary value */
outportb(port,temp);
/* Re-enable our interrupt bit */
temp = temp | mask;
/* Write it out */
outportb(port,temp);
/* Set access back to page 0 */
outportb(base_port+7,0x0);
CLR_INT
/* clear the enable for this bit */

Advertisement

Table of Contents
loading

Table of Contents