APPENDIX
Medix 1700SF User’s manual
41
ucDid = Get_W627EHF_Reg(0x20);
if (ucDid == 0x88)
{
goto
Init_Finish;
}
W627EHF_BASE = 0x4E;
result = W627EHF_BASE;
ucDid = Get_W627EHF_Reg(0x20);
if (ucDid == 0x88)
{
goto
Init_Finish;
}
W627EHF_BASE = 0x00;
result = W627EHF_BASE;
Init_Finish:
return
(result);
}
//================================================================
===========
void Unlock_W627EHF (void)
{
outportb(W627EHF_INDEX_PORT,
W627EHF_UNLOCK);
outportb(W627EHF_INDEX_PORT,
W627EHF_UNLOCK);
}
//================================================================
===========
void Lock_W627EHF (void)
{
outportb(W627EHF_INDEX_PORT,
W627EHF_LOCK);
}
//================================================================
===========
void Set_W627EHF_LD( unsigned char LD)
{
Unlock_W627EHF();
outportb(W627EHF_INDEX_PORT,
W627EHF_REG_LD);
outportb(W627EHF_DATA_PORT,
LD);
Lock_W627EHF();
}
//================================================================
===========
void Set_W627EHF_Reg( unsigned char REG, unsigned char DATA)
{
Unlock_W627EHF();
outportb(W627EHF_INDEX_PORT,
REG);
outportb(W627EHF_DATA_PORT,
DATA);
Lock_W627EHF();
}
//================================================================
===========
unsigned char Get_W627EHF_Reg(unsigned char REG)
{
unsigned char Result;
Unlock_W627EHF();
outportb(W627EHF_INDEX_PORT,
REG);
Result = inportb(W627EHF_DATA_PORT);
Lock_W627EHF();
return
Result;
}
//================================================================
===========
//================================================================
===========
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE