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

📄 csl_pmxhwcontrol.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_pmxHwControl.c
 *
 *    @brief    File for functional layer of CSL API @a CSL_pmxHwControl()
 *
 *  Path: \\(CSLPATH)\\ipmodules\\pmx\\src
 *
 *  Description
 *    - The @a CSL_pmxHwControl() function definition & it's associated
 *      functions
 *
 */

/* =============================================================================
 *  Revision History
 *  ===============
 *  08-nov-2004 BRN File Created
 *
 * =============================================================================
 */
#include <csl_pmx.h>
#include <csl_pmxAux.h>


/** @brief Takes a command with an optional argument & implements it.
 */

/** ============================================================================
 *   @n@b CSL_pmxHwControl
 *
 *   @b Description
 *   @n Takes a command of PMX with an optional argument & implements it.
 *
 *   @b Arguments
 *   @verbatim
            hPmx        Handle to the PMX instance

            cmd             The command to this API indicates the action to be
                            taken on PMX.

            arg             An optional argument.

     @endverbatim
 *
 *   <b> Return Value </b>  CSL_Status
 *   @li         CSL_SOK               - Status info return successful.
 *   @li         CSL_ESYS_BADHANDLE    - Invalid handle
 *   @li         CSL_ESYS_INVCMD       - Invalid command
 *   @li         CSL_ESYS_INVPARAMS    - Invalid parameter
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  None
 *
 *   @b Modifies
 *   @n The hardware registers of PMX.
 *
 *   @b Example
 *   @verbatim
        CSL_PmxHandle         hPmx;
        CSL_PmxHwControlCmd   cmd;
        void                  arg;

        status = CSL_pmxHwControl (hPmx, cmd, &arg);

     @endverbatim
 * =============================================================================
 */
#pragma CODE_SECTION (CSL_pmxHwControl, ".text:csl_section:pmx");
CSL_Status  CSL_pmxHwControl(
    /** Pointer to the object that holds reference to the
     *  instance of PMX requested after the call
     */
    CSL_PmxHandle        hPmx,
    /** The command to this API indicates the action to be taken
     */
    CSL_PmxHwControlCmd  cmd,
    /** An optional argument @a void* casted
     */
    void                 *arg
)
{
    CSL_Status status = CSL_SOK;

    if (hPmx == NULL)
        return CSL_ESYS_BADHANDLE;

    switch(cmd){
        case CSL_PMX_CMD_SET_PIN_MUX0:
            CSL_pmxSetPinMux0 (hPmx, arg);
            break;

        case CSL_PMX_CMD_SET_PIN_MUX1:
            CSL_pmxSetPinMux1 (hPmx, arg);
            break;

       default:
            status = CSL_ESYS_INVCMD ;
            break;
    }

  return status;
}

⌨️ 快捷键说明

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