123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770 |
- /******************************************************************************
- * Copyright (C) 2019, Huada Semiconductor Co.,Ltd All rights reserved.
- *
- * This software is owned and published by:
- * Huada Semiconductor Co.,Ltd ("HDSC").
- *
- * BY DOWNLOADING, INSTALLING OR USING THIS SOFTWARE, YOU AGREE TO BE BOUND
- * BY ALL THE TERMS AND CONDITIONS OF THIS AGREEMENT.
- *
- * This software contains source code for use with HDSC
- * components. This software is licensed by HDSC to be adapted only
- * for use in systems utilizing HDSC components. HDSC shall not be
- * responsible for misuse or illegal use of this software for devices not
- * supported herein. HDSC is providing this software "AS IS" and will
- * not be responsible for issues arising from incorrect user implementation
- * of the software.
- *
- * Disclaimer:
- * HDSC MAKES NO WARRANTY, EXPRESS OR IMPLIED, ARISING BY LAW OR OTHERWISE,
- * REGARDING THE SOFTWARE (INCLUDING ANY ACOOMPANYING WRITTEN MATERIALS),
- * ITS PERFORMANCE OR SUITABILITY FOR YOUR INTENDED USE, INCLUDING,
- * WITHOUT LIMITATION, THE IMPLIED WARRANTY OF MERCHANTABILITY, THE IMPLIED
- * WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE OR USE, AND THE IMPLIED
- * WARRANTY OF NONINFRINGEMENT.
- * HDSC SHALL HAVE NO LIABILITY (WHETHER IN CONTRACT, WARRANTY, TORT,
- * NEGLIGENCE OR OTHERWISE) FOR ANY DAMAGES WHATSOEVER (INCLUDING, WITHOUT
- * LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION,
- * LOSS OF BUSINESS INFORMATION, OR OTHER PECUNIARY LOSS) ARISING FROM USE OR
- * INABILITY TO USE THE SOFTWARE, INCLUDING, WITHOUT LIMITATION, ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES OR LOSS OF DATA,
- * SAVINGS OR PROFITS,
- * EVEN IF Disclaimer HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * YOU ASSUME ALL RESPONSIBILITIES FOR SELECTION OF THE SOFTWARE TO ACHIEVE YOUR
- * INTENDED RESULTS, AND FOR THE INSTALLATION OF, USE OF, AND RESULTS OBTAINED
- * FROM, THE SOFTWARE.
- *
- * This software may be replicated in part or whole for the licensed use,
- * with the restriction that this Disclaimer and Copyright notice must be
- * included with each copy of this software, whether used in part or whole,
- * at all times.
- */
- /******************************************************************************/
- /** \file interrupts_hc32l136.c
- **
- ** Interrupt management
- ** @link Driver Group Some description @endlink
- **
- ** - 2018-04-15 1.0 Lux First version.
- **
- **
- ******************************************************************************/
- /*******************************************************************************
- * Include files
- ******************************************************************************/
- #include "hc32l196_ddl.h"
- #include "interrupts_hc32l19x.h"
- /*******************************************************************************
- * IRQ WEAK DEFINE
- ******************************************************************************/
- __WEAK void SysTick_IRQHandler(void);
- __WEAK void PortA_IRQHandler(void)
- {
- }
- __WEAK void PortB_IRQHandler(void)
- {
- }
- __WEAK void PortC_IRQHandler(void)
- {
- }
- __WEAK void PortD_IRQHandler(void)
- {
- }
- __WEAK void PortE_IRQHandler(void)
- {
- }
- __WEAK void PortF_IRQHandler(void)
- {
- }
- __WEAK void Dmac_IRQHandler(void)
- {
- }
- __WEAK void Tim3_IRQHandler(void)
- {
- }
- __WEAK void Uart0_IRQHandler(void)
- {
- }
- __WEAK void Uart1_IRQHandler(void)
- {
- }
- __WEAK void Uart2_IRQHandler(void)
- {
- }
- __WEAK void Uart3_IRQHandler(void)
- {
- }
- __WEAK void LpUart0_IRQHandler(void)
- {
- }
- __WEAK void LpUart1_IRQHandler(void)
- {
- }
- __WEAK void Spi0_IRQHandler(void)
- {
- }
- __WEAK void Spi1_IRQHandler(void)
- {
- }
- __WEAK void I2c0_IRQHandler(void)
- {
- }
- __WEAK void I2c1_IRQHandler(void)
- {
- }
- __WEAK void Tim0_IRQHandler(void)
- {
- }
- __WEAK void Tim1_IRQHandler(void)
- {
- }
- __WEAK void Tim2_IRQHandler(void)
- {
- }
- __WEAK void LpTim0_IRQHandler(void)
- {
- }
- __WEAK void LpTim1_IRQHandler(void)
- {
- }
- __WEAK void Tim4_IRQHandler(void)
- {
- }
- __WEAK void Tim5_IRQHandler(void)
- {
- }
- __WEAK void Tim6_IRQHandler(void)
- {
- }
- __WEAK void Pca_IRQHandler(void)
- {
- }
- __WEAK void Wdt_IRQHandler(void)
- {
- }
- __WEAK void Rtc_IRQHandler(void)
- {
- }
- __WEAK void Adc_IRQHandler(void)
- {
- }
- __WEAK void Dac_IRQHandler(void)
- {
- }
- __WEAK void Pcnt_IRQHandler(void)
- {
- }
- __WEAK void Vc0_IRQHandler(void)
- {
- }
- __WEAK void Vc1_IRQHandler(void)
- {
- }
- __WEAK void Vc2_IRQHandler(void)
- {
- }
- __WEAK void Lvd_IRQHandler(void)
- {
- }
- __WEAK void Lcd_IRQHandler(void)
- {
- }
- __WEAK void Flash_IRQHandler(void)
- {
- }
- __WEAK void Ram_IRQHandler(void)
- {
- }
- __WEAK void ClkTrim_IRQHandler(void)
- {
- }
- /**
- *******************************************************************************
- ** \brief NVIC 中断使能
- **
- ** \param [in] enIrq 中断号枚举类型
- ** \param [in] enLevel 中断优先级枚举类型
- ** \param [in] bEn 中断开关
- ** \retval Ok 设置成功
- ** 其他值 设置失败
- ******************************************************************************/
- void EnableNvic(IRQn_Type enIrq, en_irq_level_t enLevel, boolean_t bEn)
- {
- NVIC_ClearPendingIRQ(enIrq);
- NVIC_SetPriority(enIrq, enLevel);
- if (TRUE == bEn)
- {
- NVIC_EnableIRQ(enIrq);
- }
- else
- {
- NVIC_DisableIRQ(enIrq);
- }
- }
- /**
- *******************************************************************************
- ** \brief NVIC hardware fault 中断实现
- **
- **
- ** \retval
- ******************************************************************************/
- //void HardFault_Handler(void)
- //{
- // volatile int a = 0;
- // while( 0 == a)
- // {
- // ;
- // }
- //
- //}
- /**
- *******************************************************************************
- ** \brief NVIC SysTick 中断实现
- **
- ** \retval
- ******************************************************************************/
- //void SysTick_Handler(void)
- //{
- // SysTick_IRQHandler();
- //}
- /**
- *******************************************************************************
- ** \brief GPIO PortA 中断处理函数
- **
- ** \retval
- ******************************************************************************/
- void PORTA_IRQHandler(void)
- {
- #if (INT_CALLBACK_ON == INT_CALLBACK_PORTA)
- PortA_IRQHandler();
- #endif
- }
- /**
- *******************************************************************************
- ** \brief GPIO PortB 中断处理函数
- **
- ** \retval
- ******************************************************************************/
- void PORTB_IRQHandler(void)
- {
- #if (INT_CALLBACK_ON == INT_CALLBACK_PORTB)
- PortB_IRQHandler();
- #endif
- }
- /**
- *******************************************************************************
- ** \brief GPIO PortC/E 中断处理函数
- **
- ** \retval
- ******************************************************************************/
- void PORTC_E_IRQHandler(void)
- {
- #if (INT_CALLBACK_ON == INT_CALLBACK_PORTC)
- PortC_IRQHandler();
- #endif
-
- #if (INT_CALLBACK_ON == INT_CALLBACK_PORTE)
- PortE_IRQHandler();
- #endif
- }
- /**
- *******************************************************************************
- ** \brief GPIO PortD/F 中断处理函数
- **
- ** \retval
- ******************************************************************************/
- void PORTD_F_IRQHandler(void)
- {
- #if (INT_CALLBACK_ON == INT_CALLBACK_PORTD)
- PortD_IRQHandler();
- #endif
-
- #if (INT_CALLBACK_ON == INT_CALLBACK_PORTF)
- PortF_IRQHandler();
- #endif
- }
- /**
- *******************************************************************************
- ** \brief DMAC 中断处理函数
- **
- ** \retval
- ******************************************************************************/
- void DMAC_IRQHandler(void)
- {
- #if (INT_CALLBACK_ON == INT_CALLBACK_DMAC)
- Dmac_IRQHandler();
- #endif
- }
- /**
- *******************************************************************************
- ** \brief TIM3 中断处理函数
- **
- ** \retval
- ******************************************************************************/
- void TIM3_IRQHandler(void)
- {
- #if (INT_CALLBACK_ON == INT_CALLBACK_TIM3)
- Tim3_IRQHandler();
- #endif
- }
- /**
- *******************************************************************************
- ** \brief UART0/2 中断处理函数
- **
- ** \retval
- ******************************************************************************/
- void UART0_2_IRQHandler(void)
- {
- #if (INT_CALLBACK_ON == INT_CALLBACK_UART0)
- Uart0_IRQHandler();
- #endif
-
- #if (INT_CALLBACK_ON == INT_CALLBACK_UART2)
- Uart2_IRQHandler();
- #endif
- }
- /**
- *******************************************************************************
- ** \brief UART1/3 中断处理函数
- **
- ** \retval
- ******************************************************************************/
- void UART1_3_IRQHandler(void)
- {
- #if (INT_CALLBACK_ON == INT_CALLBACK_UART1)
- Uart1_IRQHandler();
- #endif
-
- #if (INT_CALLBACK_ON == INT_CALLBACK_UART3)
- Uart3_IRQHandler();
- #endif
- }
- /**
- *******************************************************************************
- ** \brief LPUART0 低功耗串口0 中断处理函数
- **
- ** \retval
- ******************************************************************************/
- void LPUART0_IRQHandler(void)
- {
- #if (INT_CALLBACK_ON == INT_CALLBACK_LPUART0)
- LpUart0_IRQHandler();
- #endif
- }
- /**
- *******************************************************************************
- ** \brief LPUART1 低功耗串口1 中断处理函数
- **
- ** \retval
- ******************************************************************************/
- void LPUART1_IRQHandler(void)
- {
- #if (INT_CALLBACK_ON == INT_CALLBACK_LPUART1)
- LpUart1_IRQHandler();
- #endif
- }
- /**
- *******************************************************************************
- ** \brief SPI0 中断处理函数
- **
- ** \retval
- ******************************************************************************/
- void SPI0_IRQHandler(void)
- {
- #if (INT_CALLBACK_ON == INT_CALLBACK_SPI0)
- Spi0_IRQHandler();
- #endif
- }
- /**
- *******************************************************************************
- ** \brief SPI1 中断处理函数
- **
- ** \retval
- ******************************************************************************/
- void SPI1_IRQHandler(void)
- {
- #if (INT_CALLBACK_ON == INT_CALLBACK_SPI1)
- Spi1_IRQHandler();
- #endif
- }
- /**
- *******************************************************************************
- ** \brief I2C0 中断处理函数
- **
- ** \retval
- ******************************************************************************/
- void I2C0_IRQHandler(void)
- {
- #if (INT_CALLBACK_ON == INT_CALLBACK_I2C0)
- I2c0_IRQHandler();
- #endif
- }
- /**
- *******************************************************************************
- ** \brief I2C1 中断处理函数
- **
- ** \retval
- ******************************************************************************/
- void I2C1_IRQHandler(void)
- {
- #if (INT_CALLBACK_ON == INT_CALLBACK_I2C1)
- I2c1_IRQHandler();
- #endif
- }
- /**
- *******************************************************************************
- ** \brief TIM0 中断处理函数
- **
- ** \retval
- ******************************************************************************/
- void TIM0_IRQHandler(void)
- {
- #if (INT_CALLBACK_ON == INT_CALLBACK_TIM0)
- Tim0_IRQHandler();
- #endif
- }
- /**
- *******************************************************************************
- ** \brief TIM1 中断处理函数
- **
- ** \retval
- ******************************************************************************/
- void TIM1_IRQHandler(void)
- {
- #if (INT_CALLBACK_ON == INT_CALLBACK_TIM1)
- Tim1_IRQHandler();
- #endif
- }
- /**
- *******************************************************************************
- ** \brief TIM2 中断处理函数
- **
- ** \retval
- ******************************************************************************/
- void TIM2_IRQHandler(void)
- {
- #if (INT_CALLBACK_ON == INT_CALLBACK_TIM2)
- Tim2_IRQHandler();
- #endif
- }
- /**
- *******************************************************************************
- ** \brief LPTIM0/1 低功耗时钟 中断处理函数
- **
- ** \retval
- ******************************************************************************/
- void LPTIM0_1_IRQHandler(void)
- {
- #if (INT_CALLBACK_ON == INT_CALLBACK_LPTIM0)
- LpTim0_IRQHandler();
- #endif
-
- #if (INT_CALLBACK_ON == INT_CALLBACK_LPTIM1)
- LpTim1_IRQHandler();
- #endif
- }
- /**
- *******************************************************************************
- ** \brief TIM4 中断处理函数
- **
- ** \retval
- ******************************************************************************/
- void TIM4_IRQHandler(void)
- {
- #if (INT_CALLBACK_ON == INT_CALLBACK_TIM4)
- Tim4_IRQHandler();
- #endif
- }
- /**
- *******************************************************************************
- ** \brief TIM5 中断处理函数
- **
- ** \retval
- ******************************************************************************/
- void TIM5_IRQHandler(void)
- {
- #if (INT_CALLBACK_ON == INT_CALLBACK_TIM5)
- Tim5_IRQHandler();
- #endif
- }
- /**
- *******************************************************************************
- ** \brief TIM6 中断处理函数
- **
- ** \retval
- ******************************************************************************/
- void TIM6_IRQHandler(void)
- {
- #if (INT_CALLBACK_ON == INT_CALLBACK_TIM6)
- Tim6_IRQHandler();
- #endif
- }
- /**
- *******************************************************************************
- ** \brief PCA 中断处理函数
- **
- ** \retval
- ******************************************************************************/
- void PCA_IRQHandler(void)
- {
- #if (INT_CALLBACK_ON == INT_CALLBACK_PCA)
- Pca_IRQHandler();
- #endif
- }
- /**
- *******************************************************************************
- ** \brief WDT 中断处理函数
- **
- ** \retval
- ******************************************************************************/
- void WDT_IRQHandler(void)
- {
- #if (INT_CALLBACK_ON == INT_CALLBACK_WDT)
- Wdt_IRQHandler();
- #endif
- }
- /**
- *******************************************************************************
- ** \brief RTC 中断处理函数
- **
- ** \retval
- ******************************************************************************/
- void RTC_IRQHandler(void)
- {
- #if (INT_CALLBACK_ON == INT_CALLBACK_RTC)
- Rtc_IRQHandler();
- #endif
- }
- /**
- *******************************************************************************
- ** \brief ADC/DAC 中断处理函数
- **
- ** \retval
- ******************************************************************************/
- void ADC_DAC_IRQHandler(void)
- {
- #if (INT_CALLBACK_ON == INT_CALLBACK_ADC)
- Adc_IRQHandler();
- #endif
-
- #if (INT_CALLBACK_ON == INT_CALLBACK_DAC)
- Dac_IRQHandler();
- #endif
- }
- /**
- *******************************************************************************
- ** \brief PCNT 中断处理函数
- **
- ** \retval
- ******************************************************************************/
- void PCNT_IRQHandler(void)
- {
- #if (INT_CALLBACK_ON == INT_CALLBACK_PCNT)
- Pcnt_IRQHandler();
- #endif
- }
- /**
- *******************************************************************************
- ** \brief VC0 中断处理函数
- **
- ** \retval
- ******************************************************************************/
- void VC0_IRQHandler(void)
- {
- #if (INT_CALLBACK_ON == INT_CALLBACK_VC0)
- Vc0_IRQHandler();
- #endif
- }
- /**
- *******************************************************************************
- ** \brief VC1/2 中断处理函数
- **
- ** \retval
- ******************************************************************************/
- void VC1_2_IRQHandler(void)
- {
- #if (INT_CALLBACK_ON == INT_CALLBACK_VC1)
- Vc1_IRQHandler();
- #endif
-
- #if (INT_CALLBACK_ON == INT_CALLBACK_VC2)
- Vc2_IRQHandler();
- #endif
- }
- /**
- *******************************************************************************
- ** \brief LVD 中断处理函数
- **
- ** \retval
- ******************************************************************************/
- void LVD_IRQHandler(void)
- {
- #if (INT_CALLBACK_ON == INT_CALLBACK_LVD)
- Lvd_IRQHandler();
- #endif
- }
- /**
- *******************************************************************************
- ** \brief LCD 中断处理函数
- **
- ** \retval
- ******************************************************************************/
- void LCD_IRQHandler(void)
- {
- #if (INT_CALLBACK_ON == INT_CALLBACK_LCD)
- Lcd_IRQHandler();
- #endif
- }
- /**
- *******************************************************************************
- ** \brief FLASH/RAM 中断处理函数
- **
- ** \retval
- ******************************************************************************/
- void FLASH_RAM_IRQHandler(void)
- {
- #if (INT_CALLBACK_ON == INT_CALLBACK_FLASH)
- Flash_IRQHandler();
- #endif
-
- #if (INT_CALLBACK_ON == INT_CALLBACK_RAM)
- Ram_IRQHandler();
- #endif
- }
- /**
- *******************************************************************************
- ** \brief CLKTRIM 中断处理函数
- **
- ** \retval
- ******************************************************************************/
- void CLKTRIM_IRQHandler(void)
- {
- #if (INT_CALLBACK_ON == INT_CALLBACK_CLKTRIM)
- ClkTrim_IRQHandler();
- #endif
- }
- /******************************************************************************/
- /* EOF (not truncated) */
- /******************************************************************************/
|