/*****************************************************************************
 *Copyright (c)
 *FileName	  : SC_it.c
 *Function	  : Interrupt Service Routine
 *Date          :29-1-2024
 *Version       : V0.2
 ******************************************************************************
 * @attention
 *
 *1.This software is supplied by SinOne Microelectronics Co.,Ltd. and is only 
 *intended for use with SinOne products. No other uses are authorized. This 
 *software is owned by SinOne Microelectronics Co.,Ltd. and is protected under 
 *all applicable laws, including copyright laws. 
 *2.The software which is for guidance only aims at providing customers with 
 *coding information regarding their products in order for them to save time. 
 *As a result, SinOne shall not be held liable for any direct, indirect or 
 *consequential damages with respect to any claims arising from the content of 
 *such software and/or the use made by customers of the coding information 
 *contained herein in connection with their products.
 *
 *  COPYRIGHT 2024 SinOne Microelectronics
 */
/********************Includes************************************************************************/
#include "SC_it.h"
#include "sc32_conf.h"
#include "stdio.h"
#include "SC_itExtern.h"
#include "Function_Init.h"

/**************************************Generated by EasyCodeCube*************************************/
//Forbid editing areas between the labels !!!

/*************************************.Generated by EasyCodeCube.************************************/

void INT0_IRQHandler(void)
{
  /*INT0_it write here begin*/
  //Forbid editing areas between the labels !!!
  /*INT0_it write here*/
  /*<Generated by EasyCodeCube begin>*/
#if (TestNum == 9)
  INT_Example_INT0Handler();
#elif (TestNum == 28)
  INT_WakeUp_INT0Handler();
#endif
  /*<Generated by EasyCodeCube end>*/
  /*INT0Interrupt Flag Clear begin*/
  //Forbid editing areas between the labels !!!
  /*INT0Interrupt Flag Clear end*/
}

void INT1_7_IRQHandler(void)
{
  /*INT1_7_it write here begin*/
  //Forbid editing areas between the labels !!!
  /*INT1_7_it write here*/
  /*<Generated by EasyCodeCube begin>*/
#if (TestNum == 9)
  INT_Example_INT1_7Handler();
#endif
  /*<Generated by EasyCodeCube end>*/
  /*INT1_7Interrupt Flag Clear begin*/
  //Forbid editing areas between the labels !!!
  /*INT1_7Interrupt Flag Clear end*/
}

void INT8_11_IRQHandler(void)
{
  /*INT8_11_it write here begin*/
  //Forbid editing areas between the labels !!!
  /*INT8_11_it write here*/
  /*<Generated by EasyCodeCube begin>*/
#if (TestNum == 9)
  INT_Example_INT8_11_Handler();
#endif
  /*<Generated by EasyCodeCube end>*/
  /*INT8_11Interrupt Flag Clear begin*/
  //Forbid editing areas between the labels !!!
  /*INT8_11Interrupt Flag Clear end*/
}

void INT12_15_IRQHandler(void)
{
  /*INT12_15_it write here begin*/
  //Forbid editing areas between the labels !!!
  /*INT12_15_it write here*/
  /*<Generated by EasyCodeCube begin>*/
  #if (TestNum == 9)
  INT_Example_INT12_15_Handler();
  #endif
  /*<Generated by EasyCodeCube end>*/
  /*INT12_15Interrupt Flag Clear begin*/
  //Forbid editing areas between the labels !!!
  /*INT12_15Interrupt Flag Clear end*/
}

void RCC_IRQHandler(void)
{
  /*RCC_it write here begin*/
  //Forbid editing areas between the labels !!!
  /*RCC_it write here*/
  /*<Generated by EasyCodeCube begin>*/
  
  /*<Generated by EasyCodeCube end>*/
  /*RCCInterrupt Flag Clear begin*/
  //Forbid editing areas between the labels !!!
  /*RCCInterrupt Flag Clear end*/
}

