8 years, 1 month ago.

I want an InterruptInOut

It's fairly common for devices to use an I2C-style tri-state data line to indicate completion of a measurement. For example, the SHT-75 humidity sensor does this. You send it an I2C-style measurement request, and then some time later it pulls the data line low.

Is there any way to do this cleanly with mBed using interrupts to detect the low data line? There isn't an `InterruptInOut` class - which would be ideal - and it isn't clear to me what the constructors/destructors of `InterruptIn` and `DigitalInOut` actually do.

Am I going to have to write my own `InterruptInOut` class?

1 Answer

8 years, 1 month ago.

Possibly, it is fairly straight forward if you check the source code. However you can first try making an InterruptIn + DigitalInOut on the same pin. I expect that to work, but not 100% sure.

Yeah it's the "not 100% sure" bit that I want to find out. Guess I'll have to read the code!

posted by Tim H 06 Mar 2016

Or try it out ;).

posted by Erik - 06 Mar 2016