Code listing 2
/* Header files includes*/
#include
"project.h"
/********************************************************************
* Macros
*********************************************************************/
#define LED_ON (0)
#define LED_OFF (!LED_ON)
/********************************************************************
* Function Prototypes
*********************************************************************/
void
UartInit
(
void
);
void
TimerInit
(
void
);
void
Isr_Timer
(
void
);
/********************************************************************
* Global Variables
*********************************************************************/
bool LEDupdateFlag
=
false
;
/********************************************************************
* Function Name: main
*********************************************************************/
int
main
(
void
)
{
/* Start the UART peripheral */
UartInit
();
/* Enable global interrupts. */
__enable_irq
();
/* \x1b[2J\x1b[;H - ANSI ESC sequence for clear screen */
Cy_SCB_UART_PutString
(
UART_HW
,
"\x1b[2J\x1b[;H"
);
Cy_SCB_UART_PutString
(
UART_HW
,
"
******************
CE221773
-
PSoC
6
MCU
:
"\
"
Hello World
!
Example
******************
\r\n\n"
);
Cy_SCB_UART_PutString
(
UART_HW
,
"Hello World!!!\r\n\n"
);
Cy_SCB_UART_PutString
(
UART_HW
,
"Press Enter key to start blinking the
LED\r\n\n"
);
/* Wait for the user to Press Enter key */
while
(
Cy_SCB_UART_Get
(
UART_HW
)
!=
'\r'
);
/* Start the TCPWM peripheral. TCPWM is configured as a Timer */
TimerInit
();
Cy_SCB_UART_PutString
(
UART_HW
,
"Observe the LED blinking on the kit!!!\r\n"
);
Getting started with PSoC
™
6 MCU on PSoC
™
Creator
4 My first PSoC
™
6 MCU design using PSoC
™
Creator
Application Note
31
002-21774 Rev. *G
2022-07-21