FX3 Programmers Manual, Doc. # 001-64707 Rev. *C
89
FX3 Application Structure
8.1.1.4
Application Definition
The function CyFxApplicationDefine() is called by the FX3 library after the OS is invoked. In this
function application specific threads are created.
In the Slave FIFO example, only one thread is created in the application define function. This is
shown below:
/* Allocate the memory for the thread */
ptr = CyU3PMemAlloc (CY_FX_SLFIFO_THREAD_STACK);
/* Create the thread for the application */
retThrdCreate = CyU3PThreadCreate (&slFifoAppThread,
/* Slave FIFO app thread structure */
"21:Slave_FIFO_sync",
/* Thread ID and thread name */
SlFifoAppThread_Entry,
/* Slave FIFO app thread entry function */
0,
/* No input parameter to thread */
ptr,
/* Pointer to the allocated thread stack */
CY_FX_SLFIFO_THREAD_STACK,
/* App Thread stack size */
CY_FX_SLFIFO_THREAD_PRIORITY,
/* App Thread priority */
CY_FX_SLFIFO_THREAD_PRIORITY,
/* App Thread pre-emption threshold */
CYU3P_NO_TIME_SLICE,
/* No time slice for the application thread */
CYU3P_AUTO_START
/* Start the thread immediately */
);
Note that more threads (as required by the user application) can be created in the application define
function. All other FX3 specific programming must be done only in the user threads.
8.1.2
Application Code
In the Slave FIFO example, 2 Manual DMA channels are set up:
■
A U to P DMA channel connects the USB Producer (OUT) endpoint to the Consumer P-port
socket.
■
A P to U DMA channel connects the Producer P-port socket to the USB Consumer (IN) Endpoint.
8.1.2.1
Application Thread
The Application entry point for the Slave FIFO example is the SlFifoAppThread_Entry () function.
void
SlFifoAppThread_Entry (
uint32_t input)
{
/* Initialize the debug module */
CyFxSlFifoApplnDebugInit();
Summary of Contents for EX-USB FX3
Page 8: ...8 FX3 Programmers Manual Doc 001 64707 Rev C Contents...
Page 12: ...12 FX3 Programmers Manual Doc 001 64707 Rev C Introduction...
Page 48: ...48 FX3 Programmers Manual Doc 001 64707 Rev C FX3 Overview...
Page 74: ...74 FX3 Programmers Manual Doc 001 64707 Rev C FX3 Firmware...
Page 76: ...76 FX3 Programmers Manual Doc 001 64707 Rev C FX3 APIs...
Page 84: ...84 FX3 Programmers Manual Doc 001 64707 Rev C FX3 Application Examples...
Page 98: ...98 FX3 Programmers Manual Doc 001 64707 Rev C FX3 Application Structure...
Page 148: ...148 FX3 Programmers Manual Doc 001 64707 Rev C FX3 P Port Register Access...
Page 165: ...FX3 Programmers Manual Doc 001 64707 Rev C 165 FX3 Development Tools Click next...
Page 178: ...178 FX3 Programmers Manual Doc 001 64707 Rev C FX3 Development Tools Click on Apply...
Page 180: ...180 FX3 Programmers Manual Doc 001 64707 Rev C FX3 Development Tools d Start the GDB server...
Page 185: ...FX3 Programmers Manual Doc 001 64707 Rev C 185 FX3 Development Tools...
Page 186: ...186 FX3 Programmers Manual Doc 001 64707 Rev C FX3 Development Tools...
Page 187: ...FX3 Programmers Manual Doc 001 64707 Rev C 187 FX3 Development Tools...
Page 188: ...188 FX3 Programmers Manual Doc 001 64707 Rev C FX3 Development Tools...
Page 192: ...192 FX3 Programmers Manual Doc 001 64707 Rev C GPIF II Designer...