Texas Instruments TMS320 User Manual page 130

Dsp/bios v5.40
Hide thumbs Also See for TMS320:
Table of Contents

Advertisement

Software Interrupts
4.3.1
Creating SWI Objects
4-26
As with many other DSP/BIOS objects, you can create SWI objects either
dynamically (with a call to SWI_create) or statically (in the configuration).
Software interrupts you create dynamically can also be deleted during
program execution.
To add a new software interrupt to the configuration, create a new SWI object
in the .tcf configuration file. Set the function property for each software
interrupt to run a function when the object is triggered by the application. You
can also configure up to two arguments to be passed to each SWI function.
You can determine from which memory segment SWI objects are allocated.
SWI objects are accessed by the SWI Manager when software interrupts are
posted and scheduled for execution.
The DSP/BIOS online help describes SWI objects and their properties. See
SWI Module in the TMS320 DSP/BIOS API Reference Guide for your
platform for reference information on the SWI module API calls.
To create a software interrupt dynamically, use a call with this syntax:
swi = SWI_create(attrs);
Here, swi is the interrupt handle and the variable attrs points to the SWI
attributes. The SWI attribute structure (of type SWI_Attrs) contains all those
elements that can be statically configured for an SWI. attrs can be NULL, in
which case, a default set of attributes is used. Typically, attrs contains at least
a function for the handler.
Note:
SWI_create can only be called from the task level, not from an HWI or
another SWI.
SWI_getattrs can be used to retrieve all the SWI_Attrs attributes. Some of
these attributes can change during program execution, but typically they
contain the values assigned when the object was created.
SWI_getattrs(swi, attrs);

Advertisement

Table of Contents
loading

Table of Contents