Other Parts Discussed in Thread: HALCOGEN
In HALCoGen Examples for TMS570LC43xx to transmit data over SCI, busy condition is verified first and then the byte has been transmitted by sciSendByte function. Following is the code snipped from the example:
- while ((UART->FLR & 0x4) == 4); /* wait until busy */
- sciSendByte(UART,*text++); /* send out text */
I have three queries associated with the same:
- While ((UART->FLR & 0x4) == 4) line checks the status of SCI Flags Register (SCIFLR). Since the register is logically ANDed with 0x4, is shall be checking 3rd bit from the 32 bit register. Now looking at the register, 3rd bit is “IDLE” that checks whether SCI receiver in idle state or not. My query here is, why do we need to check the receiver state while we are transmitting the data from SCI? Also, the comment reads as wait until busy. Looking at the register configuration, bus busy flag is 4th So, if that’s the purpose to check, shall we not AND logically with 0x8?
- Shall we check bus busy flag only or bus busy flag as well as Txbuf empty both?
- Instead of writing while ((UART->FLR & 0x4) == 4);, can we use uint32 sciIsIdleDetected ( sciBASE_t * sci ) or uint32 sciIsTxReady ( sciBASE_t * sci )?