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

📄 csl_intcdispatcherinit.c

📁 TI达芬奇dm644x各硬件模块测试代码
💻 C
字号:
/*  ============================================================================ *   Copyright (c) Texas Instruments Inc 2002, 2003, 2004, 2005 * *   Use of this software is controlled by the terms and conditions found in the *   license agreement under which this software has been supplied. *   =========================================================================== *//** @file  csl_intcDispatcherInit.c * *  @brief  File for functional layer of CSL API @a CSL_intcDispatcherInit() * *  Description *  - @a CSL_intcDispatcherInit() function definition * *  Path: \\(CSLPATH)\\soc\\davinci\\arm9\\src\\intc * *  Modification *  - Modified on: 2004/04/15 (Francis S) *  - Reason: Adapting to Hibari/ Davinci INTC * *  - Modified on: 2004/04/15 *  - Reason: creation * *  Date   2004/04/15 *  Author RG Kiran */#include <csl_intc.h>#include <csl_types.h>#include <csl_error.h>#include <csl_sysData.h>#include <_csl_intc0.h>#include <_csl_intc1.h>#include <_csl_intc.h>/** ============================================================================ *  @n@b CSL_intcDispatcherInit * *  @b Description *  @n Hooks up and sets up the CSL interrupt dispatchers. *     The user should call CSL_intcDispatcherInit () if they *     wish to make use of the dispatchers built into the CSL INTC *     module. This API must be called before using CSL_intcPlugEventHandler () * *  @b Arguments *  @n None * *  <b> Return Value </b> CSL_Status *  @li                   CSL_SOK on success *  @li                   CSL_ESYS_FAIL on failure. * *  @b Example: *  @verbatim      CSL_sysInit( );      if (CSL_intcInit( ) != CSL_SOK) {        // module initialization failed! //      }      if (CSL_intcDispatcherInit( ) != CSL_SOK) {        // CSL dispatcher setting up failed! //      }    @endverbatim * ============================================================================= */#pragma CODE_SECTION (CSL_intcDispatcherInit, ".text:csl_section:intc");CSL_Status CSL_intcDispatcherInit (    void){    CSL_Status                  status;    CSL_IntcGlobalEnableState   gie;    register int                i;    CSL_intcGlobalDisable(&gie);    CSL_sysDataHandle->intcEventHandlerRecord = _CSL_intcEventHandlerRecord;    _CSL_intc0HookVector(_CSL_INTC0_EXCP_FIQ, (void *)_CSL_intcDispatchFIQ);    _CSL_intc0HookVector(_CSL_INTC0_EXCP_IRQ, (void *)_CSL_intcDispatchIRQ);    /* First interrupt table entry must be a 'return from interrupt'     * instruction     */    for(i = 0; i < (CSL_INTC_EVENTID_CNT+1); ++i) {        CSL_sysDataHandle->intcEventHandlerRecord[i].handler  =            _CSL_INTC_EVTHANDLER_UNPLUGGED;    }    if((Uint32)CSL_sysDataHandle->intcEventHandlerRecord & 7) {        /* entry table must be 8-byte aligned */        status = CSL_ESYS_FAIL;    } else {        ((CSL_Intc1RegsOvly)CSL_INTC1_REGS)->EABASE =            CSL_FMK (INTC_EABASE_EABASE,                     ((Uint32)CSL_sysDataHandle->intcEventHandlerRecord >> 3))          | CSL_FMK (INTC_EABASE_SIZE, CSL_INTC_EABASE_SIZE_16BYTE);        ((CSL_Intc1RegsOvly)CSL_INTC1_REGS)->INTCTL =            CSL_FMK(INTC_INTCTL_IDMODE, CSL_INTC_INTCTL_IDMODE_IMMEDIATE)          | CSL_FMK(INTC_INTCTL_IERAW, CSL_INTC_INTCTL_IERAW_DISABLE)          | CSL_FMK(INTC_INTCTL_FERAW, CSL_INTC_INTCTL_FERAW_DISABLE);        status = CSL_SOK;    }    /* we are now all set for action; energize all interrupt-paths */    CSL_intcGlobalRestore(gie);    return status;}

⌨️ 快捷键说明

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