Is exist any way to detect IDLE RX line on UART?
I try to use RXTO but this is seted each time when 1 byte comes.
everytime, it changed size of data which will be readed.
Is exist any way to detect IDLE RX line on UART?
I try to use RXTO but this is seted each time when 1 byte comes.
everytime, it changed size of data which will be readed.
Hi
You mean you just want to check if the RX line is high or not?
You should be able to read the input state of the pin even when it is used by the UART interface, for instance by calling nrf_gpio_pin_read(n).
Best regards
Torbjørn
No, I want to know that all receiving data already comed.
Good luck
I am using library serial and there is too timeout. Which is good practice to use uart when I will read more then one byte?
I used serial uarte, I used DMA, I try used timer. When data start comes timer started and in response handler reed out data. but in this case I often reed out timeout.
It is better read every byte in one period of cycle and add it to buffer and wait for timeout?
Thank you
Hi
I am a bit unsure I understand the question correctly. In general you should expect to get a timeout after the last bytes of the transaction has been received, as there will be no more data coming over the UART.
If you want to ensure that you receive the entire message in one callback you should make sure the RX buffer is larger than the maximum packet size you expect.
Otherwise you simply have to buffer the data in the application, and wait until all the bytes are received before processing the data.
Best regards
Torbjørn
Thank you for information.
You welcome
You welcome