Is it possible to read from a pin that is configured as OUTPUT_OPEN_DRAIN?
The documentation would seem to suggest this is not possible. For digitalRead it says:
uint32 digitalRead(uint8 pin)
Read a digital value from a pin.
The pin must have its mode set to one of INPUT, INPUT_PULLUP, and INPUT_PULLDOWN.
The reason I ask is that I am trying to communicate with a serial EEPROM (Microchip 24AA512) using the Wire library and I seem to be able to write and read from the device. I always get an error code of SUCCESS when writing and when I ask to read back 6 bytes it returns a count of 6 bytes, but the data I read back always consists of set bits (so all bytes come back as 0xFF). These should have been re-programmed when writing the device.
If I look at Wire.cpp it looks as though the two pins (SDA and SCL) are configured as open drain outputs when begin is called and then the pin mode is never changed. Doesn't this mean you can never read the state of the SDA line? Would this explain why I always get 0xFF?
BTW. I have pullups on the SDA and SCL lines and the write protect pin is always low when writing to the device. I have tried various resistor values (2K7, 1K, 8K2) and I always get the same result.