FAQ: How do I set up interrupts on SHARC?

Document created by kennie Employee on Sep 21, 2012Last modified by kennie Employee on Sep 25, 2012
Version 2Show Document
  • View in full screen mode

Question:

How do I set up interrupts on SHARC?

 

---------------------------------------------

 

Answer:

The header file, adi_int.h, provides prototypes of the SSL interrupt handling APIs and macros that define interrupt IDs. The file can be found in the CCES subdirectory “<install_path>/SHARC/include/services/int” and is included in C/C++ source as follows:

 

      #include <services/int/adi_int.h>

 

The following functions are used to install, enable and uninstall interrupts

  • ADI_INT_STATUS adi_int_InstallHandler(uint32_t iid,

ADI_INT_HANDLER_PTR pfHandler, void *pCBParam, bool bEnable);

    • Used to install an interrupt handler for a given interrupt

 

  • ADI_INT_STATUS adi_int_EnableInt (uint32_t iid, bool bEnable);
    • Enables or disables the specified interrupt

 

  • ADI_INT_STATUS adi_int_UninstallHandler ( uint32_t   iid );
    • Uninstalls the interrupt handler and disables the source and interrupt

 

The interrupt IDs macros are defined as the interrupt name prefixed with “INT_CID_”, for example, ADI_CID_GPTMR0I. For a list of the interrupt IDs that are defined for each platform, see the file <<install_path>/SHARC/include/interrupt.h.

 

Note that <signal.h> now only provides support for the signal-related functions and macros that are required by the C and C++ standards.

 

Example

Examples using these functions can be found in the ADSP-21469 Board Support Package. See, for example, the “Core_Timer” example, which uses both high- and low-priority timer interrupts.

 

Documentation

See the System Run-Time Documentation in the CrossCore Embedded Studio Help for more information on the software support for interrupts

 

Differences from VisualDSP++

VisualDSP++ supported a number of methods of configuring interrupts, each with their own limitations, which led to many user errors and problems. To simplify interrupt support, and to provide a more consistent approach to programming interrupts across Analog Devices’ DSPs, these methods have been removed. The APIs described above are the only supported way to configure interrupts.

Attachments

    Outcomes