This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

RTOS/AM5728: SPI_configuration

Part Number: AM5728

Tool/software: TI-RTOS

Hi all,

I need to know how can I configure an SPIx_d0 as MOSI or MISO and the same thing for SPIx_d1? 

thanks a lot 

  • Hi Walid,

    The functions that configure McSPI MISO/MOSI data lines are:

    pdk_am57xx/packages/ti/csl/src/ip/mcspi/V0/priv/mcspi.c

    McSPIMasterModeConfig()
    McSPIPinDirSet()

    You can refer to the below example how these functions are used:

    pdk_am57xx/packages/ti/csl/example/mcspi/mcspiMasterSlave/mcspiMasterSlave_spi1_spi2.c

    Check also the McSPI RTOS user guide:

    software-dl.ti.com/.../index_device_drv.html

    Regards,
    Pavel
  • Thank you very much Pavel :D I configured the dataLineCommMode and it works:

    /* Modify the default SPI configurations if necessary */

    spi_cfg.chnCfg[spi_cfg.chNum].dataLineCommMode = MCSPI_DATA_LINE_COMM_MODE_1;

    /**
    * \brief Communication on Data line pins is configured as :
    * Data line 0 (SPIDAT[0]) selected for reception
    * Data line 1 (SPIDAT[1]) selected for transmission
    * No transmission on Data Line 0 (SPIDAT[0])
    */
    #define MCSPI_DATA_LINE_COMM_MODE_1 (((uint32_t) MCSPI_CH0CONF_IS_LINE0 << \
    MCSPI_CH0CONF_IS_SHIFT) | \
    ((uint32_t) MCSPI_CH0CONF_DPE1_ENABLED << \
    MCSPI_CH0CONF_DPE1_SHIFT) | \
    ((uint32_t) MCSPI_CH0CONF_DPE0_DISABLED \
    << MCSPI_CH0CONF_DPE0_SHIFT))

  • Walid,

    Glad to see you have fix it.

    If you have no more questions related to the subject of this e2e thread, please close/resolve/verify this thread.

    Regards,
    Pavel