SPI Interrupt in Slave Mode

Learn MoreFAQsTutorials

3 posts / 0 new
Last post
jbuttelmann
Offline
Last seen:1 year 9 months ago
Joined:2019-01-16 19:11
SPI Interrupt in Slave Mode

Hi,

I'm setting up the DA14585 to operate in SPI Slave mode. Here is my code to initialize SPI:

/ / SPI
SPI_Pad_t realSSTag;
realSSTag.port = GPIO_PORT_2;
realSSTag.pin = GPIO_PIN_5;
RESERVE_GPIO(realSS, GPIO_PORT_2, GPIO_PIN_5, PID_GPIO);
RESERVE_GPIO(realSCLK, GPIO_PORT_2, GPIO_PIN_7, PID_GPIO);
RESERVE_GPIO(realMOSI, GPIO_PORT_2, GPIO_PIN_9, PID_GPIO);
GPIO_ConfigurePin(GPIO_PORT_2, GPIO_PIN_5, INPUT_PULLUP, PID_SPI_EN, true);
GPIO_ConfigurePin(GPIO_PORT_2, GPIO_PIN_7, INPUT_PULLDOWN, PID_SPI_CLK, false);
GPIO_ConfigurePin(GPIO_PORT_2, GPIO_PIN_9, INPUT_PULLDOWN, PID_SPI_DI, false);
spi_init(&realSSTag, SPI_MODE_8BIT, SPI_ROLE_SLAVE, SPI_CLK_IDLE_POL_LOW, SPI_PHA_MODE_0, SPI_MINT_ENABLE, SPI_XTAL_DIV_8);
NVIC_ClearPendingIRQ(SPI_IRQn);
NVIC_EnableIRQ(SPI_IRQn);

What is the proper way to register a callback function for an SPI interrupt? Some earlier posts refer to functions that start with spi_hci, but it looks like those functions are gone in SDK6.

Device:
PM_Dialog
Offline
Last seen:3 hours 50 min ago
Staff
Joined:2018-02-08 11:03
嗨jbuttelmann,

嗨jbuttelmann,

There is not any API available to register callback function for an SPI interrupt. There is something available but it is based on SDK5 an DA14580/1/3 products. Please check the prox_reporter_ext_spi example of the SDK. In this example you will find that upon the reception of the SPI interrupt the SPI_Handler will be triggered, and you could register a function into this handler. We have never tested from the DA145856’s side and also we don’t have any example for SPI slave implementation.

Thanks, PM_Dialog

Lyadnov
Offline
Last seen:10 months 8 hours ago
Joined:2019-07-31 13:57
亲爱的jbuttelmann,你有

亲爱的jbuttelmann,你有decision for this problem?