EasyManuals Logo

Texas Instruments TMS320 User Manual

Texas Instruments TMS320
288 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #240 background imageLoading...
Page #240 background image
Stream I/O—Reading and Writing Streams
7-10
7.3.2 Example - Reading Input Buffers from a DGN Device
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.
Example 7-5. Basic SIO Functions
/*
* ======== 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.
*
*/
#include <std.h>
#include <log.h>
#include <sio.h>
#include <sys.h>
#include <tsk.h>
extern Int IDRAM1; /* MEM segment ID defined by Conf tool */
extern LOG_Obj trace; /* LOG object created with Conf tool */
extern SIO_Obj inputStream; /* SIO object created w Conf tool */
extern TSK_Obj streamTask; /* pre-created task */
SIO_Handle input = &inputStream; /* SIO handle used below */
Void doStreaming(Uns nloops); /* function for streamTask */
/*
* ======== main ========
*/
Void main()
{
LOG_printf(&trace, "Start SIO example #1");
}
/*

Table of Contents

Other manuals for Texas Instruments TMS320

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Texas Instruments TMS320 and is the answer not in the manual?

Texas Instruments TMS320 Specifications

General IconGeneral
BrandTexas Instruments
ModelTMS320
CategoryComputer Hardware
LanguageEnglish

Related product manuals