Nios Interrupts
Nios Interrupts
EE 3921 2 © tj
NIOS Interrupts
• HAL Framework – Interrupts
EE 3921 3 © tj
NIOS Interrupts
• HAL Framework – Interrupts
EE 3921 4 © tj
NIOS Interrupts
• HAL Framework – Interrupts
EE 3921 6 © tj
NIOS Interrupts
• HAL Framework – Interrupts
EE 3921 7 © tj
NIOS Interrupts
• HAL Framework – Interrupts
alt_ic_isr_register()
alt_ic_irq_disable()
alt_ic_irq_enable()
alt_irq_disable_all()
alt_irq_enable_all()
alt_ic_irq_enabled()
EE 3921 8 © tj
NIOS Interrupts
• HAL Framework – Interrupts
alt_irq_register() alt_irq_interruptible()
alt_irq_disable() alt_irq_non_interruptible()
alt_irq_enable() alt_ic_irq_enabled()
alt_irq_disable_all()
alt_irq_enable_all()
EE 3921 9 © tj
NIOS Interrupts
• HAL Framework – Interrupts
EE 3921 10 © tj
NIOS Interrupts
• HAL Framework – Interrupts
• Register prototype
interrupt controller ID – not used with IIC - 0
interrupt ID – from system.h
isr name – your choice
pointer to any passed context – e.g PIO input value
this can be any type → needs a “void” pointer
#define SW_PIO_HAS_IN 1
#define SW_PIO_HAS_OUT 0
#define SW_PIO_HAS_TRI 0
#define SW_PIO_IRQ 10
#define SW_PIO_IRQ_INTERRUPT_CONTROLLER_ID 0
#define SW_PIO_IRQ_TYPE "EDGE"
#define SW_PIO_NAME "/dev/sw_pio"
#define SW_PIO_RESET_VALUE 0
#define SW_PIO_SPAN 16
#define SW_PIO_TYPE "altera_avalon_pio"
EE 3921 11 © tj
NIOS Interrupts
• HAL Framework – Interrupts
• ISR prototype
EE 3921 12 © tj
NIOS Interrupts
• HAL Framework – process
int
Choose a name Create a global
foo
for ISR variable
EE 3921 13 © tj