The simple way to connect a phototransistor to an MCU is shown in this question. But it requires a Schmitt trigger input which I won't have on my target platform, i.e. either an STM8 at 5V or an STM32F0 at 3V.
I fear that a direct connection without a Schmitt trigger stage might bias the input somewhere between high and low, causing undesired effects such as increased current consumption, additional losses and eventually damage. I need to keep BOM cost low, so I would like to avoid a Schmitt trigger IC (e.g. a single-gate 74x14) ans use a discrete circuit instead.
Are there any simple transistor circuits that can be used for this application?