I don't know, I think that the first read operation is in the following part of the code;
PE_ISR(ASerialLdd1_Interrupt)
{
/* {Default RTOS Adapter} ISR parameter is passed through the global variable */
ASerialLdd1_TDeviceDataPtr DeviceDataPrv = INT_UART0__DEFAULT_RTOS_ISRPARAM;
register uint32_t StatReg = UART0_PDD_ReadInterruptStatusReg(UART0_BASE_PTR); /* Read status register */
register uint16_t OnErrorFlags = 0U; /* Temporary variable for flags */
register uint8_t OnBreakFlag = 0U; /* Temporary variable flag for OnBreak event */
register uint16_t Data; /* Temporary variable for data */
if (StatReg & (UART0_S1_NF_MASK | UART0_S1_OR_MASK | UART0_S1_FE_MASK | UART0_S1_PF_MASK)) { /* Is any error flag set? */
UART0_PDD_ClearInterruptFlags(UART0_BASE_PTR, (UART0_S1_NF_MASK | UART0_S1_OR_MASK | UART0_S1_FE_MASK | UART0_S1_PF_MASK));
Data = (uint16_t)UART0_PDD_GetChar8(UART0_BASE_PTR); /* Read an 8-bit character from receiver */
if ((StatReg & UART0_S1_FE_MASK) != 0U) { /* Is the framing error detected? */
if (((StatReg & UART0_S1_RDRF_MASK) != 0U) && (Data == 0U)) { /* Is the zero character in the receiver? */
OnBreakFlag++;
DeviceDataPrv->SerFlag |= BREAK_DETECTED; /* If yes then set the flag */
} else {
OnErrorFlags |= LDD_SERIAL_FRAMING_ERROR; /* If yes then set the flag */
}
}
if ((StatReg & UART0_S1_OR_MASK) != 0U) { /* Is the overrun error flag set? */
OnErrorFlags |= LDD_SERIAL_RX_OVERRUN; /* If yes then set the flag */
}
if ((StatReg & UART0_S1_PF_MASK) != 0U) { /* Is the parity error flag set? */
OnErrorFlags |= LDD_SERIAL_PARITY_ERROR; /* If yes then set the flag */
}
if ((StatReg & UART0_S1_NF_MASK) != 0U) { /* Is the noise error flag set? */
OnErrorFlags |= LDD_SERIAL_NOISE_ERROR; /* If yes then set the flag */
}
DeviceDataPrv->ErrFlag |= OnErrorFlags; /* Copy flags status to ErrFlag status variable */
StatReg &= (uint32_t)(~(uint32_t)UART0_S1_RDRF_MASK); /* Clear the receive data flag to discard the errorneous data */
if (OnBreakFlag != 0U) {
ASerialLdd1_OnBreak(DeviceDataPrv->UserDataPtr); /* If yes then invoke user event */
} else {
ASerialLdd1_OnError(DeviceDataPrv->UserDataPtr); /* Invoke user event */
}
}
if (StatReg & UART0_S1_RDRF_MASK) { /* Is the receiver's interrupt flag set? */
InterruptRx(DeviceDataPrv); /* If yes, then invoke the internal service routine. This routine is inlined. */
}
if (DeviceDataPrv->SerFlag & ENABLED_TX_INT) { /* Is the transmitter interrupt enabled? */
if (StatReg & UART0_S1_TDRE_MASK) { /* Is the transmitter empty? */
InterruptTx(DeviceDataPrv); /* If yes, then invoke the internal service routine. This routine is inlined. */
}
}
}
Do you think that it is correct? how can I read the uart0_d register?