AnsweredAssumed Answered

SPI slave select in Software control

Question asked by ANANDSM on Aug 18, 2014
Latest reply on Oct 13, 2014 by ANANDSM

Hi All,

 

I am using the ADSP-BF538F processor. I am configuring the SPI2 in master mode in CCES 1.1.0 IDE.

I want to use the SPI2 slave select SPI2SEL1  in user software control and the configuration is shown below.

 

could you please let me know, whether I need to  configure the pin related to SPI2SEL1  as GPIO (PD9) and control its logic level through GPIO API?

Please guide me on this.

 

/* flag indicating the is a SPI transceiver available */

    static bool bAvailable = false;

 

 

    /* pointer to store transceiver */

    ADI_SPI_TRANSCEIVER *pTrans;

 

    /* SPI driver handle */

    ADI_SPI_HANDLE hSPI2Device;

 

    /* SPI driver memory */

    uint8_t driverMemory[ADI_SPI_INT_MEMORY_SIZE];

 

    /* driver API result code */

  ADI_SPI_RESULT result;

 

    /* open the SPI driver */

    result = adi_spi_Open(2, driverMemory, (uint32_t)ADI_SPI_DMA_MEMORY_SIZE, &hSPI2Device);

 

    /* Using the driver API's to configure SPI

     * Setting the SPI2 as Master*/

    result = adi_spi_SetMaster(hSPI2Device, true);

 

    /* Setting the slave select through software*/

    result = adi_spi_SetHwSlaveSelect(hSPI2Device, false);

 

    /* Use SSEL1 as slave select pin*/

   result = adi_spi_SetSlaveSelect(hSPI2Device, ADI_SPI_SSEL_ENABLE1);

 

    /* Setting the data word lenght as 8 bit*/

    result = adi_spi_SetWordSize(hSPI2Device, ADI_SPI_TRANSFER_8BIT);

 

    /* Setting the SCLK frequency to 20MHz */

    result = adi_spi_SetClock(hSPI2Device, 20);

 

Thank you very much in advance.

Looking forward to hear from you soon.

 

Regards

Anand M

Outcomes