|
STX104 Reference Manual
|
Index Pointer Register. The purpose of utilizing an indexed array of registers is to fit a large number of registers into a small region of I/O address space. The indexed array of registers are banked onto of the 8254 I/O address space. At power up or reset, the entire STX104 register set will appear and function exactly as the previous firmware version of the STX104 card. By writing a special pattern to the ADC Configuration Register one can bank between the 8254 and indexed array registers as well as configure other STX104 registers for enhanced modes of operation.
Offset=14, Byte 0, RB='1'.
|
D7 |
D6 |
D5 |
D4 |
D3 |
D2 |
D1 |
D0 |
|
IP7 |
IP6 |
IP5 |
IP4 |
IP3 |
IP2 |
IP1 |
IP0 |
|
NAME |
DIRECTION |
DEFAULT |
DESCRIPTION |
|
IP[7:0] |
rw |
0x00 |
Index Pointer Register. |
The drawing below illustrates the ISA bus interface to the indexed register array.
The Index Register is an address pointer that points into the register set array. The Index Register can address any byte or word. Read or writing any data within the indexed array will cause the Index Register to automatically increment (if AIID='0', refer to General Configuration Register). If the data read or written is 16-bits, then the Index Register is automatic incremented by two. If the data read or written is 8-bits (one byte), then the Index Register is incremented by one. The auto-increment feature is implemented to reduce overall software overhead. The auto-increment feature can be disabled by setting the AIID bit in the General Configuration Register. One can modify the value of the Indexed Register at any time.
A logical representation of the indexed register array is illustrated below. The internal registers can consist of bytes (signed or unsigned char), words (signed or unsigned ints) or double words (signed or unsigned long). For advanced configuration it is possible to create a structure that can be simply uploaded to the indexed register array.
Below are examples of functions used to read/write the indexed array. It is assumed that the indexed array has been properly banked into position. Since it is likely that the 8254 registers will not be regularly accessed in most situations, one could arrange to check/set the banking bit RB when one needs to read/write the 8254 register.
/***************************************************************** / INDEXED ARRAY DATA BYTE READ */ static unsigned char STX104_Read_Indexed_Data_Byte( int board, unsigned char index ) { unsigned char value; outp( stx104_base_address[board] + STX104_INDEX_POINTER, index ); value = (unsigned char) inp( stx104_base_address[board] + STX104_INDEX_DATA ); return( value ); } /***************************************************************** / INDEXED ARRAY DATA WORD READ */ static unsigned int STX104_Read_Indexed_Data_Word( int board, unsigned char index ) { unsigned int value; outp( stx104_base_address[board] + STX104_INDEX_POINTER, index ); value = inpw( stx104_base_address[board] + STX104_INDEX_DATA ); return( value ); } /***************************************************************** / INDEXED ARRAY DATA DWORD READ */ static unsigned long STX104_Read_Indexed_Data_Dword( int board, unsigned char index ) { union{ unsigned long dword; unsigned int word[2]; } dvalue; outp( stx104_base_address[board] + STX104_INDEX_POINTER, index ); dvalue.word[0] = inpw( stx104_base_address[board] + STX104_INDEX_DATA ); dvalue.word[1] = inpw( stx104_base_address[board] + STX104_INDEX_DATA ); return( dvalue.dword ); } /***************************************************************** / INDEXED ARRAY DATA BYTE WRITE */ static void STX104_Write_Indexed_Data_Byte( int board, unsigned char index, unsigned char value ) { outp( stx104_base_address[board] + STX104_INDEX_POINTER, index ); outp( stx104_base_address[board] + STX104_INDEX_DATA, (unsigned int) value ); } /***************************************************************** / INDEXED ARRAY DATA WORD WRITE */ static void STX104_Write_Indexed_Data_Word( int board, unsigned char index, unsigned int value ) { outp( stx104_base_address[board] + STX104_INDEX_POINTER, index ); outpw( stx104_base_address[board] + STX104_INDEX_DATA, value ); } /***************************************************************** / INDEXED ARRAY DATA DWORD WRITE */ static void STX104_Write_Indexed_Data_Dword( int board, unsigned char index, unsigned long value ) { union{ unsigned long dword; unsigned int word[2]; } dvalue; dvalue.dword = value; outp( stx104_base_address[board] + STX104_INDEX_POINTER, index ); outpw( stx104_base_address[board] + STX104_INDEX_DATA, dvalue.word[0] ); outpw( stx104_base_address[board] + STX104_INDEX_DATA, dvalue.word[1] ); }
|
Copyright © 1997-2008 by Apex Embedded Systems. All rights reserved. Updated on Wednesday, April 02, 2008.
|
|
What do you think about this topic? Send feedback!
|