#if !defined (TK_USE_BTM)
void BTM_IRQHandler(void)
{
  /*BTM_it write here begin*/
  //Forbid editing areas between the labels !!!
  /*BTM_it write here*/
  /*<Generated by EasyCodeCube begin>*/
#if (TestNum == 3)
  BTM_BTMHandler();
#elif (TestNum == 28)
  BTM_WakeUp_BTMHandler();
#endif
  /*<Generated by EasyCodeCube end>*/
  /*BTMInterrupt Flag Clear begin*/
  //Forbid editing areas between the labels !!!
  /*BTMInterrupt Flag Clear end*/
}
#endif

void UART0_2_4_IRQHandler(void)
{
  /*UART0_2_it write here begin*/
  //Forbid editing areas between the labels !!!
  /*UART0_2_it write here*/
  /*<Generated by EasyCodeCube begin>*/
#if (TestNum == 25)
  UART_Communication_UART2Handler();
#elif (TestNum == 36)
#if defined(SC32f12xx) 
    UART_LINMaster_UART2Handler();
#endif
#elif (TestNum == 37)
#if defined(SC32f12xx) 
    UART_LINSlave_UART2Handler();
#endif
#endif

  /*<Generated by EasyCodeCube end>*/
  /*UART0_2Interrupt Flag Clear begin*/
  //Forbid editing areas between the labels !!!
  /*UART0_2Interrupt Flag Clear end*/
}

void UART0_2_IRQHandler(void)
{
  /*UART0_2_it write here begin*/
  //Forbid editing areas between the labels !!!
  /*UART0_2_it write here*/
  /*<Generated by EasyCodeCube begin>*/
#if (TestNum == 25)
  UART_Communication_UART2Handler();
#endif

  /*<Generated by EasyCodeCube end>*/
  /*UART0_2Interrupt Flag Clear begin*/
  //Forbid editing areas between the labels !!!
  /*UART0_2Interrupt Flag Clear end*/
}


void UART1_3_5_IRQHandler(void)
{
  /*UART1_3_it write here begin*/
  //Forbid editing areas between the labels !!!
  /*UART1_3_it write here*/
  /*<Generated by EasyCodeCube begin>*/
  
  /*<Generated by EasyCodeCube end>*/
  /*UART1_3Interrupt Flag Clear begin*/
  //Forbid editing areas between the labels !!!
  /*UART1_3Interrupt Flag Clear end*/
}

void UART1_3_IRQHandler(void)
{
  /*UART1_3_it write here begin*/
  //Forbid editing areas between the labels !!!
  /*UART1_3_it write here*/
  /*<Generated by EasyCodeCube begin>*/
  
  /*<Generated by EasyCodeCube end>*/
  /*UART1_3Interrupt Flag Clear begin*/
  //Forbid editing areas between the labels !!!
  /*UART1_3Interrupt Flag Clear end*/
}
void UART1_IRQHandler(void)
{
  /*UART1_it write here begin*/
  //Forbid editing areas between the labels !!!
  /*UART1_it write here*/
  /*<Generated by EasyCodeCube begin>*/
  /*<Generated by EasyCodeCube end>*/
  /*UART1Interrupt Flag Clear begin*/
  //Forbid editing areas between the labels !!!
  /*UART1Interrupt Flag Clear end*/
}
void SPI0_IRQHandler(void)
{
  /*SPI0_it write here begin*/
  //Forbid editing areas between the labels !!!
  /*SPI0_it write here*/
  /*<Generated by EasyCodeCube begin>*/
#if defined(SC32f12xx) ||defined(SC32f10xx)
#if (TestNum == 13)
  SPI_Communication_SPI0Handler();

#endif
#endif
  /*<Generated by EasyCodeCube end>*/
  /*SPI0Interrupt Flag Clear begin*/
  //Forbid editing areas between the labels !!!
  /*SPI0Interrupt Flag Clear end*/
}

