/**
* \file interrupt.c
*
* \brief Contains DSP interrupt related APIs.
*/
/*
* Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the
* distribution.
*
* Neither the name of Texas Instruments Incorporated nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <c6x.h>
/* Debug and HW Macros */
#include "debug.h"
#include "hw_types.h"
/* DSP System Defines */
#include "hw_dspintc.h"
#include "soc_C6748.h"
/* DSP INTC APIs */
#include "interrupt.h"
/******************************************************************************
** INTERNAL DEFINES
******************************************************************************/
#define C674X_NMI 1
#define C674X_GEE 2
#define C674X_XEN 3
#define C674X_INT_COUNT 16
#define NUM_SYS_EVENTS 128
/******************************************************************************
** EXTERNALLY DEFINED FUNCTIONS
******************************************************************************/
#ifdef __TI_EABI__
extern void _intcVectorTable (void);
#else
extern void intcVectorTable (void);
#endif
/******************************************************************************
** STATIC VARIABLES/FUNCTIONS
******************************************************************************/
static c674xISR c674xISRtbl[C674X_INT_COUNT];
static c674xISR c674xECMtbl[NUM_SYS_EVENTS];
static void IntDefaultHandler (void);
static void IntEventCombineIsr0 (void);
static void IntEventCombineIsr1 (void);
static void IntEventCombineIsr2 (void);
static void IntEventCombineIsr3 (void);
static void IntEventCombinerDispatch (unsigned int evtReg);
/******************************************************************************
** API INTERRUPT FUNCTIONS
******************************************************************************/
/**
* \function IntDSPINTCInit
*
* \brief This API is used to setup the DSP Interrupt Controller (INTC)
* and should be called before using the DSP INTC. All CPU
* maskable interrupts will be disabled after calling this API and
* the user should proceed to setup the required interrupts for
* processing.
*
* \param None
*
* \return None
*/
void IntDSPINTCInit (void)
{
unsigned int step = 0;
/* Set ISRs to default "do-nothing" routine */
while(step != C674X_INT_COUNT)
c674xISRtbl[step++] = IntDefaultHandler;
/* Set interrupt service table pointer to the vector table */
#ifdef __TI_EABI__
ISTP = (unsigned int)_intcVectorTable;
#else
ISTP = (unsigned int)intcVectorTable;
#endif
/* Clear pending CPU maskable interrupts (if any) */
ICR = 0xFFF0;
/* Enable NMIE bit to allow CPU maskable interrupts */
IER = (1 << C674X_NMI);
}
/**
* \function IntRegister
*
* \brief Registers an interrupt service routine in the interrupt
* vector table for CPU maskable interrupts, NMI, or
* reserved interrupts.
*
* \param cpuINT - CPU maskable interrupt number (4-15), NMI (1),
* or reserved interrupt (2-3)
* \param userISR - Function pointer to the ISR
*
* \return None
*/
void IntRegister (unsigned int cpuINT, void (*userISR)(void))
{
/* Check the CPU maskable interrupt number */
ASSERT(((cpuINT >= 1) && (cpuINT <= 15)));
/* Assign the user's ISR to the CPU maskable interrupt */
c674xISRtbl[cpuINT] = userISR;
}
/**
* \function IntUnRegister
*
* \brief Unregisters an interrupt.
*
* \param cpuINT - CPU maskable interrupt number (4-15), NMI (1),
* or reserved interrupt (2-3)
*
* \return None
*/
void IntUnRegister (unsigned int cpuINT)
{
/* Check the CPU maskable interrupt number */
ASSERT(((cpuINT >= 1) && (cpuINT <= 15)));
/* Assign the default "do-nothing" routine to the CPU maskable interrupt */
c674xISRtbl[cpuINT] = IntDefaultHandler;
}
/**
* \function IntEventMap
*
* \brief This API maps a system event to a CPU maskable interrupt.
*
* \param cpuINT - CPU maskable interrupt number
* \param sysINT - System event number
*
* \return None
*/
void IntEventMap (unsigned int cpuINT, unsigned int sysINT)
{
unsigned int dspintcREG, restoreVal;
/* Check the CPU maskable interrupt number */
ASSERT(((cpuINT >= 4) && (cpuINT <= 15)));
/* Check the system event number */
ASSERT((sysINT <= 127));
/* Get the address of the correct interrupt mux register */
dspintcREG = SOC_INTC_0_REGS + DSPINTC_INTMUX((cpuINT >> 2));
/* Disable interrupts */
restoreVal = IntGlobalDisable();
/* Clear and set INTSELx with system event number */
HWREG(dspintcREG) = (HWREG(dspintcREG) &
~DSPINTC_INTMUX_INTSEL(cpuINT)) |
(sysINT << DSPINTC_INTMUX_INTSEL_SHIFT(cpuINT));
/* Clear any residual interrupt */
ICR = (1 << cpuINT);
/* Restore interrupts */
IntGlobalRestore(restoreVal);
}
/**
* \function IntEventSet
*
* \brief This API manually sets a system event in the event flag
* register.
*
* \param sysINT - System event number
*
* \return None
*/
void IntEventSet (unsigned int sysINT)
{
unsigned int dspintcREG;
/* Check the system event number */
ASSERT((sysINT <= 127));
/* Get the address of the correct event register */
dspintcREG = SOC_INTC_0_REGS + DSPINTC_EVTSET((sysINT >> 5));
/* Set the corresponding bit within the event flag register */
HWREG(dspintcREG) = DSPINTC_EVTSET_ES(sysINT);
}
/**
* \function IntEventClear
*
* \brief This API clears the system interrupt status in the DSP
* interrupt controller.
*
* \param sysINT - System event number
*
* \return None
*/
void IntEventClear(unsigned int sysINT)
{
unsigned int dspintcREG;
/* Check the system event number */
ASSERT((sysINT <= 127));
/* Get the address of the correct event register */
dspintcREG = SOC_INTC_0_REGS + DSPINTC_EVTCLR((sysINT >> 5));
/* Clear the corresponding bit within the event clear register */
HWREG(dspintcREG) = DSPINTC_EVTCLR_EC(sysINT);
}
/**
* \function IntEventCombineInit
*
* \brief This API removes all system events from the ECM, assigns
* the event ISRs to a
没有合适的资源?快使用搜索试试~ 我知道了~
TMS320C6748_Interrupt.rar_TMS320C6748
共175个文件
prefs:17个
xml:15个
mk:12个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 123 浏览量
2022-09-23
00:23:00
上传
评论
收藏 845KB RAR 举报
温馨提示
浮点型DSP TMS320C6748 外部中断例子
资源推荐
资源详情
资源评论
收起资源包目录
TMS320C6748_Interrupt.rar_TMS320C6748 (175个子文件)
008086f582d0001b1ac69a7b962c0186 3KB
008e1a3934d0001b11dcde2da2b9bee0 2KB
00f188f582d0001b1ac69a7b962c0186 265B
00f8323934d0001b11dcde2da2b9bee0 265B
103372e8499a001b1f8be78d8dea4fa3 3KB
105f41e8499a001b1f8be78d8dea4fa3 7KB
10c01ce8499a001b1f8be78d8dea4fa3 20KB
201c29e8499a001b1f8be78d8dea4fa3 19KB
20997af582d0001b1ac69a7b962c0186 289B
20f743e8499a001b1f8be78d8dea4fa3 12KB
301070e8499a001b1f8be78d8dea4fa3 3KB
304f78f582d0001b1ac69a7b962c0186 364B
3050aaab489a001b1f8be78d8dea4fa3 60KB
305a3ae8499a001b1f8be78d8dea4fa3 9KB
30bb15e8499a001b1f8be78d8dea4fa3 8KB
30db63e8499a001b1f8be78d8dea4fa3 103KB
30e64c128cd0001b1ac69a7b962c0186 2KB
30f021e8499a001b1f8be78d8dea4fa3 39KB
409473f582d0001b1ac69a7b962c0186 505B
40ae0b1ab6d0001b1ccced68702c2899 265B
40d0293934d0001b11dcde2da2b9bee0 289B
40d156128cd0001b1ac69a7b962c0186 843B
419473f582d0001b1ac69a7b962c0186 889B
504075e8499a001b1f8be78d8dea4fa3 16KB
504e49e8499a001b1f8be78d8dea4fa3 9KB
5082041ab6d0001b1ccced68702c2899 3KB
508754128cd0001b1ac69a7b962c0186 475B
508a3fe8499a001b1f8be78d8dea4fa3 37KB
50c10e14a099001b1c3c8b2ff7a9779c 67B
60121be8499a001b1f8be78d8dea4fa3 59KB
60146ee8499a001b1f8be78d8dea4fa3 117KB
603c253934d0001b11dcde2da2b9bee0 889B
6071313934d0001b11dcde2da2b9bee0 3KB
60ad67f582d0001b1ac69a7b962c0186 2KB
700cfb19b6d0001b1ccced68702c2899 874B
703f6d128cd0001b1ac69a7b962c0186 265B
706e27e8499a001b1f8be78d8dea4fa3 44KB
707e4ee8499a001b1f8be78d8dea4fa3 39KB
708538e8499a001b1f8be78d8dea4fa3 11KB
709bf819b6d0001b1ccced68702c2899 527B
70a333e8499a001b1f8be78d8dea4fa3 24KB
808e3de8499a001b1f8be78d8dea4fa3 47KB
80a263128cd0001b1ac69a7b962c0186 527B
906236e8499a001b1f8be78d8dea4fa3 20KB
906920e8499a001b1f8be78d8dea4fa3 53KB
909058e8499a001b1f8be78d8dea4fa3 54KB
909e2ce8499a001b1f8be78d8dea4fa3 102KB
90b4ec19b6d0001b1ccced68702c2899 843B
a00ea4ab489a001b1f8be78d8dea4fa3 546KB
a03d19e8499a001b1f8be78d8dea4fa3 51KB
a049283934d0001b11dcde2da2b9bee0 364B
a0824ce8499a001b1f8be78d8dea4fa3 4KB
a0f9e719b6d0001b1ccced68702c2899 475B
intvecs.asm 2KB
b06a6b128cd0001b1ac69a7b962c0186 3KB
b06d56e8499a001b1f8be78d8dea4fa3 31KB
b08866128cd0001b1ac69a7b962c0186 874B
b0b973e8499a001b1f8be78d8dea4fa3 54KB
interrupt.c 20KB
gpio.c 19KB
hello.c 2KB
specs.c 1B
c012dc19b6d0001b1ccced68702c2899 2KB
c02354e8499a001b1f8be78d8dea4fa3 22KB
c0b5233934d0001b11dcde2da2b9bee0 505B
c0c025e8499a001b1f8be78d8dea4fa3 17KB
c0f531e8499a001b1f8be78d8dea4fa3 37KB
.ccsproject 497B
Interrupt.ccxml 1KB
.cdtbuild 9KB
.cdtbuild_initial 9KB
.cdtproject 677B
gpio.cmd 2KB
RK6748_DSP.cmd 2KB
specs.cpp 1B
.cproject 18KB
d0941ee8499a001b1f8be78d8dea4fa3 21KB
d0c92ae8499a001b1f8be78d8dea4fa3 33KB
7053be_null.dat 0B
5edf72_null.dat 0B
1dae27f_null.dat 0B
c9dee3_null.dat 0B
4e57ba_null.dat 0B
277bd2_null.dat 0B
13f347_null.dat 0B
6bf80b_null.dat 0B
e0073ce8499a001b1f8be78d8dea4fa3 11KB
e0a660e8499a001b1f8be78d8dea4fa3 26KB
f02752e8499a001b1f8be78d8dea4fa3 74KB
f08f17e8499a001b1f8be78d8dea4fa3 51KB
f0c423e8499a001b1f8be78d8dea4fa3 29KB
f0f92fe8499a001b1f8be78d8dea4fa3 22KB
history.index 357B
properties.index 181B
properties.index 169B
history.index 160B
version.ini 30B
Interrupt.launch 4KB
Texas%20Instruments%20XDS100v2%20USB%20Emulator_0%2fC674X_0.launch 3KB
.location 66B
共 175 条
- 1
- 2
资源评论
JaniceLu
- 粉丝: 78
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- python tkinter-08-盒子模型.ev4.rar
- Doozy UI Manager 2023
- 基于matlab实现夜间车牌识别程序(1).rar
- 基于matlab实现无线传感器网络无需测距定位算法matlab源代码 包括apit,dv-hop,amorphous在内的共7个
- 基于python的yolov5实现的旋转目标检测
- 基于matlab实现无线传感器网络 CAB定位仿真程序 这是无线传感器节点定位CAB算法的仿真程序,由matlab完成.rar
- 基于matlab实现图像处理,本程序使用背景差分法对来往车辆进行检测和跟踪.rar
- 基于matlab实现视频监控中车型识别代码,自己写的,希望和大家多多交流.rar
- springcodespringcodespringcodespringcode
- 基于matlab实现权值的MAXDEV无线传感器网络定位算法研究 MAXDEV 无线传感器 定位 算法.rar
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功