
TME-104-CLR-86DX-R0V2.doc
Rev. 0.2
36(
44
)
4.4
Programming Examples
The following programming examples are made for a Linux operation system. If other operation systems are used
some header files could be unnecessary or they can have different names.
The "iopl()" function is a Linux specific one, in Windows XP a tool called "porttalk" can be used instead.
Be careful with the interpretation of the "outb" order in our examples:
Linux:
'outb(value, address)'
DOS, Windows:
'outb(address, value)'
The code is meant to be compiled using gcc under Linux.
GPIOs on SUPERVISORY
The Cool LiteRunner-86DX general purpose I/O signals (GPIO) are part of the Vortex86DX. GPIO's 1x belongs to
GPIO set #1, GPIO's 2x to set #2 and so on, up to set #5. The following lines show an example how to program
GPIO Bank 1, whose signals are located on the SUPERVISORY connector.
#include
<
sys
/
io
.
h
>
#include
<
stdio
.
h
>
//GPIO registers:
#define
GPIO1X_DAT 0x79
//gpio port 1 data
#define
GPIO2X_DAT 0x7A
//gpio port 2 data
#define
GPIO1X_DIR 0x99
//gpio port 1 direction
#define
GPIO2X_DIR 0x9A
//gpio port 2 direction
int
main
()
{
if
(
iopl
(
3
) !=
0
)
{
printf
(
"IOPL error
\
n"
);
return
1
;
}
outb
(
0xff
,
GPIO1X_DIR
);
//set all pins of gpio port 1 to output
outb
(
0x55
,
GPIO1X_DAT
);
//write out 0x55 to gpio port 1
return
0
;
}
For a more detailed description about programming the ITE8712 super I/O, please refer to chapter 8 of the
datasheet.
Note:
Please note that this source code example is done for a system running with
Linux. For other operation system it may be necessary to adapt the source code
regarding include files or headers and the syntax of I/O out commands because
Linux is using outb(value, address) instead of outb(address, value).
Содержание Cool LiteRunner-86DX
Страница 8: ...TME 104 CLR 86DX R0V2 doc Rev 0 2 3 44 Block Diagram...
Страница 12: ...TME 104 CLR 86DX R0V2 doc Rev 0 2 7 44 Bottom vertical mirrored...
Страница 15: ...TME 104 CLR 86DX R0V2 doc Rev 0 2 10 44 2 2 Jumper Locations Top RS485 Termination Battery Jumper...
Страница 37: ...TME 104 CLR 86DX R0V2 doc Rev 0 2 32 44 Cable plan for the Bridge of Redundancy...