Home |
RTTarget-32 Programming Manual Function RTSendBufferCount System Management BIOS (SMBIOS) Advanced Programmable Interrupt Controller (APIC) |
Function RTSendBufferCountThe status of the send buffer can be enquired with this function: int RTSendBufferCount(int Port); ParametersPortMust have value RT_COM1 .. RT_COM4. return valueThe number of bytes currently in the send buffer for the corresponding port. Please note that the last byte may still be in the send shift register even if this function returns 0. To be sure all data has been transmitted, check bit RT_TX_SHIFT_EMPTY in the Line Status register. Example:while (RTSendBufferCount(P) > 0) { printf("waiting for the send buffer... "); RTWait(); } while (!(RTLineStatus(P) & RT_TX_SHIFT_EMPTY)) printf("waiting for the UART... ");
|