User manual
PAL tutorial
Getting compile-time information from the resource
There are a number of API calls that allow you to get information from PAL resources at compile time.
They can be recognized by the abbreviation
CT appended to the name of the macro.
For this application, the number of visible lines and columns in the video scan is used in order to be able
to test where the current scan position is in a frame.
In the tutorial code, the macro procedure
GenerateData() uses
•
PalVideoOutGetVisibleYCT (VideoOut): this returns the number of visible lines.
•
PalVideoOutGetVisibleXCT (VideoOut, ClockRate): this returns the number of
visible columns.
1.3.2 Run-time operations
Running the resource
Resources must run in parallel with your main program. If you use more than one resource, they should
all be run in parallel with each other.
In the tutorial source code, the video output resource is run in parallel with the procedure generating the
video data:
par
{
PalVideoOutRun (VideoOut);
// main program here
}
Enabling the resource
Once a PAL resource is running, it needs to be enabled before you can use it. This enabling method can
take zero or more clock cycles, depending on the target platform.
In this application, the video output resource needs to be permanently enabled, so the enable procedure
is only called once, before starting to output video data.
par
{
PalVideoOutRun (VideoOut);
seq
{
PalVideoOutEnable (VideoOut);
// do the video output
}
}
Writing data to the resource
Once a PAL resource has been enabled, you can read data from and write data to it. Writing to the
resource takes the form
PalXWrite (PalHandle), where X is the type of video resource and
PalHandle is the handle to the specific resource to use.
In the tutorial application, once the video output has been enabled, the program starts sending the video
output process some data to display, as follows:
www.celoxica.com
Page 9