OP7100
Software
s
53
Digital I/O
No specific drivers have been written for the OP7100 digital I/O. The
inport
and
outport
functions in the Dynamic C
BIOS.LIB
library can
be used to read the inputs and write the outputs. The eight digital inputs
(DIN0DIN7) are bitmapped bits 0 through 7 of the input at 0x4140. Each
digital output (OUT0OUT7) is controlled by bit 0 at 0x4140 through
0x4147.
For example, OUT2 can be turned on using the following statement.
outport( 0x4142,1 );
Likewise, OUT7 can be turned off using the following statement.
outport( 0x4147,0 );
The
inport
function reads all eight inputs simultaneously, so the bitwise
AND operator (
&
) is useful in checking the status of a particular input. For
example, the statement
if( inport(0x4140) & 0x04 )
can be used to check whether DIN2 (whose bit mask is 0x04) is on.
Likewise
if( inport(0x4140) & 0x80 )
can be used to check the status of input DIN7.
The Dynamic C function
IBIT
can be used to determine the state of one
input bit. For example, to check DIN2 (which is bit 2 of the inputs), use the
statement
if( IBIT(0x4140,2) )
instead of the more complex statement below.
if( inport(0x4140) & 0x04 )
While
IBIT
works well for the digital inputs, its output equiv-
alents,
ISET
and
IRES
, will not work with the digital output
bits because the output register of the OP7100 is write-only.
ISET
and
IRES
will only operate on output registers whose
current state can be read by the processor.
Refer to the
Dynamic C Function Reference
manual for more
information on the use of these functions.
!
$
Содержание OP7100
Страница 1: ...OP7100 Serial Graphic Display User s Manual 019 0065 020418 J ...
Страница 10: ...OP7100 x s About This Manual ...
Страница 16: ...OP7100 16 s Overview ...
Страница 50: ...OP7100 50 s Hardware ...
Страница 51: ...OP7100 Software s 51 CHAPTER 4 SOFTWARE Chapter 4 describes the Dynamic C functions used with the OP7100 ...
Страница 72: ...OP7100 72 s Software ...
Страница 80: ...OP7100 80 s Graphics Programming ...
Страница 86: ...OP7100 86 s Installation ...
Страница 96: ...OP7100 96 s Specifications ...
Страница 110: ...110 s Serial Interface Board 2 OP7100 ...
Страница 111: ...OP7100 Backup Battery s 111 APPENDIX E BACKUP BATTERY ...
Страница 114: ...OP7100 114 s Backup Battery ...
Страница 122: ...OP7100 122 s Index ...