English
Language : 

JDP2S01T Datasheet, PDF (25/150 Pages) Toshiba Semiconductor – UHF~VHF Band RF Attenuator Applications
Philips Semiconductors
ISP1362
Single-chip USB OTG controller
9397 750 12337
Product data
Starting address — Location to start writing or reading
Data length — Number of bytes to write or read.
The following is a sample code for setting the HcDirectAddressLength register:
void Set_DirAddrLen(unsigned int data_length,unsigned int addr)
{
unsigned long RegData = 0;
RegData =(long)(addr&0x7FFF);
RegData|=(((long)data_length)<<16);
write_reg32(HcDirAddrLen,RegData);
}
After the proper value is written to the HcDirectAddressLength register, data is
accessible from the HcDirectAddressData register (called as HcDirAddr_Port in the
following sample code). A sample code for writing word_size bytes of data from
*w_ptr to the memory locations of the ISP1362 buffer starting from the address
start_addr is as follows:
void direct_write(unsigned int *w_ptr,unsigned int
start_addr,unsigned int word_size)
{
unsigned int cnt=0;
Set_DirAddrLen(word_size*2,start_addr);
outport(hc_com,HcDirAddr_Port|0x80); // hc_com is system address of
// HC command port
do
{
outport(hc_data,*(w_ptr+cnt)); // hc_data is system address of
// HC data port
cnt++;
}
while(cnt<word_size);
}
Direct addressing allows fast and random access to any location within the ISP1362
memory. Your program, however, needs the address location of each buffer area to
access them.
9.5.2 PIO access to the buffer memory by using indirect addressing
Indirect addressing is the addressing method that is compatible with the Philips
ISP1161 addressing mode. This method uses a unique data port for each buffer
memory area (ATL, INTL, ISTL0 and ISTL1). These four data areas share the
HcTransferCounter register that is used to indicate the number of bytes to be
transferred.
A sample code for writing an array at *a_ptr into the ATL memory area with word_size
as the word size is given as follows:
void write_atl(unsigned int *a_ptr, unsigned int word_size)
{
int cnt;
Rev. 03 — 06 January 2004
© Koninklijke Philips Electronics N.V. 2004. All rights reserved.
25 of 150