Handlers, Opening a handler, Closing a handler – Sundance SMT6035 v.2.2 User Manual

Page 25

Advertising
background image

Version 2.2

Page 25 of 39

SMT6035 User Manual

speeds of 40MB/s may be achieved although actual performance may vary from
system to system.

15.5 Handlers

The handler mechanism allows you to create custom host-side software that
interacts with the DSP, under DSP control. You may wish to create a handler
that interacts with the user on the host system by displaying a dialog box, or to
display data to the user in some custom format. Perhaps you might want to
obtain data from the host system for processing by the DSP. In all these cases,
a handler might be just what you need.
A handler takes the form of a DLL, which can be loaded on request from the
DSP. This allows the DSP to set up the host-side software to perform actions on
its behalf.
Creating a custom handler is not mandatory, because there is a default handler
that provides basic functionality.

15.5.1 Opening a handler

Before the DSP can open a handler on the host, it writes the details of
the handler in the SRAM argument block for the relevant channel. It
then sends a HSC_OpenHandler control word to the host. The format
of the data block required in the SRAM is described by the following
structure, which can be found in smthsc.h.

typedef struct {

int Code;

int Arg;

char Dll[128]; /* name of handler dll,

including .DLL */

} HSC_Param_OpenHandler;


The DSP is free to specify values for Code and Arg. These values can
be interpreted by the HandlerEntry() function to select between multiple
possible handlers. Anyway, the designer can find his own uses for
these values.

15.5.2 Closing a handler

Once the DSP has finished using a handler, it should send a
HSC_CloseHandler control word to the host. This will cause the host to
unload the handler, and revert back to the default handler.

User Manual - Version 2.2, 04/01/07; © Sundance Italia S.R.L.

Advertising