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 #249 background imageLoading...
Page #249 background image
Stackable Devices
Streaming I/O and Device Drivers 7-19
Example 7-9. Data Exchange Through a Pipe Device
/*
* ======== siotest5.c ========
* In this program two tasks are created that exchange data
* through a pipe device. The source task reads sine wave data
* from a DGN device through a DTR device stacked on the sine
* device, and then writes it to a pipe device. The sink task
* reads the data from the pipe device and writes it to the
* printData DGN device. The data exchange between the tasks
* and the devices is done in a device independent fashion
* using the SIO module APIs.
*
* The streams in this example follow the SIO_STANDARD streaming
* model and are created statically.
*/
#include <std.h>
#include <dtr.h>
#include <log.h>
#include <mem.h>
#include <sio.h>
#include <sys.h>
#include <tsk.h>
#define BUFSIZE 128
#ifdef _62_
#define SegId IDRAM
extern Int IDRAM; /* MEM segment ID defined with conf tool */
#endif
#ifdef _55_
#define SegId DATA
extern Int DATA; /* MEM segment ID defined with conf tool */
#endif
extern LOG_Obj trace; /* LOG object created with conf tool */
extern TSK_Obj sourceTask; /* TSK thread objects created via conf tool */
extern TSK_Obj sinkTask;
extern SIO_Obj inStreamSrc; /* SIO streams created via conf tool */
extern SIO_Obj outStreamSrc;
extern SIO_Obj inStreamSink;
extern SIO_Obj outStreamSink;
/* Parameters for the stacking device "/scale" */
DTR_Params DTR_PRMS = {
20, /* Scaling factor */
NULL,
NULL
};
Void source(Uns nloops); /* function body for sourceTask above */
Void sink(Uns nloops); /* function body for sinkTask above */
static Void doStreaming(SIO_Handle input, SIO_Handle output, Uns nloops);
/*

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