This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

The difference between function(UARTCharPutNonBlocking) and (UARTCharPut)



hello,

I'm learning C6748.

when I learn the UART. I find two function. (UARTCharPutNonBlocking) and (UARTCharPut)

but in the head file. I can't understand their difference. 

because when I Simulate. their function both show baseAdd's stored value.

1:unsigned int UARTCharPutNonBlocking(unsigned int baseAdd, unsigned char byteWrite);

2:void UARTCharPut(unsigned int baseAdd, unsigned char byteTx);

ps: I want to know how to see the UARTCharPutNonBlocking‘s code(written by C language) in CCS or in startware's files.

thanks 

Shi

  • Hi Shi,

    Have you downloaded the C6748 starterware code ?

    Please refer to the below location for the UART driver code.

    C6748_StarterWare_1_20_04_01/drivers/uart.c


    UARTCharPutNonBlocking -> We have used "if" condition to check the TSR register for this API

    UARTCharPut -> We have used "while" condition to check the TSR register for this API

    The main difference here is that "This loop will check the emptiness of THR and TSR registers indefinitely"

  • Hi,

    Thanks for your post.

    Both the UART API functions attempts to write a byte into THR but the API "UARTCharPutNonBlocking" checks only once if the transmitter FIFO is empty and if yes, it write the byte else, it returns FALSE. But in the case of "UARTCharPut" API, this checks indefinitely for the emptiness of both the THR and TSR through while loop and then write data into the transmitter FIFO.

    Thanks & regards,

    Sivaraj K

    -------------------------------------------------------------------------------------------------------

    Please click the Verify Answer button on this post if it answers your question

    -------------------------------------------------------------------------------------------------------

     

     

  • Thanks for your generaous help, I have understanded it.

  • Hi Rui,

    Thanks for the update.