Texas Instruments TMS320 User Manual page 249

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

Advertisement

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;
#endif
#ifdef _55_
#define SegId DATA
extern Int DATA;
#endif
extern LOG_Obj trace;
extern TSK_Obj sourceTask;
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
DTR_Params DTR_PRMS = {
20,
NULL,
NULL
};
Void source(Uns nloops);
Void sink(Uns nloops);
static Void doStreaming(SIO_Handle input, SIO_Handle output, Uns nloops);
/*
/* MEM segment ID defined with conf tool */
/* MEM segment ID defined with conf tool */
/* LOG object created with conf tool */
/* TSK thread objects created via conf tool */
/* Scaling factor */
/* function body for sourceTask above */
/* function body for sinkTask above */
"/scale" */
Streaming I/O and Device Drivers
Stackable Devices
7-19

Advertisement

Table of Contents
loading

Table of Contents