⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 smc_interrupt.c

📁 dsp tms320c6486的csl例程
💻 C
字号:
/*  ============================================================================
 *   Copyright (c) Texas Instruments Inc 2002, 2003, 2004, 2005, 2006
 *
 *   Use of this software is controlled by the terms and conditions found
 *   in the license agreement under which this software has been supplied.
 *  ============================================================================
 */
/** ============================================================================
 *
 *   @file  smc_interrupt.c
 *
 *   @path  $(CSLPATH)\example\c6486\smc\src
 *
 *   @desc  Common functions for interrupt setup and ISRs
 *
 * =============================================================================
 */
#include <csl_intc.h>
#include <cslr_intc.h>
#include <smc_interrupt.h>
#include <csl_smc.h>
#include <csl_smcp.h>

CSL_IntcContext context;
CSL_IntcEventHandlerRecord Record[8];

CSL_IntcObj intcSmcObj0;
CSL_IntcObj intcSmcObj1;

CSL_IntcHandle hIntcSmc0;
CSL_IntcHandle hIntcSmc1;

extern volatile Bool INT_OCCURED;

/*
 * =============================================================================
 *   @func   smcIntSetup
 *
 *   @desc
 *  @n Setup the SMC and SMCP interrupts
 *
 *  @arg  
 *      None
 *
 *  @return
 *      None
 * =============================================================================
 */
void smcIntSetup (
    void
)
{
    CSL_IntcParam vectId1 = CSL_INTC_VECTID_9;
    CSL_IntcParam vectId2 = CSL_INTC_VECTID_10;

    CSL_IntcGlobalEnableState state;

    /* Setup the global Interrupt */
    context.numEvtEntries = 9;
    context.eventhandlerRecord = Record;
    CSL_intcInit(&context);

    /* Enable NMIs  */
    CSL_intcGlobalNmiEnable();

    /* Enable Global Interrupts  */
    CSL_intcGlobalEnable(&state);
    
    /*Open Intc handles */
    hIntcSmc0 = CSL_intcOpen(&intcSmcObj0, CSL_INTC_EVENTID_SMCMPINT,
                             &vectId1, NULL);

    hIntcSmc1 = CSL_intcOpen(&intcSmcObj1, CSL_INTC_EVENTID_SMCPEVT,
                             &vectId2, NULL);

    CSL_intcHookIsr(vectId1, &isr_smc_mprot);
    CSL_intcHookIsr(vectId2, &isr_smc_pe);

    /* Clear the Interrupt */
    CSL_intcHwControl(hIntcSmc0,CSL_INTC_CMD_EVTCLEAR,NULL);
    CSL_intcHwControl(hIntcSmc1,CSL_INTC_CMD_EVTCLEAR,NULL);

    /* Enable the Interrupt */
    CSL_intcHwControl(hIntcSmc0,CSL_INTC_CMD_EVTENABLE,NULL);
    CSL_intcHwControl(hIntcSmc1,CSL_INTC_CMD_EVTENABLE,NULL);
}
/*
 * =============================================================================
 *   @func   smcIntClose
 *
 *   @desc
 *  @n Closed SMC and SMCP interrupt handlers
 *
 *  @arg  
 *      None
 *
 *  @return
 *      None
 * =============================================================================
 */

void smcIntClose (
    void
)
{
    CSL_intcClose(hIntcSmc0);
    CSL_intcClose(hIntcSmc1);
}

/*
 * =============================================================================
 *  @func   isr_smc_mprot
 *
 *  @desc
 *  @n Interrupt service routine for mprot interrupt
 *
 *  @arg  
 *      None
 *
 *  @return
 *      None
 * =============================================================================
 */
interrupt void isr_smc_mprot()
{
}

/*
 * =============================================================================
 *  @func   isr_smc_pe
 *
 *  @desc
 *  @n Interrupt service routine for profiler interrupt
 *
 *  @arg  
 *      None
 *
 *  @return
 *      None
 * =============================================================================
 */
interrupt void isr_smc_pe()
{
    INT_OCCURED = TRUE ;
}


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -