www.ti.com
Bootloader Code Listing (V3.0)
// GP I/O port are ignored.
In the 8-bit case the
// first fetches the LSB and then the MSB from the
// GPIO port.
These two bytes are then put together to
// form a single 16-bit word that is then passed back
// to the host. Note that in this case, the input stream
// from the host is in the order LSB followed by MSB
//-----------------------------------------------
Uint16 Parallel_GetWordData_8bit()
{
Uint16 wordData;
// Get LSB.
Parallel_WaitHostRdy();
wordData = DATA;
Parallel_HostHandshake();
// Fetch the MSB.
wordData = wordData & 0x00FF;
Parallel_WaitHostRdy();
wordData |= (DATA << 8);
Parallel_HostHandshake();
return wordData;
}
Uint16 Parallel_GetWordData_16bit()
{
Uint16 wordData;
// Get a word of data.
If you are in
// 16-bit mode then you are done.
Parallel_WaitHostRdy();
wordData = DATA;
Parallel_HostHandshake();
return wordData;
}
//#################################################
// void Parallel_WaitHostRdy(void)
//-----------------------------------------------------
// This routine tells the host that the DSP is ready to
// receive data.
The DSP then waits for the host to
// signal that data is ready on the GP I/O port.e
//-----------------------------------------------------
void Parallel_WaitHostRdy()
{
DSP_RDY;
while(HOST_DATA_NOT_RDY) { }
}
//#################################################
// void Parallel_HostHandshake(void)
//-----------------------------------------------------
// This routine tells the host that the DSP has received
// the data.
The DSP then waits for the host to acknowledge
// the receipt before continuing.
//-----------------------------------------------------
void Parallel_HostHandshake()
{
DSP_ACK;
while(WAIT_HOST_ACK) { }
}
// EOF --------
SPRU722C – November 2004 – Revised October 2006
Bootloader Code Overview
77