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

📄 csl_dmaxgetnextfreeparamentry.c

📁 Configuring External Interrupts on TMS320C672x Devices
💻 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_dmaxGetNextFreeParamEntry.c * *  @brief  File for functional layer of CSL  *					API @a CSL_dmaxGetNextFreeParamEntry() * *  Description *    - The @a CSL_dmaxGetNextFreeParamEntry() function definition & it's  *		associated functions * *  Modification 1 *    - Modified on: 11/Mar/2005 *    - Reason: created the sources *  *  @author asr. */#include <csl_dmax.h>extern CSL_DmaxResourceAlloc CslDmaxAlloc;/** ===========================================================================* @func CSL_dmaxGetNextFreeParamEntry * *   @b Description *   @n Searchs for next free ParamEntry for given resource type * *  *        *   @b Arguments *   @verbatim *     *          uid  		Pointer to Parameter Table Entry where data is stored *          st  		Status *            *   @endverbatim * *   <b> Return Value </b> CSL_Status *   @li                   CSL_SOK - Found next free Parameter Entry.      * *   @li                   CSL_ESYS_OVFL - Next free Parameter Entry not found * * *   <b> Pre Condition </b> *   @n  Both CSL_dmaxInit() and a CSL_dmaxOpen() must be called * *   <b> Post Condition </b> *   @n  None  * *   @b  Modifies *   @n  None * *   @b Example *   @verbatim            CSL_dmaxGetNextFreeParameterEntry(hDmax->paramUid, &status);     @endverbatim *  * ============================================================================ */Uint32 CSL_dmaxGetNextFreeParamEntry (    Uint32		uid,    CSL_Status	*st){    Uint32			ndx = ((uid) >> 28 & 0xFFFFu) - 1;    CSL_DmaxAlloc	*allocPtr = (CSL_DmaxAlloc *) (&CslDmaxAlloc);    Uint32			found = 0, nextFreeBit = 0;    Uint32			mask = 1;    while ((found != 1) && (nextFreeBit <= allocPtr[ndx].maxCount)) {        if ((allocPtr[ndx].allocMap & mask) != 0) {            nextFreeBit++;            mask = mask << 1;        }        else {            found = 1;        }    }    if (nextFreeBit >= allocPtr[ndx].maxCount) {        *st = CSL_ESYS_OVFL;        nextFreeBit = (Uint32) CSL_ESYS_OVFL;    }    else {        *st = CSL_SOK;    }    return nextFreeBit;}

⌨️ 快捷键说明

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