Forum Discussion
UART block until all data is sent
- 4 years ago
Hi,
May be you can try to access these uart core control register bits for interrupt. Can refer to this manual (page 145).
Best Regards
Sheng
p/s: If any answer from community or Intel support are helpful, please feel free to mark as solution and give Kudos.
I can make the UART operate in blocking mode using fcntl(). In blocking mode, a call to write something to the UART will block if the SW buffer is full. Unfortunately what I need to know is when the SW buffer empties. In altera_avalon_uart.h I see that the size of the SW buffer for both RX and TX is set to ALT_AVALON_UART_BUF_LEN. If edit this to two, one did not work, I get almost what I want. Unfortunately It also sets the RX buffer to a low value for this UART and both RX and TX buffer of all the other UARTs to a lower value than I like. I can probably make my own driver where I resolve this issues. But for now I think I will just bypass the driver and access the UART registers directly to achieve what I need.