SPI transaction manager

What am I missing when

NRF_SPI_MNGR_DEF(my_spi_mgr, 2560, 0);

causes:

../../../../../../integration/nrfx/legacy/nrf_drv_spi.h:120:37: error: 'NRF_DRV_SPI_INSTANCE_0' undeclared here (not in a function); did you mean 'NRF_DRV_SPI_INSTANCE_'?

, and are there any actual examples of using spi transaction manager?

I only found "spi_master_using_nrf_spi_mng", but there ths SPI seems to be buried somewhere deep in the LCD code.

  • Hmm, it looks like nrf_drv_spi.h includes apply_old_config.h even if sdk_config.h is included (<-nrfx.h<-nrfx_config.h<-sdk_config.h).

    The NRF_DRV_SPI_INSTANCE_0 is still not defined in nfr_drv_spi.h.

    Any idea what's wrong?

    These are black:

    #define NRF_DRV_SPI_INSTANCE(id)    NRF_DRV_SPI_INSTANCE_(id)
    #define NRF_DRV_SPI_INSTANCE_(id)   NRF_DRV_SPI_INSTANCE_ ## id
    

    but these are gray:

    #if NRFX_CHECK(NRFX_SPIM0_ENABLED)
        #define NRF_DRV_SPI_INSTANCE_0 \
            { 0, { .spim = NRFX_SPIM_INSTANCE(0) }, true }
    

    In sdk_config.h there is:

    #ifndef NRFX_SPIM0_ENABLED
    #define NRFX_SPIM0_ENABLED 1
    #endif
    

  • Yes. It was the configuration. Some more different SPI/SPIM/QUEUE enables, and it compiled fine.

    "Something old, something new..." :-D

Related