Nios® II Software Developer Handbook

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

15.1.46. alt_irq_register()

Prototype

int alt_irq_register (alt_u32 id,


 void* context,

void (*isr)(void*, alt_u32))

Commonly Called By

Device drivers

Thread-safe

Yes.

Available from ISR

No.

Include

<priv/alt_legacy_irq.h>

Description

The alt_irq_register() function registers an ISR. If the function is successful, the requested interrupt is enabled on return.

The input argument id is the interrupt to enable. isr is the function that is called when the interrupt is active. context and id are the two input arguments to isr.

Calls to alt_irq_register() replace previously registered handlers for interrupt id.

If irq_handler is set to null, the interrupt is disabled.

1 This function is part of the legacy HAL interrupt API, which is deprecated. Intel recommends using the enhanced HAL interrupt API.

For more information about using the enhanced HAL interrupt API, refer to “ Nios® II Interrupt Service Routines” in the "Exception Handling" section.

Return

The alt_irq_register() function returns zero if successful, or non-zero otherwise.