Texas Instruments TMS320 User Manual page 126

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

Advertisement

Hardware Interrupts
4-22
❏ The second parameter of HWI_enter and HWI_exit on the C28x platform,
ACC_MASK, specifies the mask of ACC, p, and t registers to be stored
and restored by the ISR.
❏ The third parameter, MISC_MASK, specifies the mask of registers ier, ifr,
DBGIER, st0, st1, and dp.
❏ The fourth parameter, IERDISABLEMASK, specifies which bits in the IER
are to be turned off.
When an interrupt is triggered, the processor switches off IER bits and
disables interrupts globally (by setting the INTM bit in the status register ST1)
and then jumps to the ISR setup in the interrupt vector table. The HWI_enter
macro reenables interrupts by clearing the INTM bit in the ST1 register.
Before doing so, HWI_enter selectively disables some interrupts by clearing
the appropriate bits in the Interrupt Enable Register (IER). The bits that are
cleared in the IER register are determined by the IERDISABLEMASK input
parameter passed as fourth parameter to the HWI_enter macro. Hence,
HWI_enter gives you control to select what interrupts can and cannot
preempt the current HWI function. When HWI_exit is called, you can also
provide the IERRESTOREMASK parameter. The bit pattern in the
IERRESTOREMASK determines what interrupts are restored by HWI_exit,
by setting the corresponding bits in the IER. Of the interrupts in
IERRESTOREMASK, HWI_exit restores only those that were disabled with
HWI_enter. If upon exiting the ISR you do not wish to restore one of the
interrupts that was disabled with HWI_enter, do not set that interrupt bit in the
IERRESTOREMASK in HWI_exit. HWI_exit does not affect the status of
interrupt bits that are not in IERRESTOREMASK.
See Functions Callable by Tasks, SWI Handlers, or Hardware ISRs in the
TMS320 DSP/BIOS API Reference Guide for your platform for a complete list
of functions that can be called by an ISR.
Note:
HWI_enter and HWI_exit must surround all statements in any DSP/BIOS
assembly or C language HWIs that reference DSP/BIOS functions. Using
the HWI dispatcher satisfies this requirement.
Example 4-3 provides assembly language code for constructing a minimal
HWI on the C6000 platform when the user has selected not to use the HWI
dispatcher. An example on the C55x platform is shown in Example 4-4. These
examples use HWI_enter and give you more precise control.

Advertisement

Table of Contents
loading

Table of Contents