Skip to content

Question about SPI ASYNCH transfer API (documentation need?) #2599

Closed
@LMESTM

Description

@LMESTM

Hello

I've started to deliver STM32 support for SPI ASYNCH. While doing this, I discussed with colleagues and this triggered a question on the trasnfer asynch API (documented here and header file) https://developer.mbed.org/users/mbed_official/code/mbed/docs/6c34061e7c34/group__AsynchSPI.html

The SPI transfer API is very similar to I2C one.
In I2C, even if this is not clearly documented (AFAIK), the transfer consist in sending a Tx command (with Tx_lenght) and then reading the Rx response from slave (with Rx_lenght that might be different from Tx_lenght). Very useful for using many I2C devices indeed.
Note that this could help new comers to explicitely explain that Tx happens first, then Rx happens.

Now coming to my SPI question: do we expect a similar steps approach as in I2C, that is, sending a command, then reading the corresponding response. That could make it easy to use some SPI devices ... or do we consider that because SPI is full duplex (Rx and Tx can happen at the same time) so transfer of Tx and Rx shall happen simultenaously. This takes benefit of the full duplex link, but this is not clear to us which SPI devices would benefit of such interface. For full duplex communication, one could easily consider that having the same Rx and Tx lenght makes things simpler (and allow full usage of the bandwidth).

Thanks in advance for clarifiying this point,
Br
Laurent

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions