Specifications
For more information about alt_ic_isr_register(), refer to the "HAL API Reference" chapter.
Note: The HAL legacy interrupt API provides a different function for registering hardware interrupts.
For all new and updated drivers, Altera recommends using the enhanced API described in this
section.
For more information about the legacy API function, alt_irq_register(), refer to the "HAL API
Reference" chapter.
Related Information
• Using Interrupt Funnels on page 8-11
• HAL API Reference on page 14-1
• Embedded Peripheral IP User Guide
Enabling and Disabling Interrupts
The HAL enhanced interrupt API provides the functions alt_ic_irq_disable(),
alt_ic_irq_enable(), alt_ic_irq_enabled(), alt_irq_disable_all(), alt_irq_enable_all(),
and alt_irq_enabled() to allow a program to disable hardware interrupts for certain sections of code,
and reenable them later. alt_ic_irq_disable() and alt_ic_irq_enable() allow you to disable and
enable individual interrupts. alt_irq_disable_all() disables all interrupts, and returns a context value.
To reenable hardware interrupts, you call alt_irq_enable_all() and pass in the context parameter. In
this way, interrupts are returned to their state prior to the call to alt_irq_disable_all().
alt_irq_enabled() returns nonzero if maskable exceptions are enabled. alt_ic_irq_enabled()
determines whether a specified interrupt is enabled.
Note:
Disable hardware interrupts for as short a time as possible. Maximum interrupt latency increases
with the longest amount of time interrupts are disabled.
For more information about disabled interrupts, refer to the “Keep Interrupts Enabled” chapter.
For more information about these functions, refer to the "HAL API Reference" chapter.
Note:
The HAL legacy interrupt API provides different functions for enabling and disabling individual
interrupts. For all new and updated drivers, Altera recommends using the enhanced API described
in this section.
For more information about the legacy API functions, alt_irq_disable() and alt_irq_enable(), refer
to the "HAL API Reference" chapter.
Related Information
• Keep Interrupts Enabled on page 8-18
• HAL API Reference on page 14-1
Configuring an External Interrupt Controller
The driver for an EIC provides specialized driver settings that are created at the time you generate the
BSP. These settings customize the driver to the EIC configuration found in the Nios II system. The
number and type of settings depends on the EIC implementation, as well as on the number and configura‐
tion of EICs in the hardware system. The SBT creates the BSP with default values, selected to ensure useful
system performance. You can optimize these settings at the time you create the BSP. For details of how to
manipulate the EIC driver settings, refer to the documentation for your specific EIC.
8-14
Enabling and Disabling Interrupts
NII5V2
2015.05.14
Altera Corporation
Exception Handling
Send Feedback