📄 csl_intchwcontrol.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_intcHwControl.c * * @brief File for functional layer of CSL API @a CSL_intcHwControl() * * Description * - @a CSL_intcHwControl() function definition * * Path: \\(CSLPATH)\\soc\\davinci\\arm9\\src\\intc * * Modification * - Modified on: 2004/04/15 * - Reason: creation * * Date 2004/04/15 * Author RG Kiran */#include <csl_intc.h>#include <csl_error.h>#include <csl_types.h>#include <_csl_intc0.h>#include <_csl_intc1.h>/** ============================================================================ * @n@b CSL_intcHwControl * * @b Description * @n Perform a control-operation. This API is used to invoke any of the * supported control-operations supported by the module. * * @b Arguments * @verbatim hIntc Handle identifying the event command The command to this API indicates the action to be taken on INTC. commandArg An optional argument. @endverbatim * * <b> Return Value </b> CSL_Status * @li CSL_SOK - HwControl successful. * @li CSL_ESYS_BADHANDLE - Invalid handle * @li CSL_ESYS_INVCMD - Invalid command * @li CSL_ESYS_INVPARAMS - Invalid parameter * @li CSL_ESYS_FAIL - HwControl failed * * <b> Pre Condition </b> * @n None * * <b> Post Condition </b> * @n None * * @b Modifies * @n The hardware registers of INTC. * * @b Example * @verbatim CSL_IntcHandle hIntc; CSL_IntcHwControlCmd cmd; void arg; status = CSL_intcHwControl (hIntc, cmd, &arg); @endverbatim * ============================================================================= */#pragma CODE_SECTION (CSL_intcHwControl, ".text:csl_section:intc");CSL_Status CSL_intcHwControl ( CSL_IntcHandle hIntc, CSL_IntcHwControlCmd command, void *commandArg){ CSL_Status status = CSL_SOK; if ((hIntc->eventId >= _CSL_INTC_EVENTID__INTC0START) && (hIntc->eventId <= _CSL_INTC_EVENTID__INTC0END)) { switch(command) { case CSL_INTC_CMD_EVTENABLE: if (hIntc->eventId == CSL_INTC_EVENTID_FIQ) { _CSL_intc0EnableFIQ( ); } else if (hIntc->eventId == CSL_INTC_EVENTID_IRQ) { _CSL_intc0EnableIRQ( ); } else { status = CSL_ESYS_NOTSUPPORTED; } break; case CSL_INTC_CMD_EVTDISABLE: if (hIntc->eventId == CSL_INTC_EVENTID_FIQ) { _CSL_intc0DisableFIQ( ); } else if (hIntc->eventId == CSL_INTC_EVENTID_IRQ) { _CSL_intc0DisableIRQ( ); } else { status = CSL_ESYS_NOTSUPPORTED; } break; /* all the other "Control" commands do not apply! */ default: status = CSL_ESYS_NOTSUPPORTED; break; } } else if ((hIntc->eventId >= _CSL_INTC_EVENTID__INTC1START) && (hIntc->eventId <= _CSL_INTC_EVENTID__INTC1END)) { register _CSL_Intc1EventId evtId = (_CSL_Intc1EventId) (hIntc->eventId - _CSL_INTC_EVENTID__INTC1START); switch (command) { case CSL_INTC_CMD_SETPRIORITY: _CSL_intc1SetPriority(evtId, *(_CSL_Intc1Priority *)commandArg); break; case CSL_INTC_CMD_EVTENABLE: _CSL_intc1Enable(evtId); break; case CSL_INTC_CMD_EVTDISABLE: _CSL_intc1Disable(evtId); break; default: status = CSL_ESYS_INVCMD; } } else { status = CSL_ESYS_BADHANDLE; } return status;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -