APPENDIX
66
MI808 User’s Manual
D. Digital I/O Sample Code
//---------------------------------------------------------------------------
//
// 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.
//
//---------------------------------------------------------------------------
//rev date name
description
//---------------------------------------------------------------------------
//s01 20091028 Sunny
set gpio multi-function pin
//---------------------------------------------------------------------------
#include <dos.h>
#include <conio.h>
#include <stdio.h>
#include <stdlib.h>
#include "F81865.H"
#define BIT0 0x01
#define BIT1 0x02
#define BIT2 0x04
#define BIT3 0x08
#define BIT4 0x10
#define BIT5 0x20
#define BIT6 0x40
#define BIT7 0x80
//---------------------------------------------------------------------------
int main (void);
void Dio5Initial(void);
void Dio5SetOutput(unsigned char);
unsigned char Dio5GetInput(void);
void Dio5SetDirection(unsigned char);
unsigned char Dio5GetDirection(void);
//---------------------------------------------------------------------------
int main (void)
{
char
SIO;
unsigned char DIO;
printf("Fintek 81865/81866 digital I/O test program\n");
SIO = Init_F81865();
if (SIO == 0)
{
printf("Can not detect Fintek 81865/81866, program abort.\n");
return(1);
}//if (SIO == 0)
Dio5Initial();
/*
//for
GPIO50..57
Dio5SetDirection(0xF0);
//GP50..53 = input, GP54..57=output
printf("Current DIO direction = 0x%X\n", Dio5GetDirection());
printf("Current DIO status = 0x%X\n", Dio5GetInput());
printf("Set DIO output to high\n");
Summary of Contents for MI808
Page 1: ...MI808 Mini ITX Motherboard USER S MANUAL Version 1 1...
Page 4: ...iv MI808 User s Manual This page is intentionally left blank...
Page 8: ...INTRODUCTION 4 MI808 User s Manual CFast x 1 solder side Except MI808FW 370A...
Page 10: ...INTRODUCTION 6 MI808 User s Manual Board Dimensions...
Page 21: ...INSTALLATIONS MI808 User s Manual 17 Connector Locations on MI808 Connector Locations on MI808...
Page 35: ...INSTALLATIONS MI808 User s Manual 31 J7 SIM Card Slot JP5 JP6 Reserved J14 LPT Port Connector...