I want to transfer a bunch of data over the virtual com port to a PC using the USB port on the nrf5340. I'm using the CDC ACM sample: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/samples/subsys/usb/cdc_acm/README.html
That sample takes a character in and pushes the character back out. Simple and it works.
Since I want to dump a bunch of data, I started doing the same uart_fifo_fill() command. It appears I can only add 1024 bytes to that at a time, which is fine. That function returns the number of bytes it send (or added to the buffer).
My question is, how do I know when I can add more data to that buffer? When can I call that command again. There were a couple other functions in UART.H and the one when TX was completed is not implemented and the other is "TX buffer can take at least 1 byte of data" but that doesn't seem ideal. I want to know when I can send 1024 bytes of data again.
What's the ideal method for pushing a bunch of data through the UART so that it runs as fast as possible and I know when I can push more data into the buffer?