APPENDIX
62
MB899X User’s Manual
File of the Main.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 <dos.h>
#include <conio.h>
#include <stdio.h>
#include <stdlib.h>
#include "W627HF.H"
//---------------------------------------------------------------------------
void ClrKbBuf(void);
int main (void);
unsigned char GetDI(unsigned char);
void SetDo(unsigned char, unsigned char);
//---------------------------------------------------------------------------
int main (void)
{
unsigned
char
ucDO
=
0;
//data
for
digital
output
unsigned
char
ucDI;
//data
for
digital
input
unsigned char ucBuf;
char
SIO;
SIO = Init_W627HF();
if (SIO == 0)
{
printf("Can not detect Winbond 83627HF/83627THF/83627EHF, program abort.\n");
return(1);
}
switch
(SIO)
{
//-------------------------------------------------------------------
case
1:
printf("Winbond 83627HF is detected .\n");
break;
//-------------------------------------------------------------------
case
2:
printf("Winbond 83627THF is detected.\n");
break;
//-------------------------------------------------------------------
case
4:
printf("Winbond 83627EHF is detected.\n");
break;
//-------------------------------------------------------------------
}
//bit 0..3 = input signal
//bit 4..7 = output signal
ucDI
=
GetDI(0x0F);
//get
current
DI
status
SetDo(ucDO,
0xF0);
//set
current
DO
status
return
0;
}
//---------------------------------------------------------------------------
unsigned char GetDI(unsigned char Mask)
{
unsigned char result;
Set_W627HF_LD(0x07); //switch
to
logic
device
7
Set_W627HF_Reg(0xF0,
Mask);
//set
the
DIO
direction
result = Get_W627HF_Reg(0xF1) & Mask;
Содержание MB899X
Страница 1: ...MB899X Intel CoreTM 2 Duo CoreTM Duo Solo 945GM Mini ITX Motherboard USER S MANUAL Version 1 0 ...
Страница 4: ...iv MB899X User s Manual THE MB899X MINI ITX MOTHERBOARD ...
Страница 8: ...INTRODUCTION 4 MB899X User s Manual Board Dimensions ...
Страница 16: ...INSTALLATIONS 12 MB899X User s Manual Connector Locations on MB899X ...
Страница 26: ...INSTALLATIONS 22 MB899X User s Manual This page is intentionally left blank ...
Страница 68: ...APPENDIX 64 MB899X User s Manual This page is intentionally left blank ...