The HPIA serves as
a pointer to HPI memory. The HPID is used to transfer data to and from the address
pointed to by the HPIA. The HPID can also be referenced with the option of automatic
address increment. In this mode, a data read causes a postincrement of the HPIA, and a
data write causes a preincrement of the HPIA.
The HCS line serves as the enabling input for the HPI and must be low during an access.
Following shows the address bits connected to the HPI port and the corresponding
simpli?¬?ed C source code used to access the port for reading and writing.
=* The signals on the wires are shown in the following table.
A[4] A[3] A[2] A[1] A[0]
------------------------------------------------------------
1 0 0 0 3 HPIC Read (HI)
1 0 0 1 3 HPIC Read (LOW)
0 0 0 0 3 HPIC Write (HI)
0 0 0 1 3 HPIC Write (LOW)
0 1 HPID
1 0 HPIA
1 1 HPID (Auto-increment)
* =
#define HPI_PORT 0x202000
#define C_SEND 0x00 =* send ctl *=
#define A_SEND 0x08 =* send addr *=
#define D_SEND 0x04 =* send data, addr auto increment *=
#define N_SEND 0x0C =* send data, NO auto increment *=
#define HBIL_HI 0x02 =* Hi or Low byte *=
#define HPI_R 0x10 =* A[4] is RW\ *=
#define BYTE_HI(x) (x & 0xFF00)
#define BYTE_LO(x) (x << 8 & 0xFF00)
=* Writing to HPI *=
FPWV (HPI_PORT??C_SEND)??BYTE_HI (data);
FPWV (HPI_PORT??C_SEND??HBIL_HI)??BYTE_LO (data);
=* Reading from HPI *=
data??( (FPWV(HPI_PORT??A_SEND??HPI_R)) & 0xFF00);
data ???? ( (FPWV(HPI_PORT??A_SEND??HBIL_HI??HPI_R)) & 0xFF00);
Host communication with the HPI is dependent on whether the HPI is ready to perform
a transfer as indicated by the HRDY output line.
Pages:
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213