Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
12748 Discussions

Elegant way to replace your standard uart isr's ?

Altera_Forum
Honored Contributor II
1,028 Views

Hello, 

I know that the avalon uart component has its HAL routines (driver) sitting in the module altera_avalon_uart.c and using header file altera_avalon_uart.h. 

 

So if I want my own driver behave differently than the standard one (for example: I want it to wake a background task only if received character matches the one stored in EOP register) I would need to include my version of the functions alt_avalon_uart_init() and alt_avalon_uart_irq(). This way the linker will see my functions first and will not link the standard library... 

 

The problem I have is that I would like to change some stuff located in the header, too: 

- I would like to increase the size of the receiver ring buffer  

- I want to add some members to the alt_avalon_uart_dev struct to keep an address of my device and wake my background task only when EOP arrives AND the packet is addressed to my device... 

 

I could call a different header file from my project, but unfortunatelly the auto-generated module alt_sys_init.c will still call the standard header file altera_avalon_uart.h... 

 

I could of course change the standard header file altera_avalon_uart.h but then I would have to remember to change it every time I upgrade quartus/nios SDK. 

I feel this is not a very elegant way to replace library modules... 

 

Do you know any more elegant way to re-do the UART driver ?
0 Kudos
0 Replies
Reply