Specifications

When you create a board support package (BSP) project, the build tools include all needed device drivers.
You do not need to write HAL ISRs unless you are interfacing to a custom peripheral. For reference
purposes, this section describes the framework provided by HAL BSPs for handling hardware interrupts.
For examples of HAL ISRs, refer to existing handlers for Altera components.
For more information about the Altera-provided HAL handlers, refer to the "Developing Programs Using
the Hardware Abstraction Layer" chapter of the Nios II Software Developer’s Handbook.
Related Information
Developing Programs Using the Hardware Abstraction Layer on page 6-1
HAL APIs for Hardware Interrupts
The HAL provides an enhanced application program interface (API) for writing, registering and
managing ISRs. This API is compatible with both internal and external hardware interrupt controllers.
Altera also supports a legacy hardware interrupt API. This API supports only the IIC. If you have a
custom driver written prior to Nios II version 9.1, it uses the legacy API.
Both interrupt APIs include the following types of routines:
Routines to be called by a device driver to register an ISR
Routines to be called by an ISR to manage its environment
Routines to be called by BSP or application code to control ISR behavior
Both interrupt APIs support the following types of BSPs:
HAL BSP without an RTOS
HAL-based RTOS BSP, such as a MicroC/OS-II BSP
Note:
The legacy API is deprecated. Write new drivers using the enhanced API, even if they are only
intended to support the IIC. Drivers for devices supporting an EIC must use the enhanced API.
Existing legacy drivers continue to be supported until further notice. Make plans to port them to
the enhanced API.
When an EIC is present, the controller’s driver provides driver settings for the BSP, which can be used to
configure the driver. The number and types of the settings depends on the EIC implementation and the
number of EICs present.
For more information, refer to an example of EIC driver settings in the "Vectored Interrupt Controller
Core" chapter in the Embedded Peripherals IP User Guide.
Related Information
Vectored Interrupt Controller Core
The Enhanced HAL Interrupt API
Selecting an Interrupt API
When the SBT creates a BSP, it determines whether the BSP must implement the legacy interrupt API.
Each driver that supports the enhanced API publishes this capability to the SBT through its <driver
name>_sw.tcl file. The BSP implements the enhanced API if all drivers support it. It implements the legacy
API only if required by the drivers.
NII5V2
2015.05.14
HAL APIs for Hardware Interrupts
8-7
Exception Handling
Altera Corporation
Send Feedback