AnsweredAssumed Answered

Filter SPI Rx DMA complete event in HAL_SPI_TxRxCpltCallback()

Question asked by diverger on Sep 13, 2017

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.

Outcomes