How does NRFX_SPIM_FLAG_RX_POSTINC work?

Can you please explain how NRFX_SPIM_FLAG_RX_POSTINC works?
My data keeps always being loaded into the same address.
Here is my code snippet:

uint8_t tx_buffer_MAG[1] = {0xC0 | LIS3MDL_OUT_X_L};

xfer.p_tx_buffer = PPI_Config[MAG].tx_buffer;
xfer.tx_length = 1;
xfer.p_rx_buffer = PPI_Config[MAG].pIMUBufferInfo->pCaptureBuffer;
xfer.rx_length = 6;

uint32_t flags = NRFX_SPIM_FLAG_NO_XFER_EVT_HANDLER | // No SPI event handlers as we don't want to wake up CPU on SPI events
                         NRFX_SPIM_FLAG_RX_POSTINC | // Increment address in buffer after each transfer
                         NRFX_SPIM_FLAG_REPEATED_XFER; // Indicate that we are transferring numerous times)

uint8_t status;

for (int i=0; i<10; ++i)
{
   nrf_delay_ms(10);
   do {
             LIS3MDL_mag_data_ready_get(&status);
        } while (!status);

    nrf_drv_spi_xfer(&m_spi[MAG], &xfer, flags);
}


I also tried to use 

      nrf_spim_task_trigger((&(PPI_Config[MAG].pSPIInstance)->u.spim)->p_reg, NRF_SPIM_TASK_START);

With NRFX_SPIM_FLAG_HOLD_XFER set.
And it does not trigger the start of transfer.

What am I doing wrong?




Related