This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

What does CONFIG_SPI_ASYNC do?

I'm working with an nRF5340-PDK board and have SPIS (SPI slave) working at a basic level.

I'm using CONFIG_SPI_ASYNC=y, but I'm wondering what will change if I use CONFIG_SPI_ASYNC=n

My current call to spi_transceive() returns with data in the rx_bufs

If I change to CONFIG_SPI_ASYNC=n does the behavior change to an architecture where the call to spi_transceive() starts the operation and there is some kind of callback to fill the buffer with the received data?  Or does it mean something else?

Is there example code somewhere of how to properly use CONFIG_SPI_ASYNC=n?

Parents
  • Hi Douglas,

    If you are using spi_transceive then you are making a synchronous call and when this function returns, then you should have the data received already in the rx_bufs. 

    CONFIG_SPI_ASYNC=y can be used if you need asynchronous call support in which case you need to call spi__transceive_async. Your registered signal handler will be signalled when the spi async transaction is complete after your tx has been transmitted and the rx bytes has been put in the rx_bufs in this case.

Reply
  • Hi Douglas,

    If you are using spi_transceive then you are making a synchronous call and when this function returns, then you should have the data received already in the rx_bufs. 

    CONFIG_SPI_ASYNC=y can be used if you need asynchronous call support in which case you need to call spi__transceive_async. Your registered signal handler will be signalled when the spi async transaction is complete after your tx has been transmitted and the rx bytes has been put in the rx_bufs in this case.

Children
Related