how to use function of CyU3PGpifSMSwitch() ?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

now I will use the INTR_CPU of the GPIF , so i must use CyU3PGpifSMSwitch() to begin state when one buffer is trainsferred ,but I do not know how to use it ?

0 Likes
1 Reply
Anonymous
Not applicable

Hi,

   

Have you followed the description given in FX3APIGuide. Please let me know if you don't understand any of the below mentioned description.

   

CyU3PReturnStatus_t CyU3PGpifSMSwitch(
uint16_t fromState,
uint16_t toState,
uint16_t endState,
uint8_t initialAlpha,
uint32_t switchTimeout
);

   

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.

0 Likes