beautypg.com

6 gpio sample code, Gpio sample code – Acrosser AR-B1631ET User Manual

Page 25

background image

AR-B1631ET User’s Guide

25/30

6

GPIO SAMPLE CODE


/*[]=====================================================================[]*/
/*|| GPIO Test utility for W83627HF.

||*/

/*|| Date : 10/18/2005

||*/

/*||

Author

:

Willy

||*/

/*[]=====================================================================[]*/

/*[]=====================================================================[]*/
/*||

Include

files

||*/

/*[]=====================================================================[]*/
#include
#include

/*[]=====================================================================[]*/
/*|| Assember Types Define

||*/

/*[]=====================================================================[]*/
typedef unsigned char

BYTE;

typedef unsigned short int WORD;
typedef unsigned long int DWORD;

void Show_Title();
char YES_NO_Confirm();
void Enter_Config(BYTE IO_PORT_BASE);
void Exit_Config(BYTE IO_PORT_BASE);
void Init_SIO(BYTE IO_PORT_BASE);
int GPI_TEST(BYTE IO_PORT_BASE);
int GPO_TEST(BYTE IO_PORT_BASE);

/*[]=====================================================================[]*/
/*|| Function

: GPI_TEST()

||*/

/*|| Input : BYTE IO_PORT_BASE

||*/

/*||

Change :

-

||*/

/*|| Return : Pass return "0", Fail return "1".

||*/

/*|| Description: Test GPI Pins status.

||*/

/*[]=====================================================================[]*/
int GPI_TEST(BYTE IO_PORT_BASE)
{
BYTE Read_Byte,Temp_Word,Show_Byte;

// Set W83627HF GPIO10~17 to Input
outportb(IO_PORT_BASE,0xF0);
outportb(IO_PORT_BASE+1,0xFF);

printf(">>>>> GPI Test Start <<<<<");