Nios® V Processor Software Developer Handbook

ID 743810
Date 7/20/2023
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

8.3.1. HAL APIs for Software Interrupt

Intel provides the HAL Software Interrupt API for writing, registering, and managing ISRs. The Nios V processor supports 1 software interrupt only.

The interrupt API includes the following types of routines:
  • Routines to register an ISR
  • Routines to manage ISR environment
  • Routines to control ISR behaviour
The interrupt API supports the following types of BSPs:
  • Bare-metal HAL BSP
  • Micrium MicroC/OS-II (uC/OS-II) BSP
  • FreeRTOS* BSP

You need to perform the following steps to implement software ISR with HAL software interrupt API:

  1. Create your ISR functions prototype that handles software interrupt.
  2. Ensure your program registers the ISR with the HAL driver by calling alt_niosv_register_msw_interrupt_handler().
  3. Enable software interrupt with alt_niosv_enable_msw_interrupt().
Table 36.  HAL Software Interrupt API Functions
Function Name Description
alt_niosv_register_msw_interrupt handler() Register an interrupt handler to handle software interrupt.
alt_niosv_enable_msw_interrupt() Enables software interrupt.
alt_niosv_disable_msw_interrupt() Disables software interrupt.
alt_niosv_is_msw_interrupt_enabled() Determine if the software interrupt is enabled.
alt_niosv_trigger_msw_interrupt() Generate a software IRQ.
alt_niosv_clear_msw_interrupt() Clear the current software IRQ