I need to read two rotary quadrature encoders at the time I didnt know that the PSOC4 could work with the TCPWM Quadrature decoder but I really enjoyed this circuit It is a really good example of the digital logic power included on PSOC.
the great thing about this is that all the circuit logic is made via hardware that means there is no work required by the processor until it reaches the causes the interrupt. this way I won't waste processing power on this reading.
here is a little simulation of how this works notice that on each case only one of the lights turns that would turn on the interrupt sequence for that pin.