User Manual Part 2
CY8CKIT-042-BLE Bluetooth® Low Energy (BLE) Pioneer Kit Guide, Doc. # 001-93731 Rev. *A 119
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-BLE 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 function is blocking and waits until
there is an entry into the TX FIFO. */
UART_UartPutChar(ch);
}
}
}
7. Build the project by clicking Build > Build {Project Name} or [Shift][F6]. After the project is built
without errors and warnings, program (by choosing
Debug > Program) the project to PSoC 4
BLE/PRoC BLE through the PSoC 5LP USB programmer or MiniProg3.
Note: UART RX and UART TX can be routed to any digital pin on PSoC 4 BLE/PRoC BLE based
on the configuration of the UART component. An SCB implementation of UART will route the RX
and TX pins to one of the following subsets: (P0[0], P0[1] or P0[4], P0[5] or P1[4], P1[5] or P3[0],
P3[1] or P3[4], P3[5] or P5[0], P5[1]).
