Input pins hardware interface uC
The port pins of the AVR series microcontrollers do not have an open-drain mode as such, like there is from many other manufacturers (PIC, Freescale, etc).  They only have a DDxn (data direction register, input or output), port in register (PINxn), and port out (PORTxn).

For these other micros, you can set a output pin to be open-drain, and then switch it to zero or high impedance simply by writing a 0 or 1 in the PORT register.

You can simulate this behavior for the AVRs, by doing the following:

To sink current, set the data direction pin DDxn to 1 (output).  Then set the bit in the output PORTxn register to 0.

To change this to a high-impedance open-drain, set the data direction pin DDxn to 0 (input), while leaving the PORTxn bit 0.

So instead of toggling the PORT pin, you are toggling the data directionpin.

Here is a table out of the datasheet for the ATmega328:



Note that in this configuration (DDxn = 0, PORTxn = 0), there is no internal pull-up resistor.  If you want one, then you can set the PORTxn bit to 1 instead of 0, assuming pullups are enabled for the port in the PUD register.