void SPI1_2_IRQHandler(void)
{
  /*SPI1_it write here begin*/
  //Forbid editing areas between the labels !!!
  /*SPI1_it write here*/
  /*<Generated by EasyCodeCube begin>*/
#if defined(SC32f12xx)
#if (TestNum == 13)
  SPI_Communication_SPI1_2_Handler();
#elif (TestNum == 14)
  SPI_FIFOMaster_SPI1Handler();
#elif (TestNum == 15)
  SPI_FIFOSlave_SPI1Handler();
#endif
#endif
  /*<Generated by EasyCodeCube end>*/
  /*SPI1Interrupt Flag Clear begin*/
  //Forbid editing areas between the labels !!!
  /*SPI1Interrupt Flag Clear end*/
}

void SPI1_IRQHandler(void)
{
  /*SPI1_it write here begin*/
  //Forbid editing areas between the labels !!!
  /*SPI1_it write here*/
  /*<Generated by EasyCodeCube begin>*/
#if defined(SC32f10xx)
#if (TestNum == 13)
  SPI_Communication_SPI1_Handler();
#elif (TestNum == 14)
  SPI_FIFOMaster_SPI1Handler();
#elif (TestNum == 15)
  SPI_FIFOSlave_SPI1Handler();
#endif
#endif
  /*<Generated by EasyCodeCube end>*/
  /*SPI1Interrupt Flag Clear begin*/
  //Forbid editing areas between the labels !!!
  /*SPI1Interrupt Flag Clear end*/
}

void SPI1_TWI1_IRQHandler(void)
{
  /*SPI1_TWI1_it write here begin*/
  //Forbid editing areas between the labels !!!
  /*SPI1_TWI1_it write here*/
  /*<Generated by EasyCodeCube begin>*/
  /*<Generated by EasyCodeCube end>*/
  /*SPI1_TWI1Interrupt Flag Clear begin*/
  //Forbid editing areas between the labels !!!
  /*SPI1_TWI1nterrupt Flag Clear end*/
}
void TWIx_QSPIx_0_2_IRQHandler(void)
{
  /*SPI0_it write here begin*/
  //Forbid editing areas between the labels !!!
  /*SPI0_it write here*/
  /*<Generated by EasyCodeCube begin>*/

  /*<Generated by EasyCodeCube end>*/
  /*SPI0Interrupt Flag Clear begin*/
  //Forbid editing areas between the labels !!!
  /*SPI0Interrupt Flag Clear end*/
}

void TWIx_QSPIx_1_3_IRQHandler(void)
{
  /*SPI1_it write here begin*/
  //Forbid editing areas between the labels !!!
  /*SPI1_it write here*/
  /*<Generated by EasyCodeCube begin>*/

  /*<Generated by EasyCodeCube end>*/
  /*SPI1Interrupt Flag Clear begin*/
  //Forbid editing areas between the labels !!!
  /*SPI1Interrupt Flag Clear end*/
}

void DMA0_IRQHandler(void)
{
  /*DMA0_it write here begin*/
  //Forbid editing areas between the labels !!!
  /*DMA0_it write here*/
  /*<Generated by EasyCodeCube begin>*/
#if (TestNum == 29)
	#if defined(SC32f10xx)|| defined(SC32f12xx)
  ADC_CycleConversion_DMAHandler();
	#endif
#elif (TestNum == 16)
  SPI_Communication_DMA_DAM0Handler();
#elif (TestNum == 21)
  TIM_TI_DMA_DMA0Handler();
#elif (TestNum == 23)
  TWI_Master_DMA_DMA0Handler();
#elif (TestNum == 26)
  UART_Communication_DMA_DAM0Handler();

#endif
  /*<Generated by EasyCodeCube end>*/
  /*DMA0Interrupt Flag Clear begin*/
  //Forbid editing areas between the labels !!!
  /*DMA0Interrupt Flag Clear end*/
}

void DMA1_IRQHandler(void)
{
  /*DMA1_it write here begin*/
  //Forbid editing areas between the labels !!!
  /*DMA1_it write here*/
  /*<Generated by EasyCodeCube begin>*/
#if (TestNum == 16)
  SPI_Communication_DMA_DMA1Handler();
#elif (TestNum == 23)
  TWI_Master_DMA_DMA1Handler();
#elif (TestNum == 26)
  UART_Communication_DMA_DAM1Handler();
#endif
  /*<Generated by EasyCodeCube end>*/
  /*DMA1Interrupt Flag Clear begin*/
  //Forbid editing areas between the labels !!!
  /*DMA1Interrupt Flag Clear end*/
}

