Texas Instruments TMS320 User Manual page 240

Dsp/bios v5.40
Hide thumbs Also See for TMS320:
Table of Contents

Advertisement

Stream I/O—Reading and Writing Streams
7.3.2
Example - Reading Input Buffers from a DGN Device
Example 7-5. Basic SIO Functions
/*
*
*
*
*
*
*
*
*
*
*/
#include <std.h>
#include <log.h>
#include <sio.h>
#include <sys.h>
#include <tsk.h>
extern Int IDRAM1;
extern LOG_Obj trace;
extern SIO_Obj inputStream; /* SIO object created w Conf tool */
extern TSK_Obj streamTask;
SIO_Handle input = &inputStream; /* SIO handle used below */
Void doStreaming(Uns nloops);
/*
*
*/
Void main()
{
}
/*
7-10
The program in Example 7-5 illustrates some of the basic SIO functions and
provides a straightforward example of reading from a stream. For a complete
description of the DGN software generator driver, see the DGN section in the
TMS320 DSP/BIOS API Reference Guide for your platform.
The configuration template for Example 7-5 can be found in the siotest
directory of the DSP/BIOS distribution. A DGN device called sineWave is
used as a data generator to the SIO stream inputStream. The task
streamTask calls the function doStreaming to read the sine data from the
inputStream and prints it to the log buffer trace. The output for Example 7-5
appears as sine wave data in Figure 7-4.
======== siotest1.c ========
In this program a task reads data from a DGN sine device
and prints the contents of the data buffers to a log buffer.
The data exchange between the task and the device is done
in a device independent fashion using the SIO module APIs.
The stream in this example follows the SIO_STANDARD streaming
model and is created statically.
======== main ========
LOG_printf(&trace, "Start SIO example #1");
/* MEM segment ID defined by Conf tool */
/* LOG object created with Conf tool */
/* pre-created task */
/* function for streamTask */

Advertisement

Table of Contents
loading

Table of Contents