![Apex Digital STX104 Скачать руководство пользователя страница 85](http://html.mh-extra.com/html/apex-digital/stx104/stx104_reference-manual_2952893085.webp)
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.
See Also
Register Summary ( see page 41)
Example
Below are examples of functions used to read/write the indexed array. It is assumed that the indexed array has been properly
banked ( see page 68) 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
*/
11.29 Index Pointer (Offset=14, RB='1')
STX104 Reference Manual
Copyright © 2009 by
Apex Embedded Systems
. All rights reserved.
Thursday, October 08, 2009
77
11
Содержание STX104
Страница 1: ......
Страница 8: ......
Страница 10: ......
Страница 12: ......
Страница 16: ......
Страница 18: ......
Страница 20: ......
Страница 22: ......
Страница 42: ......
Страница 44: ......
Страница 116: ......
Страница 122: ......
Страница 124: ...STX104 Reference Manual 15 Copyright 2009 by Apex Embedded Systems All rights reserved 116 Thursday October 08 2009 15 ...
Страница 126: ......
Страница 128: ......
Страница 132: ......