Nios® II Software Developer Handbook

ID 683525
Date 8/28/2023
Public
Document Table of Contents

9.2.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.

Intel FPGA 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.