Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
20 years ago

How to set ISR in NiosII?

Hi all,

Now I want to receive info from a custom UART in NiosII IDE by Interruption.

I notice the code for receiving interruption in NiosI goes like this:

-----------

int main(void)

{

int context=0;

....

nr_installuserisr(na_uart_1,receiver_routine,context);

na_uart_1->np_uartcontrol=npuartcontrol_irrdy_mask;

while(1)

{

rxchar=getchar_from_uart_1();

}

....

}

----------------------

and the relevent subroutine goes like this:

----------------------

char getchar_from_uart_1(int context)

{

char c;

c=na_uart_1->np_uartrxdata;

return c;

}

---------------------

Here I have got a question about their counterparts in

NiosII.I have scanned the docs shipped with NiosII,

but I cannot find the info I need.

Any suggestions?

Thanks in advance!

Regards,

Don

11 Replies