void DMA2_IRQHandler(void)
{
  /*DMA2_it write here begin*/
  //Forbid editing areas between the labels !!!
  /*DMA2_it write here*/
  /*<Generated by EasyCodeCube begin>*/
  
  /*<Generated by EasyCodeCube end>*/
  /*DMA2Interrupt Flag Clear begin*/
  //Forbid editing areas between the labels !!!
  /*DMA2Interrupt Flag Clear end*/
}

void DMA3_IRQHandler(void)
{
  /*DMA3_it write here begin*/
  //Forbid editing areas between the labels !!!
  /*DMA3_it write here*/
  /*<Generated by EasyCodeCube begin>*/
  
  /*<Generated by EasyCodeCube end>*/
  /*DMA3Interrupt Flag Clear begin*/
  //Forbid editing areas between the labels !!!
  /*DMA3Interrupt Flag Clear end*/
}

void TIMER0_IRQHandler(void)
{
  /*TIM0_it write here begin*/
  //Forbid editing areas between the labels !!!
  /*TIM0_it write here*/
  /*<Generated by EasyCodeCube begin>*/
#if (TestNum == 17)
  TIM_TimeBase_TIM0Handler();
#endif
  /*<Generated by EasyCodeCube end>*/
  /*TIMER0Interrupt Flag Clear begin*/
  //Forbid editing areas between the labels !!!
  /*TIMER0Interrupt Flag Clear end*/
}

void TIMER1_IRQHandler(void)
{
  /*TIM1_it write here begin*/
  //Forbid editing areas between the labels !!!
  /*TIM1_it write here*/
  /*<Generated by EasyCodeCube begin>*/
#if (TestNum == 18)
  TIM_CounterBase_TIM1Handler();
#elif (TestNum == 20)
  TIM_InputCapture_TIM1Handler();
#endif
  /*<Generated by EasyCodeCube end>*/
  /*TIMER1Interrupt Flag Clear begin*/
  //Forbid editing areas between the labels !!!
  /*TIMER1Interrupt Flag Clear end*/
}

void TIMER2_IRQHandler(void)
{
  /*TIM2_it write here begin*/
  //Forbid editing areas between the labels !!!
  /*TIM2_it write here*/
  /*<Generated by EasyCodeCube begin>*/
  
  /*<Generated by EasyCodeCube end>*/
  /*TIMER2Interrupt Flag Clear begin*/
  //Forbid editing areas between the labels !!!
  /*TIMER2Interrupt Flag Clear end*/
}

void TIMER3_IRQHandler(void)
{
  /*TIM3_it write here begin*/
  //Forbid editing areas between the labels !!!
  /*TIM3_it write here*/
  /*<Generated by EasyCodeCube begin>*/
  
  /*<Generated by EasyCodeCube end>*/
  /*TIMER3Interrupt Flag Clear begin*/
  //Forbid editing areas between the labels !!!
  /*TIMER3Interrupt Flag Clear end*/
}

void TIMER4_5_IRQHandler(void)
{
  /*TIM4_5_it write here begin*/
  //Forbid editing areas between the labels !!!
  /*TIM4_5_it write here*/
  /*<Generated by EasyCodeCube begin>*/
  
  /*<Generated by EasyCodeCube end>*/
  /*TIMER4_5Interrupt Flag Clear begin*/
  //Forbid editing areas between the labels !!!
  /*TIMER4_5Interrupt Flag Clear end*/
}

void TIMER6_7_IRQHandler(void)
{
  /*TIM6_7_it write here begin*/
  //Forbid editing areas between the labels !!!
  /*TIM6_7_it write here*/
  /*<Generated by EasyCodeCube begin>*/
  
  /*<Generated by EasyCodeCube end>*/
  /*TIMER6_7Interrupt Flag Clear begin*/
  //Forbid editing areas between the labels !!!
  /*TIMER6_7Interrupt Flag Clear end*/
}

