cancel
Showing results for 
Search instead for 
Did you mean: 

UART Interrupt handler (STR730)

javida14
Associate II
Posted on November 14, 2006 at 00:20

UART Interrupt handler (STR730)

2 REPLIES 2
javida14
Associate II
Posted on November 03, 2006 at 14:01

I need to write an interrupt handler for the uarts for Tx and Rx. Does anyone have some code that they are willing to share?

I will be writing an API that will write data into a Tx circular queue. At the completion of the write the Tx Interrupt will be enabled. At this point a Tx interrupt should be generated and the interrupt handler will then move data from the Tx queue to the Tx FIFO until the queue is empty or the FIFO becomes full. When the Tx FIFO become empty an interrupt will be asserted, the handler will then move more data to the FIFO, or if the queue if empty, the Tx interrupt will be disable.

Similar for the Rx interrupt.

Should a wrapper be build around the UART library or should some added functions be added to the UART library?

javida14
Associate II
Posted on November 14, 2006 at 00:20

I have the handler working. Created a file called uart.c and added four functions to it so far which are wrappers to the library. Com_Putc writes a char to a transmit circular queue and the interrupt handler moves data to the transmit fifo as needed. Com_Getc reads from the receive queue in which data was inserted from the receive FIFO. Com_Getc returns True if data was in the fifo. Com_Putc returns True if the transmit queue was not full. 73x_it.c for each of the UARTs calls UART_Isr with the enum COM number as its argument