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.
Содержание EBC-LP
Страница 2: ...REVISION HISTORY P N 403 0306 000B ECO Number Date Code Rev Level ORIGINATED 030110 B 03 59 030530 B1...
Страница 68: ...APPENDIX C Mechanical Drawing...
Страница 69: ......
Страница 70: ......
Страница 71: ...APPENDIX D WS16C48 I O Routines and Sample Program Listings...