# Configure SPI in sensor core 

Source: [https://docs.qualcomm.com/doc/80-88500-1/topic/34_Configure_SPI_in_sensor_core_.html](https://docs.qualcomm.com/doc/80-88500-1/topic/34_Configure_SPI_in_sensor_core_.html)

## About this task
To configure the SPI in the sensor core, do the following:

## Procedure

- See <cite class="cite">Sensors Execution Environment (SEE) Sensors Deep Dive</cite> (80-P9301-35) and update the JSON file.
- Define the SPI instance in the /slpi\_proc/core/settings/buses/spi/interface/kona/spi\_devcfg.h file.
        
For example, to enable the `SPI_2` define the following instance in the spi\_devcfg.h file:

        #define SSC_USE_SPI_02Copy to clipboard

            Based on this definition, the software configures the SPI as per the following structure:

        #ifdef SSC_USE_SPI_02
             {
                 .core_base_addr              = (uint8 *) 0x62600000,
                 .core_offset                 = 0x00084000,
                 .core_index                  = 1,
                 .core_irq                    = 0,   //not used, we use GSI callback
        
                 .polled_mode                 = FALSE,
                 .min_data_length_for_dma     = 0,
         
                 .gpi_index                   = 7,
                 .se_clock_dfs_index          = 0,
                 .se_clock_frequency          = 19200,
         
                 .miso_encoding                = SSC_SPI_02_MISO,
                 .mosi_encoding                = SSC_SPI_02_MOSI,
                 .clk_encoding                 = SSC_SPI_02_CLK,
                 .cs_encoding                = {SSC_SPI_02_CS_0, SSC_SPI_02_CS_1, SSC_SPI_02_CS_2, 0, 0, 0, 0},
         
                 .tcsr_base_addr              = (uint8 *) 0x62600000,
                 .tcsr_reg_offset             = 0x00000000,
                 .tcsr_reg_value              = 0x00000000,
         
                 .tx_dma_ring_base            = gpi_tx_tre_list_base_02,
                 .rx_dma_ring_base            = gpi_rx_tre_list_base_02,
             },
         #endif Copy to clipboard

Note: If there are no hardware design changes, do not modify this structure.

**Disable SPI**

To disable SPI, remove the SPI instance from the `spi_devcfg.h` file.

**Parent Topic:** [SPI in QUP](https://docs.qualcomm.com/doc/80-88500-1/topic/30_SPI_in_QUP_v3.html)

Last Published: Aug 18, 2023

[Previous Topic
Measure SPI throughput](https://docs.qualcomm.com/bundle/publicresource/80-88500-1/topics/33_Measure_SPI_throughput.md) [Next Topic
Enable SPI bus in sensor low-power island (SLPI)](https://docs.qualcomm.com/bundle/publicresource/80-88500-1/topics/35_Enable_SPI_bus_in_sensor_low_power_island__SLPI_.md)