Usage Examples
DSP/BIOS for OMAP 2320
C-9
C.6
Usage Examples
The following examples provide examples that use the HWI and C55
APIs related to the OMAP 2320.
C.6.1
Installing and Enabling a Single Level 2 Interrupt
This C code example plugs and enables the 23xx Level 2 interrupt #1.
/*
* ======== l2_example1.c ========
* DSP/BIOS Level 2 interrupt example
*/
#include <std.h>
#include <hwi.h>
#include <log.h>
#include <c55.h>
extern LOG_Obj trace;
void myIsr (Arg id)
{
LOG_printf(&trace, "My l2 ISR %d", ArgToInt(id));
}
Void main ()
{
HWI_Attrs attrs = HWI_ATTRS;
// pass vector ID to myIsr
attrs.arg = (Arg)
C55_L2_INT1
;
// Plug Level 2 Interrupt #1 Vector
HWI_dispatchPlug(C55_L2_INT1, (Fxn)myIsr, &attrs);
// Enable Level 2 interrupt
C55_enableInt
(C55_L2_INT1);
}