5.3.2
Using the D/I/O 14
SetDio14Dir(int dir)
/*
select D/I or D/O first
*/
{
if(dir){
/* set to input */
outport(0xff70, mport(0xff70)&(~(1<<14)));
/* set MODE to 0 */
outport(0xff72, mport(0xff72)|(1<<14));
/* set DIR to 1 */
}
else {
/* set to output */
outport(0xff70, mport(0xff70)|(1<<14));
/* set MODE to 1 */
outport(0xff72, mport(0xff72)&(~(1<<14)));
/* set DIR to 0 */
}
}
OutDio14(int data)
/*
set the D/O_14 ON or OFF
*/
{
if(data)
/* set D/O_14 ON */
outport(0Xff74, mport(0Xff74)|(1<<14));
else
/* set D/O_14 OFF */
outport(0Xff74, mport(0Xff74)&~(1<<14));
}
GetDio4(void)
/*
read the status of D/I_14
*/
{
return mport(0Xff74)&0x4000;
}
5.3.3
Using the SCLK
The 7188 series use this signal as a CLOCK source to drive all on-board
serial devices, so it is always be programmed as D/O. Change this signal to other
configuration will cause serious errors. User can use this signal to drive external
serial devices without any side effects. The software driver provides two
subroutine to set SCLK high or low as follows:
ClockLow();
/* SCLK=0=Low */
ClockHigh();
/* SCLK=1=High */
I/O Expansion Bus for 7188X/7188E User’s Manual, Jan/2005 v1.5, 7PH-000-15---31