how to test spi_loopback in NCS1.8? how to know recv data lenght?

Hello,

nRF Connect SDK1.8.0, Windows10 X64.

default code, test spi loopback,

how to know recv data lenght?

    

thanks

Best  regards,

yuyou

Parents
  • Hi,

    If the SPI is a master, spi_transceive() will fill the entire rx buffer with data from the miso pin, and it will send all the data from the tx buffer at the same time.
    If the SPI is a slave, spi_transceive() will return how much data it has received, and it will have sent data from the tx buffer at the same time.

    Note that not all the data in the master's rx buffer is necessarily useful data, as the SPI master simply reads the pin until the buffer is full. Interpreting the contents of the buffer is done by a device driver or your application.

Reply
  • Hi,

    If the SPI is a master, spi_transceive() will fill the entire rx buffer with data from the miso pin, and it will send all the data from the tx buffer at the same time.
    If the SPI is a slave, spi_transceive() will return how much data it has received, and it will have sent data from the tx buffer at the same time.

    Note that not all the data in the master's rx buffer is necessarily useful data, as the SPI master simply reads the pin until the buffer is full. Interpreting the contents of the buffer is done by a device driver or your application.

Children
Related