Have you followed the description given in FX3APIGuide. Please let me know if you don't understand any of the below mentioned description.
This function is used to start GPIF state machine execution from a desired state.
This function allows the caller to switch to a desired state and continue GPIF state machine execution from there.
The toState parameter specifies the state to initiate operation from.
The fromState parameter can be used to ensure that the transition to toState happens only when the state machine
is in a well defined idle state. If a valid state id (0 - 255) is passed as the fromState, the transition is only allowed
from that state index. If not, the state machine is immediately switched to the toState. In you case you may need to give 256 if you want to switch irrespective of the current state.
The endState can be used to obtain a notification when the state machine execution has reached the designated
end state. Again, this functionality is only valid if a valid endState value is passed in.
The switchTimeout specifies the amount of time to wait for the transition to the desired toState. This is only
meaningful if a fromState is specified, and the timeout value is specified in terms of GPIF hardware clock cycles.