Hi
I have been using nRF52 in my project. I am not using provided uart drivers for one uart -> UARTE1. I am using DMA access and I have no problem to send and record messages from multiple devices on this channel (connected to different pins so I am talking with only one perypherial at time) when nRF starts communication.
Right now one of devices can (can but don't have to) give a response without nRF starting communication. I know with when it will happen but the length of response is unknown and exact time is also unknown.
Right now I just prepare device for the message:
NRF_UARTE1->RXD.MAXCNT = message_rx_size;
NRF_UARTE1->RXD.PTR = (uint32_t)&message_rx[0];
NRF_UARTE1->TASKS_STARTRX = 1;
and after some time I just close receiving.
NRF_UARTE1->TASKS_STOPRX = 1;
And my implementation has two potential problems.
1st I am starting reciving in an arbitrary moment, since I dont know can I check for a flag that we have some interrupt (list of avaliable events is below). Which event indicate new transmission comming? (Of cours I will need to enable this interrup in INTEN and INTENSET registers)
2nd. I stop after some time. I don't know if I will have 1b, 25b or 512b of data. Is there a good solution to check if there is nothing more comming? I know that if the data will be comming, all data will be at once. If delay between 2 characters will be above some threshold (e.g. 10ms) then it is not a part of the message and I dont want to record this.
Looking for a hint!
Pawel