I am using the UARD Driver, and in particular I'm using the read api function to receive data form UART and saving them into an array of bytes:
g_sf_comms0.p_api->read(g_sf_comms0.p_ctrl, (uint8_t *)bufferRX, MAX_NUMBER_BYTES_RX, TX_NO_WAIT);
The array bufferRX is filled with the maximum number of bytes possible (MAX_NUMBER_BYTES_RX), that is a constant, but I want to know when I am receiving something and how many bytes has been received. Is there a way to achieve that?
In other words, I was wondering is there is a way to fill the rx buffer when a certain number of bytes arrives through the UART and to know how many are those bytes.
Can anyone help?
Thanks.