cancel
Showing results for 
Search instead for 
Did you mean: 

STM32G4 Interrupt Enables I2C

tomm5771
Associate III

Is it necessary to enable interrupts in I2C_CR1 if I only want to look at the flags but don't want to go into the interrupt service routine? For instance, I want to be able to look at the status of RXNE and see if it is set, but I don't actually want go into an interrupt routine. Can I just leave RXIE (the bit that enables the interrupt) as 0?

I am keeping RXIE as 0 for now, and I am still seeing RXNE get set when Rx data comes in. Is this normal?

1 REPLY 1
TDK
Guru

> Is it necessary to enable interrupts in I2C_CR1 if I only want to look at the flags but don't want to go into the interrupt service routine?

No.

> For instance, I want to be able to look at the status of RXNE and see if it is set, but I don't actually want go into an interrupt routine. Can I just leave RXIE (the bit that enables the interrupt) as 0?

Yes.

> I am keeping RXIE as 0 for now, and I am still seeing RXNE get set when Rx data comes in. Is this normal?

Yes.

 

 

Nothing wrong with keeping interrupts disabled and looking at flags instead.

If you feel a post has answered your question, please click "Accept as Solution".