Acrosser AR-B8172 User Manual

Page 33

Advertising
background image

AR-B8172 User Manual

GPIO demo program in Turbo C++ as following:

//===========================================================================
// Turbo C++ Version 3.0 Copyright(c) 1990, 1992 by Borland International,Inc.
//===========================================================================
// Describe : GPIO00~GPIO07 GPIO10~GPIO17 Test utility for Vortex86DX.
// Date : 09/17/2009
// Author : Willy
//===========================================================================

//===========================================================================
// Language include files
//===========================================================================
#include <conio.h>
#include <stdio.h>

//===========================================================================
// Normal procedure
//===========================================================================
void Show_Help();
void Show_Fail();
void Show_Pass();

//===========================================================================
// Main procedure
//===========================================================================
int main(int argc)
{
char *Model_Name="AR-B8172";
unsigned char

IO_PORT_BASE=0x22; // DATA_PORT = IO_PORT_BASE + 1;

unsigned char data;
int result=0;

if ( argc >1 )
{ Show_Help(); return 1; }

clrscr();
textcolor(WHITE);
gotoxy(1, 1);
cprintf("<>==========================================================================<>");
gotoxy(1, 2); cprintf("|| Vortex86DX GPIO Test Utility v1.0 Acrosser Technology Co., Ltd. ||");
gotoxy(1, 3);
cprintf("<>==========================================================================<>");
gotoxy(1, 4);
cprintf("<>==========================================================================<>");
gotoxy(1, 5); cprintf("|| Model Name : ||");
gotoxy(1, 6); cprintf("|| SIO IO Base : ||");
gotoxy(1, 7);
cprintf("<>==========================================================================<>");

// Show Got Parameter Informat
textcolor(LIGHTGRAY);
gotoxy(18,5); cprintf("%s",Model_Name);
gotoxy(18,6); cprintf("%X",IO_PORT_BASE);

// Set GPIO00~07 to Output
outportb(IO_PORT_BASE,0x4E);

outportb(IO_PORT_BASE+1,0xFF);

// bit=1 , output


// Set GPIO10~GPIO17 to Input
outportb(IO_PORT_BASE,0x4F);

outportb(IO_PORT_BASE+1,0x00); // bit=0 , input

// Set GPIO00~07 to AA

33


Advertising