User manual

PAL tutorial
(unsigned) adjs (Output, width(DsmWord)));
DsmFlush (PortH2S);
}
}
}
}
Video output implementation
The DSM video driver is used to display processed data in visual form on a monitor screen.
To use the video driver on hardware side, you need to include
dsm_video.hch and link your
application with
dsm_vide.hcl library. This is done at the beginning of the source file dsm_fir.hcc.
The
dsm_fir.h which is shared between hardware and software sides defines the DSM H2S and S2H
ports for video. The index number of the video S2H port is
VIDEO_PORT_S2H and H2S port is
VIDEO_PORT_H2S.
To use the video driver on software side, you need to link your ANSI-C application code with graphic
library. Only MicroBlaze platform is supported. The graphic library for MicroBlaze platform is
libmbdsmgraphics.a. This library provides communication with the video driver and allows you to
draw simple graphical objects like lines, circles, rectangles, ellipses, etc.
DSM FIR filter tutorial: software side
The software side is of the DSM FIR filter tutorial implemented in dsm_fir.c.
The requirement for S2H and H2S ports is the same as in the hardware side, making the initialization
and use of DSM in software as follows:
int FirFilter (DsmInterface Interface, void *InterfaceData)
{
DsmInstance *Instance;
DsmPortS2H *FirPortS2H;
DsmPortH2S *FirPortH2S;
DsmPortS2H *VideoPortS2H;
DsmPortH2S *VideoPortH2S;
DsmWord Input[] =
{
#include "samples.h"
}
};
...
DsmSetDefaultErrorHandler ();
DsmInit (Interface, InterfaceData,
PORT_H2S_COUNT , PORT_S2H_COUNT , &Instance);
DsmPortS2HOpen (Instance, FIR_S2H, &FirPortS2H);
DsmPortH2SOpen (Instance, FIR_S2H, &FirPortH2S);
DsmPortS2HOpen (Instance, VIDEO_PORT_S2H, &VideoPortS2H);
DsmPortH2SOpen (Instance, VIDEO_PORT_H2S, &VideoPortH2S);
#if defined WIN32 || defined __MICROBLAZE__
DsmGraphicsInit (Instance, VideoPortS2H, VideoPortH2S);
...
#endif
for (i = 0; i < NSamples; i++)
{
printf ("Input = %d ", Input[i]);
DsmWrite (FirPortS2H, &Input[i], 1, NULL);
DsmFlush (FirPortS2H);
DsmRead (FirPortH2S, &OutSample, 1, &Count);
Output = (int)OutSample / ScaleFactor;
www.celoxica.com
Page 21