/*******************************************************************************
* Copyright (C) 2016, 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 ACCOMPANYING 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 main.c
**
** \brief The example for EXTI, NMI and SWI function demonstration
**
** - 2018-10-17 1.0 Zhangxl First version for sample of exint_nmi_swi module.
**
******************************************************************************/
/*******************************************************************************
* Include files
******************************************************************************/
#include "hc32_ddl.h"
/*******************************************************************************
* Local type definitions ('typedef')
******************************************************************************/
/*******************************************************************************
* Local pre-processor symbols/macros ('#define')
******************************************************************************/
/* KEY0 */
#define SW2_PORT (PortD)
#define SW2_PIN (Pin03)
/* KEY1 */
#define SW4_PORT (PortD)
#define SW4_PIN (Pin04)
/* KEY2 */
#define SW3_PORT (PortD)
#define SW3_PIN (Pin05)
/* KEY3 */
#define SW5_PORT (PortD)
#define SW5_PIN (Pin06)
/* LED0 Port/Pin definition */
#define LED0_PORT (PortE)
#define LED0_PIN (Pin06)
/* LED1 Port/Pin definition */
#define LED1_PORT (PortA)
#define LED1_PIN (Pin07)
/* LED2 Port/Pin definition */
#define LED2_PORT (PortB)
#define LED2_PIN (Pin05)
/* LED3 Port/Pin definition */
#define LED3_PORT (PortB)
#define LED3_PIN (Pin09)
/* LED0~3 toggle definition */
#define LED0_TOGGLE() (PORT_Toggle(LED0_PORT, LED0_PIN))
#define LED1_TOGGLE() (PORT_Toggle(LED1_PORT, LED1_PIN))
#define LED2_TOGGLE() (PORT_Toggle(LED2_PORT, LED2_PIN))
#define LED3_TOGGLE() (PORT_Toggle(LED3_PORT, LED3_PIN))
/* uncomment this line if wants to print information to Terminal I/O window */
//#define __PRINT_TO_TERMINAL
/*******************************************************************************
* Global variable definitions (declared in header file with 'extern')
******************************************************************************/
/*******************************************************************************
* Local function prototypes ('static')
******************************************************************************/
/*******************************************************************************
* Local variable definitions ('static')
******************************************************************************/
static uint32_t u32NmiCount = 0ul;
static uint32_t u32ExtInt00Count = 0ul;
static uint32_t u32ExtInt01Count = 0ul;
static uint32_t u32ExtInt02Count = 0ul;
static uint32_t u32ExtInt03Count = 0ul;
static uint32_t u32ExtInt04Count = 0ul;
static uint32_t u32ExtInt05Count = 0ul;
static uint32_t u32ExtInt06Count = 0ul;
static uint32_t u32ExtInt07Count = 0ul;
static uint32_t u32ExtInt08Count = 0ul;
static uint32_t u32ExtInt09Count = 0ul;
static uint32_t u32ExtInt10Count = 0ul;
static uint32_t u32ExtInt11Count = 0ul;
static uint32_t u32ExtInt12Count = 0ul;
static uint32_t u32ExtInt13Count = 0ul;
static uint32_t u32ExtInt14Count = 0ul;
static uint32_t u32ExtInt15Count = 0ul;
static uint32_t u32SWI00Count = 0ul;
static uint32_t u32SWI01Count = 0ul;
static uint32_t u32SWI02Count = 0ul;
static uint32_t u32SWI03Count = 0ul;
static uint32_t u32SWI04Count = 0ul;
static uint32_t u32SWI05Count = 0ul;
static uint32_t u32SWI06Count = 0ul;
static uint32_t u32SWI07Count = 0ul;
static uint32_t u32SWI08Count = 0ul;
static uint32_t u32SWI09Count = 0ul;
static uint32_t u32SWI10Count = 0ul;
static uint32_t u32SWI11Count = 0ul;
static uint32_t u32SWI12Count = 0ul;
static uint32_t u32SWI13Count = 0ul;
static uint32_t u32SWI14Count = 0ul;
static uint32_t u32SWI15Count = 0ul;
static uint32_t u32SWI16Count = 0ul;
static uint32_t u32SWI17Count = 0ul;
static uint32_t u32SWI18Count = 0ul;
static uint32_t u32SWI19Count = 0ul;
static uint32_t u32SWI20Count = 0ul;
static uint32_t u32SWI21Count = 0ul;
static uint32_t u32SWI22Count = 0ul;
static uint32_t u32SWI23Count = 0ul;
static uint32_t u32SWI24Count = 0ul;
static uint32_t u32SWI25Count = 0ul;
static uint32_t u32SWI26Count = 0ul;
static uint32_t u32SWI27Count = 0ul;
static uint32_t u32SWI28Count = 0ul;
static uint32_t u32SWI29Count = 0ul;
static uint32_t u32SWI30Count = 0ul;
static uint32_t u32SWI31Count = 0ul;
/*******************************************************************************
* Function implementation - global ('extern') and local ('static')
******************************************************************************/
/**
*******************************************************************************
** \brief ExtInt00 callback function
**
** \param None
**
** \retval None
**
******************************************************************************/
void ExtInt00_Callback(void)
{
if (Set == EXINT_IrqFlgGet(ExtiCh00))
{
u32ExtInt00Count++;
/* clear int request flag */
EXINT_IrqFlgClr(ExtiCh00);
}
}
/**
*******************************************************************************
** \brief ExtInt01 callback function
**
** \param None
**
** \retval None
**
******************************************************************************/
void ExtInt01_Callback(void)
{
if (Set == EXINT_IrqFlgGet(ExtiCh01))
{
u32ExtInt01Count++;
/*
没有合适的资源?快使用搜索试试~ 我知道了~
华大单片机HC32F4例程
共2000个文件
h:178个
c:173个
xml:169个
需积分: 0 5 下载量 112 浏览量
2024-01-19
09:25:42
上传
评论
收藏 9.27MB ZIP 举报
温馨提示
华大单片机HC32F4例程
资源推荐
资源详情
资源评论
收起资源包目录
华大单片机HC32F4例程 (2000个子文件)
HC32F460xE.board 338B
HC32F460xC.board 338B
HC32F460xE.board 338B
HC32F460xC.board 338B
HC32F460xE.board 338B
HC32F460xC.board 338B
HC32F460xE.board 338B
HC32F460xC.board 338B
HC32F460xE.board 338B
HC32F460xC.board 338B
HC32F460xE.board 338B
HC32F460xC.board 338B
HC32F460xE.board 338B
HC32F460xC.board 338B
HC32F460xE.board 338B
HC32F460xC.board 338B
HC32F460xE.board 338B
HC32F460xC.board 338B
HC32F460xE.board 338B
HC32F460xC.board 338B
HC32F460xE.board 338B
HC32F460xC.board 338B
HC32F460xE.board 338B
HC32F460xC.board 338B
HC32F460xE.board 338B
HC32F460xC.board 338B
HC32F460xE.board 338B
HC32F460xC.board 338B
HC32F460xE.board 338B
HC32F460xC.board 338B
HC32F460xE.board 338B
HC32F460xC.board 338B
HC32F460xE.board 338B
HC32F460xC.board 338B
HC32F460xE.board 338B
HC32F460xC.board 338B
HC32F460xE.board 338B
HC32F460xC.board 338B
HC32F460xE.board 338B
HC32F460xC.board 338B
HC32F460xE.board 338B
HC32F460xC.board 338B
HC32F460xE.board 338B
HC32F460xC.board 338B
HC32F460xE.board 338B
HC32F460xC.board 338B
HC32F460xE.board 338B
HC32F460xC.board 338B
HC32F460xE.board 338B
HC32F460xC.board 338B
HC32F460xE.board 338B
HC32F460xC.board 338B
HC32F460xE.board 338B
HC32F460xC.board 338B
HC32F460xE.board 338B
HC32F460xC.board 338B
HC32F460xE.board 338B
HC32F460xC.board 338B
HC32F460xE.board 338B
HC32F460xC.board 338B
HC32F460xE.board 338B
HC32F460xC.board 338B
HC32F460xE.board 338B
HC32F460xC.board 338B
HC32F460xE.board 338B
HC32F460xC.board 338B
HC32F460xE.board 338B
HC32F460xC.board 338B
HC32F460xE.board 338B
HC32F460xC.board 338B
HC32F460xE.board 338B
HC32F460xC.board 338B
HC32F460xE.board 338B
HC32F460xC.board 338B
HC32F460xE.board 338B
HC32F460xC.board 338B
HC32F460xE.board 338B
HC32F460xC.board 338B
HC32F460xE.board 338B
HC32F460xC.board 338B
HC32F460xE.board 338B
HC32F460xC.board 338B
HC32F460xE.board 338B
HC32F460xC.board 338B
HC32F460xE.board 338B
HC32F460xC.board 338B
HC32F460xE.board 338B
HC32F460xC.board 338B
HC32F460xE.board 338B
HC32F460xC.board 338B
HC32F460xE.board 338B
HC32F460xC.board 338B
HC32F460xE.board 338B
HC32F460xC.board 338B
HC32F460xE.board 338B
HC32F460xC.board 338B
HC32F460xE.board 338B
HC32F460xC.board 338B
HC32F460xE.board 338B
HC32F460xC.board 338B
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
资源评论
m0_37887692
- 粉丝: 7
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功