Cypress EZ-USB® FX3™ SDK Quick Start Guide, Version 1.3.1 41
b. Configuring the UART interface parameters as required using the
CyU3PUartSetConfig API. In this case, the UART is setup to transmit
data from the consumer DMA channel with the interface set to 115200
8-N-1.
c. Calling CyU3PUartTxSetBlockXfer to setup an infinite transfer size,
so that the UART can keep transmitting debug data as long as
required.
d. Calling CyU3PDebugInit to enable the debug logger and to direct all
log output to the UART consumer socket. The CyU3PDebugInit API
creates a MANUAL_OUT DMA channel with the socket specified as
the consumer. This channel is managed by the debug driver in the
SDK, and no user intervention is required.
e. Calling CyU3PDebugPreamble to disable the output of a message
header along with each output log. The message header is designed
for automated parsing of the log output and is left turned ON by
default. However, leaving this ON can make the log messages harder
to read on a debug console.
8. The next step in the CyFxAppThread_Entry() function is to initialize the PIB
(GPIF) and USB blocks on the FX3 device.
a. The CyU3PPibInit API is called to initialize the PIB (Processor
Interface Block) on the FX3 device. The PIB is a hardware block that
implements the GPIF-II controller as well as a Pseudo MMC Slave
(PMMC) implementation. The PIB can be configured in either of these
modes, with the GPIF-II mode being the default. In this application,
the clock for the GPIF-II interface is provided by FX3, and this clock
frequency is set to the maximum possible value (1/4 of the System
Clock, which is about 101.8 MHz).
b. The CyU3PUsbStart API is called to initialize the USB block in device
(peripheral) mode. This API internally creates a pair of DMA channels
which are used to do the control endpoint data transfers.
c. Callback functions for the notification of general USB events, USB
control requests and LPM related events are registered next through
the CyU3PUsbRegisterEventCallback,
CyU3PUsbRegisterSetupCallback and
CyU3PUsbRegisterLPMRequestCallback APIs. The fast enumeration
mode is selected so that most of the USB control requests are
handled by the USB driver in the SDK.
d. The CyU3PUsbSetDesc API is used repeatedly to register all relevant
USB descriptors with the USB driver. At a minimum, the USB 2.0 and
3.0 device descriptors; the USB-FS, HS and SS configuration
descriptors; and the BOS descriptor should be registered using this
API call.