![Portwell PEB-2131VG2A Скачать руководство пользователя страница 24](http://html1.mh-extra.com/html/portwell/peb-2131vg2a/peb-2131vg2a_user-manual_1581831024.webp)
System Installation
PEB-2131VG2A User’s Manual
3-6
PEB-2131VG2A GPIO Programming Guide
There are two PNP I/O port addresses that can be used to configure GPIO ports,
1) 0x2E -
EFER
(Extended Function Enable Register, for entering Extended Function
Mode)
-
EFIR
(Extended Function Index Register, for identifying CR index number)
2) 0x2F -
EFDR
(Extended Function Data Register, for accessing desired CR)
Below are some example codes, which demonstrate the use of GPIOs.
// Enter Extended Function Mode
outp(0x002E, 0x87);
outp(0x002E, 0x87);
// Assign Pin1-4 and Pin125-128 to be GPIO port 1
outp(0x002E, 0x29);
outp(0x002F, 0x7F);
// Select Logic Device 8
outp(0x002E, 0x07);
outp(0x002F, 0x08);
// Active GPIO 5
outp(0x002E, 0x30);
outp(0x002F, 0x03);
// Select I/O Mode
outp(0x002E, 0xE0);
outp(0x002F, (inp(0x002F)
&
0xF0) | (
I/O Selection Register
&
0x0F));
// Select Inversion Mode
outp(0x002E, 0XE2);
outp(0x002F, (inp(0x002F)
&
0xF0) | (
Inversion Register
&
0x0F));
// Access GPIO ports
outp(0x002E, 0XE1);
outp(0x002F, (inp(0x002F)
&
0xF0) | (
Output Data
&
0x0F));
or
Input Data
= inp(0x002F);
// Exit Extended Function Mode
outp(0x002E, 0xAA);
Содержание PEB-2131VG2A
Страница 7: ...System Overview PEB 2131VG2A User s Manual 1 4 1 3 1 Mechanical Drawing TOP side ...
Страница 8: ...System Overview PEB 2131VG2A User s Manual 1 5 Bottom side Rear IO ...
Страница 11: ...Hardware Configuration PEB 2131VG2A User s Manual 2 2 Figure 2 1 PEB 2131VG2A Jumper and Connector Locations ...