*
* This function initializes all I/O pins for input, disables all interrupt
* sensing, and sets the image values.
*
*===========================================================================*/
void init_io(unsigned io_address)
{
int x;
/* Save the specified address for later use */
base_port = io_address;
/* Clear all of the I/O ports. This also makes them inputs */
for(x=0; x < 7; x++)
outportb(bax, 0);
/* Clear our image values as well */
for(x=0; x < 6; x++)
port_images[x] = 0;
/* Set page 2 access, for interrupt enables */
outportb(ba7,0x80);
/* Clear all interrupt enables */
outportb(ba8,0);
outportb(ba9,0);
outportb(ba0x0a,0);
/* Restore normal page 0 register access */
outportb(ba7,0);
}
/*===========================================================================
*
* READ_BIT
*
*
* This function takes a single argument :
*
*
* bit_number : The integer argument specifies the bit number to read.
* Valid arguments are from 1 to 48.
*
* return value : The current state of the specified bit, 1 or 0.
*
* This function returns the state of the current I/O pin specified by
* the argument bit_number.
*
*===========================================================================*/
int read_bit(int bit_number)
{
unsigned port;
int val;
Summary of Contents for EBC-BX
Page 72: ...8 APPENDIX C EBC BX Parts Placement Guide Top 030923 OPERATIONS MANUAL EBC BX Page 8 1...
Page 73: ...EBC BX Parts Placement Guide Bottom Page 8 2 OPERATIONS MANUAL EBC BX 030923...
Page 74: ...9 APPENDIX D EBC BX Parts List...
Page 82: ...10 APPENDIX E EBC BX Mechanical Drawing...
Page 83: ......
Page 84: ...11 APPENDIX F WS16C48 I O Routines and Sample Program Listings...