SPI Interrupt in Slave Mode

⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at//www.xmece.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
3 posts / 0 new
Last post
jbuttelmann
Offline
Last seen:1 year 11 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:7 hours 35 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:11 months 4 weeks ago
Joined:2019-07-31 13:57
亲爱的jbuttelmann,你有

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