Hello Zhou Yigang,
If you had installed the CY3684 DVK, you will find the FX2LPSerial.c and FX2LPSerial.h files in the following directory:
The CY3684 DVK can be installed from the below link:
These files FX2LPSerial.c and FX2LPSerial.h can be used to debug the firmware. Any information can be printed on a virtual terminal on the host. Please refer to the app note AN58009 (http://www.cypress.com/file/44386/download ) for more details on implementation of this serial port debugging.
There is no API on the host side that can be used to know the availability of data in the FX2LP buffers. The host needs to query the device for data and will be successful when there is data available.
Hope this helps.