Skip to main content
alsaleem
Associate
June 17, 2016
Question

HAL_I2C_MasterTxCpltCallback for second i2c

  • June 17, 2016
  • 1 reply
  • 1230 views
Posted on June 18, 2016 at 00:00

I am using both I2Cs in my board. Also, using DMA for non-blocking.

HAL_I2C_Master_Transmit_DMA generates interrupt for completion (also for reception and error.

HAL only allows for one ''weak'' callback for both.

Is there away to name my callback functions (complete/error ...) for each I2C in order to separate logic for each I2C? 

Thanks.

#stm32f4xx-i2c-hal_callbacks
This topic has been closed for replies.

1 reply

Amel NASRI
Technical Moderator
June 28, 2016
Posted on June 28, 2016 at 15:24

Hi alsaleem.ahmad,

You may add a check on I2C instance in the CallBack function then implement what you need depending on the instance.

-Mayla-

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.