I’m writing a W5500 driver from scratch.
The documentation for the W5500 does not explain the buffering concept well.
It appears to be a circular buffer for which the driver code is responsible for maintaining the write address. I assume the chip maintains the read address. Is this correct?
Reading the Sn_TX_WR register, is the value an absolute address, or relative to an internally-calculated base address for the socket?
In other words, if I write a 0 to Sn_TX_WR, will that always select the first byte of the buffer, no matter what socket?
If I write Sn_TX_WR with an address beyond the range for that socket, is it automatically wrapped back to the start of the buffer?
In other words, does the driver code need to AND the address with a mask before writing it to make sure it does not go beyond the top of the buffer?
If this is the case, then I presume the mask will change depending on the size specified for the buffer?
Then by default the mask would be 0x7ff for a 2k byte buffer?