Tri-state output to three analogue levels?
A simple potential divider will work, and is commonly used for this.

Vhigh, Vlow, Vdd/2 levels for 1,0,Z respectively.

Remember the 0/1 to Z transition will be relatively slow because it is not actively driven (just the RC time constant); or in other words, the Z state has a low drive capability (5k\$\Omega\$ source resistance).







simulate this circuit &ndash; Schematic created using CircuitLab