Drive motor can be driven clockwise or anticlockwise
The encoder can sense the forward and reverse counter counts
So it is a combination of four cases.
The following figure shows the microcontroller output commands to the drive interfaces:
The following figure shows the drive, after receiving the instruction microcontroller, converted to stepper motor drive signal interface:
That is, the motor connected to these lines: