mask = (1 << (bit_number % 8));
/* Check whether the request was to set or clear and mask accordingly */
if(val)
/* If the bit is to be set */
temp = temp | mask;
else
temp = temp & ~mask;
/* Update the image value with the value we're about to write */
port_images[bit_number / 8] = temp;
/* Now actually update the port. Only the specified bit is affected */
outportb(port,temp);
}
/*===========================================================================
* SET_BIT
*
*
* This function takes a single argument :
*
* bit_number : The bit number to set.
*
* This function sets the specified bit.
*
*===========================================================================*/
void set_bit(int bit_number)
{
write_bit(bit_number,1);
}
/*===========================================================================
* CLR_BIT
*
*
* This function takes a single argument :
*
* bit_number : The bit number to clear.
*
* This function clears the specified bit.
*
*===========================================================================*/
void clr_bit(int bit_number)
{
write_bit(bit_number,0);
}
/*===========================================================================
*
* ENAB_INT
*
* This function takes two arguments :
*
* bit_number : The bit number to enable intterups for. Range from 1 to 48.
Summary of Contents for EBC-LP
Page 68: ...APPENDIX C Mechanical Drawing...
Page 69: ......
Page 70: ......
Page 71: ...APPENDIX D WS16C48 I O Routines and Sample Program Listings...