void PWM0_IRQHandler(void)
{
  /*PWM0_it write here begin*/
  //Forbid editing areas between the labels !!!
  /*PWM0_it write here*/
  /*<Generated by EasyCodeCube begin>*/
#if defined(SC32f10xx)||defined(SC32f12xx)
#if TestNum == 33
   PWM_Independent_PWMHandler();
#elif TestNum == 34
  PWM_Complementary_PWMHandler();
#endif
#endif
  /*<Generated by EasyCodeCube end>*/
  /*PWM0Interrupt Flag Clear begin*/
  //Forbid editing areas between the labels !!!
  /*PWM0Interrupt Flag Clear end*/
}

void LEDPWM_IRQHandler(void)
{
  /*LEDPWM_it write here begin*/
  //Forbid editing areas between the labels !!!
  /*LEDPWM_it write here*/
  /*<Generated by EasyCodeCube begin>*/
#if (TestNum == 35)
	#if defined(SC32f10xx)||defined(SC32f12xx)
  LEDPWM_Example_LEDPWMHandler();
	#endif
#endif
  /*<Generated by EasyCodeCube end>*/
  /*LEDPWMInterrupt Flag Clear begin*/
  //Forbid editing areas between the labels !!!
  /*LEDPWMInterrupt Flag Clear end*/
}

void TWI0_IRQHandler(void)
{
  /*TWI0_it write here begin*/
  //Forbid editing areas between the labels !!!
  /*TWI0_it write here*/
  /*<Generated by EasyCodeCube begin>*/
#if defined(SC32f10xx)||defined(SC32f12xx)
#if (TestNum == 22)
  TWI_Communication_TWI0Handler();
#elif (TestNum == 23)
  TWI_Master_DMA_TWI0Handler();
#elif (TestNum == 24)
  TWI_Slave_DMA_TWI0Handler();
#endif
#endif
  /*<Generated by EasyCodeCube end>*/
  /*TWI0Interrupt Flag Clear begin*/
  //Forbid editing areas between the labels !!!
  /*TWI0Interrupt Flag Clear end*/
}

void TWI1_IRQHandler(void)
{
  /*TWI1_it write here begin*/
  //Forbid editing areas between the labels !!!
  /*TWI1_it write here*/
  /*<Generated by EasyCodeCube begin>*/
#if defined(SC32f10xx)||defined(SC32f12xx)
#if (TestNum == 22)
  TWI_Communication_TWI1Handler();
#elif (TestNum == 23)
  TWI_Master_DMA_TWI1Handler();
#elif (TestNum == 24)
  TWI_Slave_DMA_TWI1Handler();
#endif
#endif
  /*<Generated by EasyCodeCube end>*/
  /*TWI1Interrupt Flag Clear begin*/
  //Forbid editing areas between the labels !!!
  /*TWI1Interrupt Flag Clear end*/
}

void ADC_IRQHandler(void)
{
  /*ADC_it write here begin*/
  //Forbid editing areas between the labels !!!
  /*ADC_it write here*/
  /*<Generated by EasyCodeCube begin>*/
#if (TestNum == 2)
  ADC_SingleConversion_ADCHandler();

#endif
#if defined(SC32f12xx)
#if (TestNum == 38)
  OP_AmplifiesVoltage_ADCHandler();
#endif
#endif
  /*<Generated by EasyCodeCube end>*/
  /*ADCInterrupt Flag Clear begin*/
  //Forbid editing areas between the labels !!!
  /*ADCInterrupt Flag Clear end*/
}

