for
(;;)
{
if
(
LEDupdateFlag
)
{
/* Clear the flag */
LEDupdateFlag
=
false
;
/* Invert the LED state*/
Cy_GPIO_Inv
(
Pin_GreenLED_0_PORT
,
Pin_GreenLED_0_NUM
);
}
}
}
/********************************************************************
* Function Name: UartInit
*********************************************************************/
void
UartInit
(
void
)
{
/* Configure the UART peripheral.
UART_config structure is defined by the UART_PDL component based on
parameters entered in the Component configuration*/
Cy_SCB_UART_Init
(
UART_HW
,
&
UART_config
,
&
UART_context
);
/* Enable the UART peripheral */
Cy_SCB_UART_Enable
(
UART_HW
);
}
/********************************************************************
* Function Name: TimerInit
*********************************************************************/
void
TimerInit
(
void
)
{
/* Configure the TCPWM peripheral.
Counter_config structure is defined based on the parameters entered
in the Component configuration */
Cy_TCPWM_Counter_Init
(
Timer_HW
,
Timer_CNT_NUM
,
&
Timer_config
);
/* Enable the initialized counter */
Cy_TCPWM_Counter_Enable
(
Timer_HW
,
Timer_CNT_NUM
);
/* Start the enabled counter */
Cy_TCPWM_TriggerStart
(
Timer_HW
,
Timer_CNT_MASK
);
/* Configure the ISR for the TCPWM peripheral*/
Cy_SysInt_Init
(
&
Isr_Timer_cfg
,
Isr_Timer
);
/* Enable interrupt in NVIC */
NVIC_EnableIRQ
((
IRQn_Type
)
Isr_Timer_cfg
.
intrSrc
);
}
/********************************************************************
* Function Name: Isr_Timer
*********************************************************************/
Getting started with PSoC
™
6 MCU on PSoC
™
Creator
4 My first PSoC
™
6 MCU design using PSoC
™
Creator
Application Note
32
002-21774 Rev. *G
2022-07-21