I have very little knowledge on it. So can you please kindly explain me with details.
For example: they have API command (using SPI) to move motor by passing two parameters which are direction and distance(steps)
So why they still want to connect with the GPIO pins of MCU for direction.
I see little chances for project success if you don't become familiar with the hardware and software provided for the L6474.
As previously mentioned, you can move the stepper by writing to the EL_POS register. But each step involves a SPI register write action. The API commands perform complex movements with speed ramps, as required by a step motor drive. They obviously use the digital step and direction inputs and respective STM32 timer code together with the SPI interface to issue individual steps during the ramp.