void CAN_IRQHandler(void)
{
  /*CAN_it write here begin*/
  //Forbid editing areas between the labels !!!
  /*CAN_it write here*/
  /*<Generated by EasyCodeCube begin>*/
  /*<Generated by EasyCodeCube end>*/
  /*CANInterrupt Flag Clear begin*/
  //Forbid editing areas between the labels !!!
  /*CANInterrupt Flag Clear end*/
}
void CMP_IRQHandler(void)
{
  /*CMP_it write here begin*/
  //Forbid editing areas between the labels !!!
  /*CMP_it write here*/
  /*<Generated by EasyCodeCube begin>*/
#if defined(SC32f10xx)||defined(SC32f12xx)
#if TestNum == 4
  CMP_Interrupt_CMPHandler();
#elif  TestNum == 30
  CMP_AnalogWatchdog_CMPHandler();
#endif
#endif
  /*<Generated by EasyCodeCube end>*/
  /*CMPInterrupt Flag Clear begin*/
  //Forbid editing areas between the labels !!!
  /*CMPInterrupt Flag Clear end*/
}

void CMP0_1_2_IRQHandler(void)
{
  /*CMP0_1_2_it write here begin*/
  //Forbid editing areas between the labels !!!
  /*CMP0_1_2_it write here*/
  /*<Generated by EasyCodeCube begin>*/
  /*<Generated by EasyCodeCube end>*/
  /*CMP0_1_2Interrupt Flag Clear begin*/
  //Forbid editing areas between the labels !!!
  /*CMP0_1_2Interrupt Flag Clear end*/
}

void CMP3_IRQHandler(void)
{
  /*CMP3_it write here begin*/
  //Forbid editing areas between the labels !!!
  /*CMP3_it write here*/
  /*<Generated by EasyCodeCube begin>*/
  /*<Generated by EasyCodeCube end>*/
  /*CMP3Interrupt Flag Clear begin*/
  //Forbid editing areas between the labels !!!
  /*CMP3Interrupt Flag Clear end*/
}
void OP1_OP2_IRQHandler(void)
{
  /*OP1_OP2_it write here begin*/
  //Forbid editing areas between the labels !!!
  /*OP1_OP2_it write here*/
  /*<Generated by EasyCodeCube begin>*/
  /*<Generated by EasyCodeCube end>*/
  /*OP1_OP2Interrupt Flag Clear begin*/
  //Forbid editing areas between the labels !!!
  /*OP1_OP2Interrupt Flag Clear end*/
}
void QEP0_IRQHandler(void)
{
  /*QEP0_it write here begin*/
  //Forbid editing areas between the labels !!!
  /*QEP0_it write here*/
  /*<Generated by EasyCodeCube begin>*/
  /*<Generated by EasyCodeCube end>*/
  /*QEP0Interrupt Flag Clear begin*/
  //Forbid editing areas between the labels !!!
  /*QEP0Interrupt Flag Clear end*/
}

void QEP1_IRQHandler(void)
{
  /*QEP1_it write here begin*/
  //Forbid editing areas between the labels !!!
  /*QEP1_it write here*/
  /*<Generated by EasyCodeCube begin>*/

  /*<Generated by EasyCodeCube end>*/
  /*QEP1Interrupt Flag Clear begin*/
  //Forbid editing areas between the labels !!!
  /*QEP1Interrupt Flag Clear end*/
}
void SysTick_IRQHandler(void)
{
  /*SysTick_it write here begin*/
  //Forbid editing areas between the labels !!!
  /*SysTick_it write here*/
  /*<Generated by EasyCodeCube begin>*/
#if (TestNum == 12)
  SYSTICK_SystemClockConfig_SYSTICKHandler();
#elif (TestNum == 27)
  SYSTICK_Example_SYSTICKHandler();
#endif
  /*<Generated by EasyCodeCube end>*/
  /*SysTickInterrupt Flag Clear begin*/
  //Forbid editing areas between the labels !!!
  /*SysTickInterrupt Flag Clear end*/
}

void NMI_Handler(void)
{
  /*NMI_it write here begin*/
  //Forbid editing areas between the labels !!!
  /*NMI_it write here*/
  /*<Generated by EasyCodeCube begin>*/

  /*<Generated by EasyCodeCube end>*/
  /*NMIInterrupt Flag Clear begin*/
  //Forbid editing areas between the labels !!!
  /*NMIInterrupt Flag Clear end*/
}
