23
3.21 8-bit GPIO Function
The HS-7165 offers one 8-bit input/output port.
z
CN10: 8-bit GPIO
PIN Description PIN Description
1
VCC
2
GND
3
GD0
4
GD4
5
GD1
6
GD5
7
GD2
8
GD6
9
GD3
10
GD7
1
9
10
2
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
}
Summary of Contents for HS-7165
Page 10: ...4 1 3 Board Dimensions...
Page 14: ...8 3 2 Board Layout...
Page 30: ...24 This page is the blank page...
Page 42: ...36 This is the blank page...