temp = inportb(port);
/* Get current polarity settings */
/* Set the polarity according to the argument in the image value */
if(polarity)
/* If the bit is to be set */
temp = temp | mask;
else
temp = temp & ~mask;
/* Write out the new polarity value */
outportb(port,temp);
/* Set access back to Page 0 */
outportb(ba7,0x0);
}
/*===========================================================================
*
* DISAB_INT
*
* This function takes a single argument :
*
* bit_number : Specifies the bit number to act upon. Range is from 1 to 48.
*
* This function shuts off the interrupt enabled for the specified bit.
*
*===========================================================================*/
void disab_int(int bit_number)
{
unsigned port;
unsigned temp;
unsigned mask;
/* Adjust the bit_number for 0 based numbering */
--bit_number;
/* Calculate the I/O Address for the enable port */
port = (bit_number / 8) + bas 8;
/* Calculate the proper bit mask for this bit number */
mask = (1 << (bit_number % 8));
/* Turn on access to page 2 registers */
outportb(ba7,0x80);
/* Get the current state of the enable register */
temp = inportb(port);
/* Clear the enable bit int the image for our bit number */
temp = temp & ~mask;
/* Update the enable register with the new information */
outportb(port,temp);
/* Set access back to page 0 */
outportb(ba7,0x0);
}
/*==========================================================================
*
* CLR_INT
*
* 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;