cancel
Showing results for 
Search instead for 
Did you mean: 

Filter SPI Rx DMA complete event in HAL_SPI_TxRxCpltCallback()

diverger
Associate III
Posted on September 13, 2017 at 16:05

I'm using SPI with DMA for both Tx and Rx. So I call the relevant HAL API : 'HAL_SPI_TransmitReceive_DMA()'.  And I only want to response to the Rx complete event. I find two possible places to filter the event:

  1. In 'DMAx_StreamX_IRQHandler()', but I need filter other events, such error, half complete, etc
  2. In 'HAL_SPI_TxRxCpltCallback()', but this function only receive a SPI handle. I don't get a way to  know if it's a Rx complete event.

 I think method 2 is more suitable, if I can know whether it's a Rx complete event or not. Any good suggestion?

Thanks.

#spi #dma
0 REPLIES 0