The xfer function initiates a transmit, receive, or exchange transaction. The prototype for this function is:
void *xfer( void *hdl, uint32_t device, uint8_t *buf, int *len );
The arguments are:
The function must return a pointer to the receive/exchange buffer, and store, in the location that len points to, the byte length of the data that has been transmitted, received, or exchanged by the low-level module. The high-level code checks the length to determine whether the transaction was successful.