
APPENDIX
MB740 User’s Manual
55
D. Digital I/O Sample Code
File name: 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 "ITE8705.H"
//---------------------------------------------------------------------------
void ClrKbBuf(void);
int main (int argc, char *argv[]);
void SetDioOutput(unsigned char);
unsigned char GetDioInput(void);
//---------------------------------------------------------------------------
int main (int argc, char *argv[])
{
if (Init_ITE8705() == 0)
{
printf("Can
not
detect
ITE8705, program abort.\n");
return(1);
}
<!--[if !supportEmptyParas]--> <!--[endif]-->
printf("Current DIO input is 0%X\n", GetDioInput());
<!--[if !supportEmptyParas]--> <!--[endif]-->
printf("Set
DIO
output
to high\n");
SetDioOutput(0x0F);
<!--[if !supportEmptyParas]--> <!--[endif]-->
printf("Set DIO output to low\n");
SetDioOutput(0x00);
<!--[if !supportEmptyParas]--> <!--[endif]-->
return
0;
}
//---------------------------------------------------------------------------
void SetDioOutput(unsigned char data)
{
Set_ITE8705_LD(
0x05);
//switch to logic device 7
outportb(ITE8705_IO_PORT, ((data & 0x0F) << 4));
}
//---------------------------------------------------------------------------
unsigned char GetDioInput(void)
Summary of Contents for MD740
Page 1: ...MB740 AMD Geode NX Mini ITX Motherboard USER S MANUAL Version 1 0...
Page 4: ...THE MB740 MINI ITX MOTHERBOARD iv MB740 User s Manual...
Page 8: ...INTRODUCTION Board Dimensions 4 MB740 User s Manual...
Page 24: ...INSTALLATIONS 20 MB740 User s Manual This page is intentionally left blank...
Page 44: ...BIOS SETUP 40 MB740 User s Manual This page is intentionally left blank...