Hello Alice,
Thanks for your quick response.
In the example that You gave me, callback function does not perform any task. Sorry, but I probably did not formulate my question very well and that You do not give me the answer I expected. I will explain in detail my goal.
The data that must be sent by serial interface is of undefined length and arrive at an unspecified time. My goal is to store the data into a structure of type FIFO (eg queue) and allow interrupts on TX_ready. When callback function is called, it checks for the presence of data in the queue and transmit next byte. If queue is empty - callback function disables interrupts. Something similar is implemented in the KDS legacy uart driver, but instead uses of queue is used rotating list.
In my case, the problem is how to make the process to start sending the very first byte. If I insert the byte in the queue, it is still not allowed interrupt. If I allow interruptions by hand, the interruption will be called, but interrupt function will exit immediately because "isTxBusy" is not set. If "isTxBusy" is set by me, then will be transmitted byte which is in "txBuff", but who will put my byte inside this "txBuff"?
Perhaps the solution is very simple but I did not find it.
Furthermore, project you have indicated did not use PEx, although this is the smallest problem.
Best Regards,
Peter