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

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


/* =============================================================================
 *  Revision History
 *  ===============
 *
 *  20-dec-2004 BRN File Created
 *
 * =============================================================================
 */

#include <csl_pmx.h>

/** @brief Gets the current setup of PMX.
 */
/** ============================================================================
 *   @n@b CSL_pmxGetHwSetup
 *
 *   @b Description
 *   @n It retrives the hardware setup parameters of the PMX
 *      specified by the given handle.
 *
 *   @b Arguments
 *   @verbatim
            hArmpllc        Handle to the PMX

            hwSetup         Pointer to the harware setup structure

     @endverbatim
 *
 *   <b> Return Value </b>  CSL_Status
 *   @li                    CSL_SOK             - Retrieving the hardware setup
 *                                                parameters is successful
 *   @li                    CSL_ESYS_BADHANDLE  - The handle is passed is
 *                                                invalid
 *   @li                    CSL_ESYS_INVPARAMS  - Invalid parameter
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  The hardware setup structure is populated with the hardware setup
 *       parameters
 *
 *   @b Modifies
 *   @n hwSetup variable
 *
 *   @b Example
 *   @verbatim
            CSL_PmxHandle   hPmx;
            CSL_PmxHwSetup  hwSetup;

            ...

            status = CSL_pmxGetHwSetup(hPmx, &hwSetup);

            ...

     @endverbatim
 * ===========================================================================
 */
#pragma CODE_SECTION (CSL_pmxGetHwSetup, ".text:csl_section:pmx")
CSL_Status  CSL_pmxGetHwSetup(
    /** Pointer to the object that holds reference to the
     *  instance of PMX requested after the call
     */
    CSL_PmxHandle                         hPmx,
    /** Pointer to setup structure which contains the
     *  information to program PMX to a useful state
     */
    CSL_PmxHwSetup                        *setup
)
{
    CSL_Status       status = CSL_SOK;

    if (hPmx == NULL)
        return CSL_ESYS_BADHANDLE;

    if (setup == NULL)
        return CSL_ESYS_INVPARAMS;

    /* Gets the values of the PinMux0 structure values of PMX module*/
    setup->pinMux0Setup.emacEn  = CSL_FEXT(hPmx->regs->PinMux0, PMX_PINMUX0_EMACEN );
    setup->pinMux0Setup.En1394  = CSL_FEXT(hPmx->regs->PinMux0, PMX_PINMUX0_1394EN );
    setup->pinMux0Setup.hpiEn   = CSL_FEXT(hPmx->regs->PinMux0, PMX_PINMUX0_HPIEN  );
    setup->pinMux0Setup.cfldEn  = CSL_FEXT(hPmx->regs->PinMux0, PMX_PINMUX0_CFLDEN );
    setup->pinMux0Setup.cwEn    = CSL_FEXT(hPmx->regs->PinMux0, PMX_PINMUX0_CWEN   );
    setup->pinMux0Setup.lfldEn  = CSL_FEXT(hPmx->regs->PinMux0, PMX_PINMUX0_LFLDEN );
    setup->pinMux0Setup.loeEn   = CSL_FEXT(hPmx->regs->PinMux0, PMX_PINMUX0_LOEEN  );
    setup->pinMux0Setup.rgb888  = CSL_FEXT(hPmx->regs->PinMux0, PMX_PINMUX0_RGB888 );
    setup->pinMux0Setup.ataEn   = CSL_FEXT(hPmx->regs->PinMux0, PMX_PINMUX0_ATAEN  );
    setup->pinMux0Setup.hdirEn  = CSL_FEXT(hPmx->regs->PinMux0, PMX_PINMUX0_HDIREN );
    setup->pinMux0Setup.vlynqEn = CSL_FEXT(hPmx->regs->PinMux0, PMX_PINMUX0_VLYNQEN);
    setup->pinMux0Setup.vlscrEn = CSL_FEXT(hPmx->regs->PinMux0, PMX_PINMUX0_VLSCREN);
    setup->pinMux0Setup.vlynqWd = CSL_FEXT(hPmx->regs->PinMux0, PMX_PINMUX0_VLYNQWD);
    setup->pinMux0Setup.aeCs5   = CSL_FEXT(hPmx->regs->PinMux0, PMX_PINMUX0_AECS5  );
    setup->pinMux0Setup.aeCs4   = CSL_FEXT(hPmx->regs->PinMux0, PMX_PINMUX0_AECS4  );
    setup->pinMux0Setup.aeAw    = CSL_FEXT(hPmx->regs->PinMux0, PMX_PINMUX0_AEAW   );

    /* Gets the values of the PinMux1 structure values of PMX module*/
    setup->pinMux1Setup.timin = CSL_FEXT(hPmx->regs->PinMux1, PMX_PINMUX1_TIMIN);
    setup->pinMux1Setup.clk1  = CSL_FEXT(hPmx->regs->PinMux1, PMX_PINMUX1_CLK1 );
    setup->pinMux1Setup.clk0  = CSL_FEXT(hPmx->regs->PinMux1, PMX_PINMUX1_CLK0 );
    setup->pinMux1Setup.mcbsp = CSL_FEXT(hPmx->regs->PinMux1, PMX_PINMUX1_MCBSP);
    setup->pinMux1Setup.mstk  = CSL_FEXT(hPmx->regs->PinMux1, PMX_PINMUX1_MSTK );
    setup->pinMux1Setup.spi   = CSL_FEXT(hPmx->regs->PinMux1, PMX_PINMUX1_SPI  );
    setup->pinMux1Setup.i2c   = CSL_FEXT(hPmx->regs->PinMux1, PMX_PINMUX1_I2C  );
    setup->pinMux1Setup.pwm2  = CSL_FEXT(hPmx->regs->PinMux1, PMX_PINMUX1_PWM2 );
    setup->pinMux1Setup.pwm1  = CSL_FEXT(hPmx->regs->PinMux1, PMX_PINMUX1_PWM1 );
    setup->pinMux1Setup.pwm0  = CSL_FEXT(hPmx->regs->PinMux1, PMX_PINMUX1_PWM0 );
    setup->pinMux1Setup.u2Flo = CSL_FEXT(hPmx->regs->PinMux1, PMX_PINMUX1_U2FLO);
    setup->pinMux1Setup.uart2 = CSL_FEXT(hPmx->regs->PinMux1, PMX_PINMUX1_UART2);
    setup->pinMux1Setup.uart1 = CSL_FEXT(hPmx->regs->PinMux1, PMX_PINMUX1_UART1);
    setup->pinMux1Setup.uart0 = CSL_FEXT(hPmx->regs->PinMux1, PMX_PINMUX1_UART0);

    return status;
}

⌨️ 快捷键说明

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