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

nRF52832, SDK15.2 multiple SPI devices; one legacy, the other nrfx

Using an nRF52832 with SDK15.2 can I have multiple SPI devices;

one with DMA and one without DMA?

And can one instance be of legacy type (nrf_drv_spi) and the other be of new nrfx type?

Parents
  • In SDK v15.2.0 the nrf_drv_spi API wraps the new nrfx_spim.c and nrfx_spi.c  drivers, where  nrfx_spim.c are used if SPIx_USE_EASY_DMA is set to 1 in sdk_config.h and nrfx_spi.c is used if it is set to 0. 

    So if you want to use SPIM0 and SPI1, i.e. one SPI interface with EasyDMA and one without, then you need to define the following in sdk_config.h

    // <e> SPI0_ENABLED - Enable SPI0 instance
    //==========================================================
    #ifndef SPI0_ENABLED
    #define SPI0_ENABLED 1
    #endif
    // <q> SPI0_USE_EASY_DMA  - Use EasyDMA
     
    
    #ifndef SPI0_USE_EASY_DMA
    #define SPI0_USE_EASY_DMA 1
    #endif
    
    // </e>
    
    // <e> SPI1_ENABLED - Enable SPI1 instance
    //==========================================================
    #ifndef SPI1_ENABLED
    #define SPI1_ENABLED 1
    #endif
    // <q> SPI1_USE_EASY_DMA  - Use EasyDMA
     
    
    #ifndef SPI1_USE_EASY_DMA
    #define SPI1_USE_EASY_DMA 0
    #endif

    We do generally recommend using the SPIM0-2 interface over the deprecated SPI0-2 interfaces in new designs, see Instantiation in the nRF52832 Product Specification. 

    Best regards

    Bjørn

Reply
  • In SDK v15.2.0 the nrf_drv_spi API wraps the new nrfx_spim.c and nrfx_spi.c  drivers, where  nrfx_spim.c are used if SPIx_USE_EASY_DMA is set to 1 in sdk_config.h and nrfx_spi.c is used if it is set to 0. 

    So if you want to use SPIM0 and SPI1, i.e. one SPI interface with EasyDMA and one without, then you need to define the following in sdk_config.h

    // <e> SPI0_ENABLED - Enable SPI0 instance
    //==========================================================
    #ifndef SPI0_ENABLED
    #define SPI0_ENABLED 1
    #endif
    // <q> SPI0_USE_EASY_DMA  - Use EasyDMA
     
    
    #ifndef SPI0_USE_EASY_DMA
    #define SPI0_USE_EASY_DMA 1
    #endif
    
    // </e>
    
    // <e> SPI1_ENABLED - Enable SPI1 instance
    //==========================================================
    #ifndef SPI1_ENABLED
    #define SPI1_ENABLED 1
    #endif
    // <q> SPI1_USE_EASY_DMA  - Use EasyDMA
     
    
    #ifndef SPI1_USE_EASY_DMA
    #define SPI1_USE_EASY_DMA 0
    #endif

    We do generally recommend using the SPIM0-2 interface over the deprecated SPI0-2 interfaces in new designs, see Instantiation in the nRF52832 Product Specification. 

    Best regards

    Bjørn

Children
Related