📄 csl_intcgethwstatus.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_intcGetHwStatus.c * * @brief File for functional layer of CSL API @a CSL_intcGetHwStatus() * * Description * - @a CSL_intcGetHwStatus() function definition * * Path: \\(CSLPATH)\\soc\\davinci\\arm9\\src\\intc * * Modification * - Modified on: 2004/06/04 (Francis S) * - Reason: Remove Level2 Interrupts, SENSE query * * - 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_intcGetHwStatus * * @b Description * @n Queries the peripheral for status. The CSL_intcGetHwStatus () API * could be used to retrieve status or configuration information from * the peripheral. The user must allocate an object that would hold * the retrieved information and pass a pointer to it to the function. * The type of the object is specific to the query-command. * * @b Arguments * @verbatim hIntc Handle identifying the event query The query to this API of INTC which indicates the status to be returned. response Placeholder to return the status. @endverbatim * * <b> Return Value </b> CSL_Status * @li CSL_SOK - Status info return successful * @li CSL_ESYS_BADHANDLE - Invalid handle * @li CSL_ESYS_INVQUERY - Invalid query * @li CSL_ESYS_NOTSUPPORTED - Action not supported * * <b> Pre Condition </b> * @n None * * <b> Post Condition </b> * @n None * * @b Modifies * @n None * * @b Example: * @verbatim Bool evtPending = FALSE; while (evtPending == FALSE) { CSL_intcGetHwStatus(hIntc, CSL_INTC_QUERY_ISEVENTPENDING, &evtPending); } @endverbatim * ============================================================================= */#pragma CODE_SECTION (CSL_intcGetHwStatus, ".text:csl_section:intc");CSL_Status CSL_intcGetHwStatus ( CSL_IntcHandle hIntc, CSL_IntcHwStatusQuery query, void *response){ CSL_Status status = CSL_SOK; if ((hIntc->eventId >= _CSL_INTC_EVENTID__INTC0START) && (hIntc->eventId <= _CSL_INTC_EVENTID__INTC0END)) { /* the 'queries' do not apply to the "INTC0" * module (that encapsulates the ARM Core) */ switch (query) { 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 (query) { case CSL_INTC_QUERY_PRIORITY: *(_CSL_Intc1Priority *)response = (_CSL_Intc1Priority) (_CSL_intc1GetPriority(evtId) + _CSL_INTC_PRIORITY__INTC1START); break; case CSL_INTC_QUERY_TYPE: *(_CSL_Intc1Route *)response = _CSL_intc1GetRoute(evtId); break; case CSL_INTC_QUERY_ISEVENTPENDING: *(Bool *)response = !(_CSL_intc1Test(evtId)); break; default: status = CSL_ESYS_INVQUERY; break; } } else { status = CSL_ESYS_BADHANDLE; } return status;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -