Coma FW-C2800 User's Guide Page 211

  • Download
  • Add to my manuals
  • Print
  • Page
    / 276
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 210
Data Pipe Manager (PIP Module)
Input/Output Overview and Pipes 6-7
There are no special format or data type requirements for the data to be
transferred by a pipe.
The online help in the Configuration Tool 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.3.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.
Page view 210
1 2 ... 206 207 208 209 210 211 212 213 214 215 216 ... 275 276

Comments to this Manuals

No comments