在中断服务子程序中,调用DMA,完成数据从外部爽口防静电地垫RAM到DSP片内的传输。 中断的实现主要是在中断初始化子程序里,其详细操作如下:
Intr_get_cpu_intr(isn)
Intr_hook(void(*fp)(void),cpu_intr)
Intr_init()
Intr_isn(cpu_intr)
Intr_map(cpu_intr,isn)
Intr_reset()
The value *fp is a function pointer to the user supplied ISR,cpu_intr refer to the CPU interrupt number, and isn refer to the interrupt selection number that specifies the interrupt s
ource to a given CPU interrupt.
磁性材料液压机
然后是用于中断处理的宏定义:
In the following, bit refers to the bit position on which to operate, var refers to the field value, and sel is 0 for the low interrupt selector register and non_zero for the high interrupt selector refister.
INTR_CHECK_FLAG(bit)
INTR_CLK_FLAG(bit)
INTR_DISABLE(bit)
INTR_ENABLE(bit)
INTR_EXT_POLARITY(bit,val)
INTR_GET_ISN(intsel,sel)
热水回收
平开门电机INTR_GLOBAL_DISABLE()
INTR_GLOBAL_ENABLE()
INTR_MAP_RESET()
INTR_SET_FLAG(bit)
INTR_SET_MAP(intsel,val,sel)
中断实现过程:
1、 初始化中断服务表指针(ISTP):intr_init();
2、 选择用哪一个中断:intr_map(CPU_INT7,ISN_EXT_INT7);
adma3、 清中断:INTR_CLR_FLAG(CPU_INT7);
4、 中断服务子程序与中断号挂钩:intr_hook(INT7_ISR,CPU_INT7);
5、 打开非屏蔽中断:INTR_ENABLE(CPU_INT_NMI);
6、 打开所选中断:INTR_ENABLE(CPU_INT7);
7、 全局中断使能: INTR_GLOBAL_ENABLE();
注意:中断处理函数都是小写的,而宏定义都是大写的。在使用中断时,每一步不是必须的,顺序也不是固定的。INT7_ISR是中断服务子程序名,名字可任意取。