Detect PWM Duty Cycle in Hardware
I'm assuming you only want to use the PWM to determine CW/CCW direction. If you also want to control motor speed then there's no simple solution.
You could filter a DC voltage from the PWM signal using a low-pass filter. Use a comparator to compare with 45% of \$V_{PWM}\$ (indicates 45% duty cycle). If it's lower run CW. Use a second comparator to compare with 55% of \$V_{PWM}\$. If it's higher run CCW. The dead zone between 45% and 55% ensures that it doesn't switch continuously between CW and CCW around 50% duty cycle. The dead zone means you don't need the Schmitt-trigger, which is normally used for this protection.