clarification on spi_transceive

Venkat Rao Vallapaneni <vallapaneni@...>


Just to be consistent with my driver development, I would like to understand more about the usage of tx_bufs and rx_bufs arguments to function spi_transceive.

I understand that if tx_bufs is NULL, it is half-deplex rx transfer and if rx_bufs is null, half-duplex tx.

What if I have a transfer in which first few bytes are tx and remaining bytes are rx (similar to FRAM write/read for example)? Can I set rx_bufs[0].buf as NULL and rx_bufs[1].len as 0? Or do I need to pass rx_bufs[1].len same as tx_bufs[1].len and provide some memory buffer for rx_bufs[0].buf? What about tx_bufs[1]?

I would like to understand these arguments so that my driver is in consistent with API.


Join { to automatically receive all group messages.