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 */
/* SPI driver handle */
/* SPI driver memory */
/* driver API result code */
/* 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.