Controls motor speed and rotating direction with TA7291p and 2 PWMs from Pi-Zero.  

Both Vs and Vref are 4.8/6 V. Actual voltage for loads(like motor) is about 2.5V lower.

This sketch controls Motor speed with 2 HW PWMs.

TA7291p-IN1 takes PWM0(BCM18) and IN2 takes PWM1(BCM19) .

Direction1: IN1=0 (.stop())/IN2=PWM(.ChangeDutyCycle())

Direction2: IN1=PWM(.ChangeDutyCycle())/IN2=0 (.stop())

 

See sample code.