Best way to handle SPI TX when using DMA RX in SPI slave in STM32F767
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2023-02-22 4:36 PM
I have studied how to use SPI DMA.
The examples from STM32 project shows independent TX/RX.
I need to handle the 16-bit data as a register. When the slave receives 16-bit data, it should echo it right away for example.
Now I can receive DMA RX transmission complete interrupt.
This is RX handler:
void DMA2_ReceiveComplete_Callback()
{
spi1_tx = spi1_rx;
LL_SPI_TransmitData16(SPI1, spi1_tx);
LL_DMA_SetDataLength(DMA2, LL_DMA_STREAM_0, 1);
LL_DMA_EnableStream(DMA2, LL_DMA_STREAM_0);
}
This way works well. To send the data whenever it receives 16-bit data, it echo in its next turn. Is this good way to send data? Is there any better or faster way?
These are SPI1 configuration:
Labels:
- Labels:
-
DMA
-
SPI
-
STM32F7 Series
This discussion is locked. Please start a new topic to ask your question.
0 REPLIES 0
