Hi!
I have been struggling a lot to understand the SPI protocol.
It is used in an embedded project and the previous developers have no documentation on the code, so I have to struggle to find out what is happening.
In a c file named spi_protocol.c, we have the code for the SPI functionality.
The problem arose when I got over the name "srts" and I have no clue to what it can be related.
The code looks something like this:
My question is what could srts mean:
status register
slave request to send
or something about reading the data?
Thank you so much for your time!
I have been struggling a lot to understand the SPI protocol.
It is used in an embedded project and the previous developers have no documentation on the code, so I have to struggle to find out what is happening.
In a c file named spi_protocol.c, we have the code for the SPI functionality.
The problem arose when I got over the name "srts" and I have no clue to what it can be related.
The code looks something like this:
C:
extern xSemaphoreHandle SPI_SRTS_DOWN;
extern xSemaphoreHandle SPI_SRTS_TOGGLE;
static inline uint8_t spi_srts_down(uint32_t delayTime) {
uint16_t srts_status = RZA_IO_RegRead_16(&g_usbx_function_pipecfg[pipe], USB_PIPECFG_BFRE_SHIFT, USB_PIPECFG_BFRE);
if(1 == srts_status){
if(pdFALSE == xSemaphoreTake(SPI_SRTS_DOWN, delayTime)) {
return pdFALSE;
} else {
return xSemaphoreTake(SPI_SRTS_TOGGLE, delayTime);
}
} else {
xSemaphoreTake(SPI_SRTS_DOWN, 0);
xSemaphoreTake(SPI_SRTS_TOGGLE, 0);
return pdTRUE;
}
}
status register
slave request to send
or something about reading the data?
Thank you so much for your time!