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 #211 background imageLoading...
Page #211 background image
Data Pipe Manager (PIP Module)
Input/Output Methods 6-9
There are no special format or data type requirements for the data to be
transferred by a pipe.
The DSP/BIOS online help describes data pipe objects and their parameters.
See PIP Module in the TMS320 DSP/BIOS API Reference Guide for your
platform for information on the PIP module API.
6.4.1 Writing Data to a Pipe
The steps that a program should perform to write data to a pipe are as follows:
1) A function should first check the number of empty frames available to be
filled with data. To do this, the program must check the return value of
PIP_getWriterNumFrames. This function call returns the number of
empty frames in a pipe object.
2) If the number of empty frames is greater than 0, the function then calls
PIP_alloc to get an empty frame from the pipe.
3) Before returning from the PIP_alloc call, DSP/BIOS checks whether
there are additional empty frames available in the pipe. If so, the
notifyWriter function is called at this time.
4) Once PIP_alloc returns, the empty frame can be used by the application
code to store data. To do this the function needs to know the frame's start
address and its size. The API function PIP_getWriterAddr returns the
address of the beginning of the allocated frame. The API function
PIP_getWriterSize returns the number of words that can be written to the
frame. (The default value for an empty frame is the configured frame
size.)
5) When the frame is full of data, it can be returned to the pipe. If the number
of words written to the frame is less than the frame size, the function can
specify this by calling the PIP_setWriterSize function. Afterwards, call
PIP_put to return the data to the pipe.
6) Calling PIP_put causes the notifyReader function to run. This enables the
writer thread to notify the reader thread that there is data available in the
pipe to be read.
The code fragment in Figure 6-1 demonstrates how to write data to a pipe.

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