I could not find an extra bit for clearing interrupt. Normally TxD-Interrupt is cleared by writing THR and RxD-Interrupt is cleared by reading RHR.
I am happy with my new interrupt handled serial communication class now, everything works perfectly.
Here is my final IRQ-Handler:
void SerialCom::IrqHandler()
{
status = usartPtr->US_CSR;
// --------------------------------------------------------------------------
// Transmit-Interrupt (Sendepuffer ist frei)
// --------------------------------------------------------------------------
//
if(status & US_CSR_TXRDY)
{
// Der Sendepuffer ist frei
//
if(restSend > 0)
{
// es sind noch Zeichen zum Senden da
//
usartPtr->US_THR = *ptrSend;
ptrSend++;
restSend--;
}
// Der Transmit-Interrupt wird gesperrt,
// wenn das letzte Zeichen ausgegeben wurde.
if(restSend < 1)
usartPtr->US_IDR = US_IDR_TXRDY;
}
// --------------------------------------------------------------------------
// Receive-Interrupt (Zeichen wurde empfangen)
// --------------------------------------------------------------------------
//
if((status & US_CSR_RXRDY) && (restRec > 0))
{
// Ein Byte wurde empfangen und
// es sind noch Speicherplätze frei
//
*ptrRec = usartPtr->US_RHR;
ptrRec++;
restRec--;
}
}
And here is the sending function:
void SerialCom::write(uint8_t *wrPtr, int nrOfBytes)
{
restSend = nrOfBytes - 1;
usartPtr->US_THR = *wrPtr;
if(nrOfBytes > 1)
{
ptrSend = wrPtr + 1;
usartPtr->US_IER = US_IER_TXRDY;
}
}
Thank You again for Your interest and valuable comments.
For me this issue is solved.