Does an open drain require specialised circuitry?

I'm trying to get my head around I2C and how a pin can "pull a line low".

Externally, there is a bus wire (two, in fact), connected to VCC via a pull-up resistor. So the bus line defaults to a high state.

If I understand correctly, a pin can detect whether the wire is high or low by setting its mode to INPUT and performing a digitalRead(). Is that correct?

Now this is the part I'm really confused on: suppose a pin wants to "pull a line low", so that anything else that tries to read the wire will detect a low state. In order to "pull a line low", is it sufficient to set pinMode to OUTPUT and call digitalWrite to LOW? And how is the wire reset to high again? Is special circuitry required inside the chip, or can the effect be achieved with any pin?

You would make sure the pin has not been written high (ex, by digitalWrite(pin,HIGH) or pinMode(pin,INPUT_PULLUP) ), and just do pinMode(pin,OUTPUT) to drive it low, pinMode(pin,INPUT) to release it.

Note that in the case of I2C, there is specialized hardware on most Arduino-compatible chips that handles most of the work of I2C - the arduino wrapper for this is the Wire library.

Now this is the part I'm really confused on: suppose a pin wants to "pull a line low", so that anything else that tries to read the wire will detect a low state. In order to "pull a line low", is it sufficient to set pinMode to OUTPUT and call digitalWrite to LOW?

Yes.

And how is the wire reset to high again?

By making that pin an input again. Then the external resistor pulls it high.

can the effect be achieved with any pin?

Yes.

Is special circuitry required inside the chip

Special circuity is included on the hardware I2C pins that stops you needing to change a pin between input and output and so can work faster than doing it "by hand".

So when you set a pin to mode OUTPUT, the chip shorts the pin to earth?

aardweeno:
So when you set a pin to mode OUTPUT, the chip shorts the pin to earth?

Yes if it is an OUTPUT that is set LOW. If set HIGH then it "shorts" it to the power rail.

Saying it "shorts" to Gnd or Vcc is a little inaccurate - it tries to drive the pin towards those rails, but IIRC the output impedance is ~50 ohm, and you can blow the pin if you pull more than 40mA from it (recommended max is 20mA, 40 is absolute max). That's hardly a short.

Saying it "shorts" to Gnd or Vcc is a little inaccurate

That is why I put it in inverted comers, I was using the OP's own language. I think it is more important that he understands this in terms of shorts, than he fails to understand it cloaked in the subtleties that in this case do not matter a jot.