FX3 Programmers Manual, Doc. # 001-64707 Rev. *C
91
FX3 Application Structure
❐
The verbosity of the debug. This is set to level 8, so all debug prints which are below this level
(0 to 7) will be printed.
/* Initialize the Debug application */
apiRetStatus = CyU3PDebugInit
(CY_U3P_LPP_SOCKET_UART_CONS, 8);
8.1.2.3
Application initialization
The application initialization consists of the following steps:
■
GPIF-II Initialization
■
USB Initialization
GPIF-II Initialization
The GPIF-II block is first initialized.
/* Initialize the P-port Block */
pibClock.clkDiv = 2;
pibClock.clkSrc = CY_U3P_SYS_CLK;
pibClock.isHalfDiv = CyFalse;
pibClock.isDllEnable = CyFalse;
apiRetStatus = CyU3PPibInit(CyTrue,&pibClock);
The slave FIFO descriptors are loaded into the GPIF-II registers and the state machine is started.
/* Load the GPIF configuration for Slave FIFO sync mode. */
apiRetStatus = CyU3PGpifLoad (&Sync_Slave_Fifo_2Bit_CyFxGpifConfig);
if (apiRetStatus != CY_U3P_SUCCESS)
{
CyU3PDebugPrint (4, "CyU3PGpifLoad failed, Error Code = %d\n",apiR-
etStatus);
CyFxAppErrorHandler(apiRetStatus);
}
/* Start the state machine. */
apiRetStatus = CyU3PGpifSMStart (SYNC_SLAVE_FIFO_2BIT_RESET,
SYNC_SLAVE_FIFO_2BIT_ALPHA_RESET);
if (apiRetStatus != CY_U3P_SUCCESS)
{
CyU3PDebugPrint (4, "CyU3PGpifSMStart failed, Error Code =
%d\n",apiRetStatus);
CyFxAppErrorHandler(apiRetStatus);
}
USB Initialization
■
The USB stack in the FX3 library is first initialized. This is done by invoking the USB Start
function.
/* Start the USB functionality */
apiRetStatus = CyU3PUsbStart();
Содержание EX-USB FX3
Страница 8: ...8 FX3 Programmers Manual Doc 001 64707 Rev C Contents...
Страница 12: ...12 FX3 Programmers Manual Doc 001 64707 Rev C Introduction...
Страница 48: ...48 FX3 Programmers Manual Doc 001 64707 Rev C FX3 Overview...
Страница 74: ...74 FX3 Programmers Manual Doc 001 64707 Rev C FX3 Firmware...
Страница 76: ...76 FX3 Programmers Manual Doc 001 64707 Rev C FX3 APIs...
Страница 84: ...84 FX3 Programmers Manual Doc 001 64707 Rev C FX3 Application Examples...
Страница 98: ...98 FX3 Programmers Manual Doc 001 64707 Rev C FX3 Application Structure...
Страница 148: ...148 FX3 Programmers Manual Doc 001 64707 Rev C FX3 P Port Register Access...
Страница 153: ...FX3 Programmers Manual Doc 001 64707 Rev C 153 FX3 Development Tools 2 Select General Existing projects into Workspace...
Страница 165: ...FX3 Programmers Manual Doc 001 64707 Rev C 165 FX3 Development Tools Click next...
Страница 178: ...178 FX3 Programmers Manual Doc 001 64707 Rev C FX3 Development Tools Click on Apply...
Страница 180: ...180 FX3 Programmers Manual Doc 001 64707 Rev C FX3 Development Tools d Start the GDB server...
Страница 185: ...FX3 Programmers Manual Doc 001 64707 Rev C 185 FX3 Development Tools...
Страница 186: ...186 FX3 Programmers Manual Doc 001 64707 Rev C FX3 Development Tools...
Страница 187: ...FX3 Programmers Manual Doc 001 64707 Rev C 187 FX3 Development Tools...
Страница 188: ...188 FX3 Programmers Manual Doc 001 64707 Rev C FX3 Development Tools...
Страница 192: ...192 FX3 Programmers Manual Doc 001 64707 Rev C GPIF II Designer...