beautypg.com

NEXCOM NISE 101 User Manual

Page 73

background image

Copyright © 2010 NEXCOM International Co., Ltd. All Rights Reserved.

60

Appendix B: GPI/O Programming Guide

NISE 101 User Manual

#define GPIO_37 0x80 // Digit Input

#define _ON_ 0x01

#define _OFF_ 0x00

#define _HIGH_ 0x01

#define _LOW_ 0x02

unsigned int Port_Addr;

unsigned char ReadAByte(unsigned int port_no)

{ return (inportb(port_no));

}

void WriteAByte(unsigned int port_no, unsigned char data)

{ outportb(port_no, data);

}

void Delay_T(int loop_cnt)

{ int i,j;

for (i=0 ; i< loop_cnt; i++)

for (j=0; j< 1000; j++) ;

}