Specifications
In determining the interrupt API to use, the SBT ignores any devices whose interrupts are not connected
to the Nios II processor associated with the BSP.
A driver can publish its interrupt API support by way of a software property. The driver’s <driver name>_
sw.tcl file uses the set_sw_property command to set supported_interrupt_apis to either
legacy_interrupt_api, enhanced_interrupt_api, or both.
Drivers supporting the enhanced API always publish that support. If supported_interrupt_apis is
undefined, the SBT assumes that the driver only supports the legacy API.
Starting in 9.1, all Altera device drivers support both APIs. These drivers can be used in a BSP along with
legacy drivers. The SBT determines whether the legacy API is required, and implements it only if it is
required. If there are no drivers requiring the legacy API, the BSP implements the enhanced API.
A driver can be written to support only the enhanced API. However, you cannot combine such a driver
with legacy drivers.
For more information and details about writing a driver to support both APIs, refer to the "Supporting
Multiple Interrupt APIs” chapter.
Related Information
Supporting Multiple Interrupt APIs on page 8-10
The Enhanced HAL Interrupt API
Table 8-1: Enhanced HAL Interrupt API Functions that Manage Hardware Interrupt Processing
Function Name Implemented By
alt_ic_isr_register() Interrupt controller driver ()
alt_ic_irq_enable() Interrupt controller driver ()
alt_ic_irq_disable() Interrupt controller driver ()
alt_ic_irq_enabled() Interrupt controller driver ()
alt_irq_disable_all() HAL
alt_irq_enable_all() HAL
alt_irq_enabled() HAL
Note: If the system is based on an EIC, these functions must be implemented by the EIC driver. If the
system is based in the IIC, the functions are implemented by the HAL. For more information about
each function, refer to the "HAL API Reference" chapter of the Nios II Software Developer’s
Handbook.
Related Information
HAL API Reference on page 14-1
Using the Enhanced HAL Interrupt API to Implement ISRs
Using the enhanced HAL API to implement ISRs requires that you perform the following steps:
1. Write your ISR that handles hardware interrupts for a specific device.
2. Ensure that your program registers the ISR with the HAL by calling the alt_ic_isr_register()
function. alt_ic_isr_register() enables hardware interrupts for you.
8-8
The Enhanced HAL Interrupt API
NII5V2
2015.05.14
Altera Corporation
Exception Handling
Send Feedback