EasyManuals Logo

Cypress EZ-USB FX3 User Manual

Cypress EZ-USB FX3
660 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #185 background imageLoading...
Page #185 background image
EZ-USB FX3 Technical Reference Manual, Document Number: 001-76074 Rev. *F 185
Low Performance Peripherals (LPP)
Once the expected number of data bytes has been received or transmitted (indicated by UART_TX_BYTE_COUNT or
UART_RX_BYTE_COUNT), an end of transfer is indicated to the DMA adapter by setting the flag RX_DONE or TX_DONE to
1 respectively (of UART_STATUS and UART_INTR) in DMA-based transfers.
8.7.3.2 Error Conditions
Error conditions are indicated in the UART_STATUS register. All errors marked as nonsticky do not require firmware
intervention while the errors marked as sticky require the firmware to reset the UART DMA sockets and reissue the
command.
8.7.4 Examples
This section shows the example codes to receive and transfer data from the FX3 UART block APIs to access the UART block
are provided with the FX3 SDK. Refer to the Cyu3uart.c file located at C:\Program Files (x86)\Cypress\EZ-USB FX3
SDK\1.3\firmware\lpp_source (after FX3 SDK installation) for the source code of UART-related APIs. Refer to
FX3APIGuide.pdf located at C:\Program Files (x86)\Cypress\EZ-USB FX3 SDK\1.3\doc for more details on FX3 APIs.
8.7.4.1 Initialize UART Block
The CyU3PUartInit API initializes the FX3 UART block. The UART block is initialized to operate at the default baud rate of
9600. The CyU3PUARTInit function definition follows.
CyU3PUartInit (void)
{
CyU3PMutexCreate (&glUartLock, CYU3P_NO_INHERIT);
/* Set the clock to a default value.
* This should prcede the UART power up*/
CyU3PUartSetClock (9600);
/* Identify if the LPP block has been initialized. */
CyU3PLppInit (CY_U3P_LPP_UART,CyU3PUartInt_ThreadHandler);
/* Hold the UART block in reset. */
UART->lpp_uart_power &= ~(1 << 31);
CyU3PBusyWait (10);
UART->lpp_uart_power |= (1 << 31);
/* Wait for the active bit to be asserted by the hardware */
while (!(UART->lpp_uart_power & CY_U3P_LPP_UART_ACTIVE));
/* Mark the module as active. */
glIsUartActive = CyTrue;
}
8.7.4.2 Send UART Messages and Receive Fixed Bytes of Text
The following code prints messages on a user interface such as HyperTerminal or TeraTerm and receives a fixed number of
bytes of text from the same user interface.
â–  UART block of FX3 is configured for the following settings: Baud rate: 115200, one stop bit, no parity, no flow control, both
TX and RX paths enabled, and DMA transfers enabled.
â–  uartIntrCb callback function to receive UART events is registered using the CyU3PUartSetConfig API.
â–  Value 0xFFFFFFFFU is passed for the TX path to specify infinite or indefinite data transmission.
â–  Value 4 is passed for the RX path to specify that only 4 bytes of data transfer is allowed. This means FX3 firmware can
process the input UART messages only after 4 characters are entered in TeraTerm. For example, if you enter 3 then the

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Cypress EZ-USB FX3 and is the answer not in the manual?

Cypress EZ-USB FX3 Specifications

General IconGeneral
BrandCypress
ModelEZ-USB FX3
CategoryController
LanguageEnglish

Related product manuals