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

Example explanation of SPI transaction manager

Hi DevZone,

Regarding example: \examples\peripheral\spi_master_using_nrf_spi_mngr, can I ask several questions?

1. I want to modify this code for receive the response from SPI slave too. For configuration, is it only thing I need to do is adding miso_pin number?

.miso_pin = ARDUINO_12_PIN.

2. I want to check the Tx and Rx data, but I could not find the function nrf_drv_spi_transfer, could you please tell how this function is in the example? How can I check the tx and rx data?

Best regards

Parents
  • Hello,

    For a simple spi example with a TX and an RX buffer, I suggest that you take a look at the spi (master) and spis (slave) examples, found in SDK\examples\peripheral\...

    If you need to use the spi_master_using_nrf_spi_mngr there are a couple of things you must set in order to see the data coming from the spi slave:
    You must set the .miso_pin, as you describe. You will also have to set the .end_callback to something else than NULL, and pass it into nrf_spi_mngr_schedule. This is the function that will be called when the transaction is complete. 

    The data is located in the 3rd input variable in NRF_SPI_MNGR_TRANSFER(...). Please see this post.

     

    Best regards,

    Edvin

  • This will work if you use one buffer. If you need different buffers to different SPI slaves, you can send the pointer to the buffer through the p_user_data parameter before NRF_SPI_MNGR_TRANSFER(...).

    BR,

    Edvin

Reply Children
Related