Page 1 of 1

Is it possible to read I2C data in ISR?

Posted: Tue Nov 28, 2017 8:32 am
by ahue32
In my project I'm using the Adafruit 2,8" cap touch display. It has an interrupt pin which triggers, when the touch screen is touched. Now I tried to use it with an Arduino Nano and had the problem that with the Arduino it is not possible to get I2C data from inside a ISR.

My question now is, is this possible with the ESP32? Can I access the I2C port while in an interrupt from another source? If yes, what would be necessary for that?

Thank you for your help!

Re: Is it possible to read I2C data in ISR?

Posted: Sun Mar 11, 2018 12:35 am
by kolban
I'm going to hazard a guess that the philosophy of an ISR (Interrupt Service Routine) is to do as little work as possible and get out as fast as possible. Would it be possible to have your ISR solely "recognize" that something has triggered an interrupt and then post a semaphore or queue entry and then return from the ISR?