📄 csl_intceventenable.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_intcEventEnable.c * * @brief File for functional layer of CSL API @a CSL_intcEventEnable() * * Description * - @a CSL_intcEventEnable() function definition * * Path: \\(CSLPATH)\\soc\\davinci\\arm9\\src\\intc * * Modification * - Modified on: 2004/06/03 (Francis S) * - Reason: Adapted to Hibari/Davinci * * - 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_intcEventEnable * * @b Description * @n Enable an event. The API enables the specified event. If the user wishes * to restore the enable-state of the event at a later point of time, they * may store the current state using the parameter, which could be used * with CSL_intcEventRestore (). * Note: The function directly works on the event and hence it is * not necessary to "open" the event to invoke the API. * * @b Arguments * @verbatim eventId Event-ID of interest prevState (Optional) Pointer to object that would store current state @endverbatim * * <b> Return Value </b> CSL_Status * @li CSL_SOK on success * * @b Example: * @verbatim CSL_intcEventEnable(CSL_INTC_EVENTID_UART1, NULL); @endverbatim * ============================================================================= */#pragma CODE_SECTION (CSL_intcEventEnable, ".text:csl_section:intc");CSL_Status CSL_intcEventEnable ( CSL_IntcEventId eventId, CSL_IntcEventEnableState *prevState){ CSL_Status status = CSL_SOK; CSL_IntcEventEnableState oldState; if ((eventId >= _CSL_INTC_EVENTID__INTC0START) && (eventId <= _CSL_INTC_EVENTID__INTC0END)) { /* can enable/disable only FIQ and IRQ exceptions; * so mete out preferential treatment to them */ if (eventId == CSL_INTC_EVENTID_FIQ) { oldState = (CSL_IntcEventEnableState) _CSL_intc0EnableFIQ( ); } else if (eventId == CSL_INTC_EVENTID_IRQ) { oldState = (CSL_IntcEventEnableState) _CSL_intc0EnableIRQ( ); } else { status = CSL_ESYS_NOTSUPPORTED; } } else if ((eventId >= _CSL_INTC_EVENTID__INTC1START) && (eventId <= _CSL_INTC_EVENTID__INTC1END)) { oldState = (CSL_IntcEventEnableState) _CSL_intc1Enable(eventId - _CSL_INTC_EVENTID__INTC1START); } else { status = CSL_ESYS_NOTSUPPORTED; } if (prevState) { *prevState = oldState; } return status;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -