8-Bit Gpio Function - BOSER Technology HS-7165 Manual

Intel mobile dual-core processor picmg1.3 full-size sbc,1066/800mhz fsb,compactflash, dvi-i/crt/lvds,dual gb lan, audio,sata,rs-232/422/485,4 com, 7 usb2.0,wdt,h/w monitor
Table of Contents

Advertisement

3.21 8-bit GPIO Function

The HS-7165 offers one 8-bit input/output port.
CN10: 8-bit GPIO
PIN Description PIN Description
1
VCC
3
GD0
5
GD1
7
GD2
9
GD3
EX. Sample Code Using GPIO 5
#include <conio.h>
#include <stdio.h>
#include <io.h>
void main(void)
{
unsigned char byte_cr29;
outportb(0x2e, 0x87); // enter Super I/O configuration mode
outportb(0x2e, 0x87);
outportb(0x2e,0x29); // set CR29 bit 5
byte_cr29 = (inportb(0x2f) | 0x20); // to switch UARTA to GPIO5
outportb(0x2f, byte_cr29);
outportb(0x2e, 0x07); // locate logical device 8
outportb(0x2e, 0x08);
outportb(0x2e, 0x30); // set CR30 bit 1 (enable GPIO5)
outportb(0x2f, 0x02);
outportb(0x2e, 0xe0); // set GP54 ~ GP57
outportb(0x2f, 0x0F); // GP54 ~ GP57 as output pins
}
2
GND
4
GD4
6
GD5
8
GD6
10
GD7
2
10
1
9
23

Advertisement

Table of Contents
loading

Table of Contents