Specifications
CY8CKIT-042 PSoC 4 Pioneer Kit Guide, Doc. # 001-86371 Rev. *D 67
Advanced Topics
6. Place the following code in your main.c project file. The code will echo any UART data received.
int main()
{
uint8 ch;
/* Start SCB UART TX+RX operation */
UART_Start();
/* Transmit String through UART TX Line */
UART_UartPutString("CY8CKIT-042 USB-UART");
for(;;)
{
/* Get received character or zero if nothing has been received yet
*/
ch = UART_UartGetChar();
if(0u != ch)
{
/* Send the data through UART. This functions is blocking and waits until
there is an entry into the TX FIFO. */
UART_UartPutChar(ch);
}
}
}