tuanti1997qn
tuanti1997qn

Reputation: 77

interrupt flag vs interrupt pending bit stm32

I'm using the std library. I don't know what the difference between I2C_FLAG_TXE and I2C_IT_TXE is.

Why when in interrupt function we don't use I2C_ClearFlag instead I2C_ClearITPendingBit? When do we used I2C_ClearFlag?

I'm starting learn stm32f4. I have very little experience.

Upvotes: 0

Views: 1751

Answers (1)

0___________
0___________

Reputation: 67820

I'm using the std library. I don't know what the difference between I2C_FLAG_TXE and I2C_IT_TXE is.

From the processor point of view - the interrupt flag which has to be cleared by interrupt routine is set when the processor enters the interrupt.

Interrupt pending flag - indicates that the event which triggers the interrupt occurred but for some reason the interrupt routine has not been invoked yet.

It is good to know your hardware before using any libraries.

Upvotes: 1

Related Questions