spi_config spiconfig = {CS_PORT CS_PIN,HW_SPI_WORD_8BIT,HW_SPI_MODE_SLAVE,HW_SPI_POL_LOW,HW_SPI_PHA_MODE_0,HW_SPI_MINT_ENABLE,HW_SPI_FREQ_DIV_14,HW_SPI_FIFO_RX_TX,1};
hw_spi_init(HW_SPI1,&spiconfig);
hw_spi_enable_interrupt(HW_SPI1);
hw_spi_enable(HW_SPI1,1);
Is this correct way to set SPI configuration?because after this configuration, sent data not trigger SPI_Interrupt_Handler(HW_SPI1)?
Is there any application example on how to use the SPI in slave mode?
Device:
Hi vengatesan,
This forum category is related to the thread, please use the Bluetooth categories in order to post additional questions regarding BLE.
The 68x isn't usually used as a slave device when operating over SPI (there is an example in the peripherals demo using SPI as a slave over the adapters, but it isn't fully functional), this is the only example in the SDK using the 68x SDK over SPI slave mode (there is no adapters implementation for operating in that mode), so you will have to modify the code in order for the device to operate as an SPI slave. In the implementation that you have described the reason the the SPI interrupt doesn't occur is because you have not enabled the NVIC for that paricular interrupt, as soon as you do so, the interrupt will occur (NVIC_EnableIRQ(SPI_IRQn);). Also instead of actually calling the enabling of the NVIC you can invoke the hw_spi_read_buf() function which will take care of the additional SPI configurations as well.
Thanks MT_dialog