Specifications

Modifying the Source Code to Use Host Channels and Pipes
7-10
7.5 Modifying the Source Code to Use Host Channels and Pipes
Now you modify the example to use the host channels and pipes provided
with DSP/BIOS. The modified example still tests your DSP algorithm in real
time. Rather than generating a sine wave on the host, this time the data
comes from a host file.
The HST module provides a more direct path toward implementing I/O with
peripheral devices. The HST module uses the PIP module for host I/O. You
can use the PIP module API with minimal modifications to the source code
once the I/O devices and ISRs are ready for testing.
1) Copy
only
the following files from the c:\ti\c6000\tutorial\hostio2\ folder to
your working folder. (Note that you should
not
copy all the files from the
hostio2 folder. In particular, do not copy the hostio.cdb file.)
hostio.c
. The source code has been modified to use the HST and
PIP modules of the DSP/BIOS API instead of RTDX to transfer the
input and output signals
input.dat
. This file contains input data
2) Double-click on the hostio.c file in the Project View to see the source code
in the right half of the Code Composer Studio window. The source code
now contains the following differences from the source code used earlier
in this chapter:
Added the following to the list of included header files:
#include <hst.h>
#include <pip.h>
Removed the BUFSIZE definition, the global declarations of
inp_buffer and out_buffer, and the RTDX input and output channel
declarations. This example retains the RTDX channel used to control
the volume.
Moved the input and output functionality from a while loop in the main
function to the A2DscaleD2A function.
/* ======== A2DscaleD2A ======== */
/* FUNCTION: Called from A2DscaleD2A_SWI to get digitized data
* from a host file through an HST input channel,
* scale the data by the volume factor, and send
* output data back to the host through an HST
* output channel.
* PARAMETERS: Address of input and output HST channels.
* RETURN VALUE: None. */