How to implement programmable Schmitt trigger?
This is a real proper way of doing it for the pedants amongst us (and that usually includes me).

Use two comparators (one for the high level threshold and one for the low level threshold). Use two DACs (or digipots) to set the thresholds for each comparator. Feed the input signal into both comparators.

The two comparator outputs can be used to set a flip flop and reset a flip flop respectively.