I've been through the HopeRF95W datasheet a couple of times; some parts less and some parts more.
The Payload Data Extraction from FIFO on page 36 is really very clear and concise.
Once the FifoPtrAddr is set to the end the written segment on the buffer (using FifoRxCurrentAddr), we check the number of bytes (NB) received, loop through that number and read the RegFifo; which is an 8bit register, that NB of bytes times.
This github implementation follow this as well:
uint8_t currentAddr = ReadRegister(REG_FIFO_RX_CURRENT_ADDR);
uint8_t receivedCount = ReadRegister(REG_RX_NB_BYTES);
*p_length = receivedCount;
WriteRegister(REG_FIFO_ADDR_PTR, currentAddr);
for(int i = 0; i < receivedCount; i++) {
payload[i] = ReadRegister(REG_FIFO);
}
All clear and easy to understand. I am only curious how the SX1276 knows
to load the next 8 bits of the FIFO into the RegFifo
by simply looping through it?
Is it one of those things where a read triggers some internal event/mechanism on the chip?
My lack of understanding here is probably just lack of experience, since my training and experience is in python.
I am also curious whether this payload extraction procedure is the typical FIFO implementation, or are they always chip dependent?