FX3 Programmers Manual, Doc. # 001-64707 Rev. *C 63
FX3 Firmware
Figure 5-3. GPIF II Flow
Figure 5-3 illustrates the flow of the GPIF II interface:
■ The GPIF II Interface Design tool allows to synthesize the configuration by specifying the state
machine.
■ The configuration information for the GPIF II state machine is output as a C Header file by the
tool.
■ The header file is used along with the FX3 applications and API libraries to build the FX3
firmware.
On the FX3 device, the GPIF II must be configured before activating the state machine.
1. Load the state machine configuration into GPIF memory
2. Configure the GPIF registers
3. Configure additional GPIF parameters such as comparators and pin directions
4. Imitate the GPIF state machine
Each of these actions must be achieved by calling the appropriate GPIF API from the user
application. The GPIF II driver provides calls for the user to setup and utilize the GPIF II engine.
Because the GPIF II states can hold multiple waveforms, there is also a provision to switch to
different states. These state switches are initiated through specific calls.
The GPIF II can be configured as a master or as a slave. When the GPIF II is configured as a
master, GPIF II transactions are initiated using the GPIF II driver calls. The driver supports a method
of executing master mode command sequences - initiate a command, wait for completion, and
repeat the sequence, if required. When a transaction is complete, an event can be signaled.
A set of GPIF II events are specified. The user application needs to implement an interrupt handler
function that is called from the ISR provided by the firmware library. Notification of GPIF II related
events are only provided through this handler.
The programmed GPIF II interface is mapped to sockets. All data transfers (such as in USB) are
performed by the DMA engine.
5.2.2.1 GPIF II APIs
The GPIF II APIs allow the programmer to set up and use the GPIF II engine. These include APIs to
■ Initialize the GPIF state machine and load the waveforms
■ Configure the GPIF registers
GPIF Interface
Designer
FX3 Firmware
Application
FX3 Development
Environment
FX3 Firmware APIs
and Drivers
User Input
State Machine
CHeader
FX3
Firmware