Intel MB879 Computer Hardware User Manual


 
APPENDIX
File : ITE8712.CPP
//=======================================================================
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
// PURPOSE.
//
//=======================================================================
#include "ITE8712.H"
#include <dos.h>
//=======================================================================
unsigned int ITE8712_BASE;
void Unlock_ITE8712 (void);
void Lock_ITE8712 (void);
//=======================================================================
unsigned int Init_ITE8712(void)
{
unsigned int result; //0=NA,1=ITE8712
ITE8712_BASE = 0x2E;
result = Get_ITE8712_Reg(0x21);
if (result == 0x12)
{
result = 1;
goto Init_Finish;
}
ITE8712_BASE = 0x4E;
result = Get_ITE8712_Reg(0x21);
if (result == 0x12)
{
result = 1;
goto Init_Finish;
}
ITE8712_BASE = 0x00;
result = 0;
Init_Finish:
return (result);
}
//=======================================================================
void Unlock_ITE8712 (void)
{
outportb(ITE8712_INDEX_PORT, ITE8712_UNLOCK1);
outportb(ITE8712_INDEX_PORT, ITE8712_UNLOCK2);
outportb(ITE8712_INDEX_PORT, ITE8712_UNLOCK3);
if (ITE8712_BASE == 0x2E)
outportb(ITE8712_INDEX_PORT, ITE8712_UNLOCK3);
else
outportb(ITE8712_INDEX_PORT, ITE8712_UNLOCK4);
}
//=======================================================================
void Lock_ITE8712 (void)
{
outportb(ITE8712_INDEX_PORT, ITE8712_LOCK);
60 MB879 User’s Manual